From 292f035ae8b4a7fdffafb5f3c74e69bbde7bc7ea Mon Sep 17 00:00:00 2001 From: Hector Ramos Date: Tue, 31 Oct 2017 11:19:00 -0700 Subject: [PATCH] progress --- docgen/Libraries/.eslintrc | 7 - .../ART/ART.xcodeproj/project.pbxproj | 491 -- docgen/Libraries/ART/ARTCGFloatArray.h | 20 - docgen/Libraries/ART/ARTContainer.h | 18 - docgen/Libraries/ART/ARTGroup.h | 19 - docgen/Libraries/ART/ARTGroup.m | 26 - docgen/Libraries/ART/ARTNode.h | 32 - docgen/Libraries/ART/ARTNode.m | 82 - docgen/Libraries/ART/ARTRenderable.h | 25 - docgen/Libraries/ART/ARTRenderable.m | 89 - docgen/Libraries/ART/ARTSerializablePath.js | 76 - docgen/Libraries/ART/ARTShape.h | 18 - docgen/Libraries/ART/ARTShape.m | 68 - docgen/Libraries/ART/ARTSurfaceView.h | 16 - docgen/Libraries/ART/ARTSurfaceView.m | 54 - docgen/Libraries/ART/ARTText.h | 20 - docgen/Libraries/ART/ARTText.m | 127 - docgen/Libraries/ART/ARTTextFrame.h | 25 - docgen/Libraries/ART/Brushes/ARTBrush.h | 35 - docgen/Libraries/ART/Brushes/ARTBrush.m | 33 - .../Libraries/ART/Brushes/ARTLinearGradient.h | 14 - .../Libraries/ART/Brushes/ARTLinearGradient.m | 50 - docgen/Libraries/ART/Brushes/ARTPattern.h | 14 - docgen/Libraries/ART/Brushes/ARTPattern.m | 51 - .../Libraries/ART/Brushes/ARTRadialGradient.h | 14 - .../Libraries/ART/Brushes/ARTRadialGradient.m | 57 - docgen/Libraries/ART/Brushes/ARTSolidColor.h | 14 - docgen/Libraries/ART/Brushes/ARTSolidColor.m | 40 - docgen/Libraries/ART/RCTConvert+ART.h | 31 - docgen/Libraries/ART/RCTConvert+ART.m | 224 - docgen/Libraries/ART/ReactNativeART.js | 586 --- .../ART/ViewManagers/ARTGroupManager.h | 14 - .../ART/ViewManagers/ARTGroupManager.m | 26 - .../ART/ViewManagers/ARTNodeManager.h | 18 - .../ART/ViewManagers/ARTNodeManager.m | 36 - .../ART/ViewManagers/ARTRenderableManager.h | 17 - .../ART/ViewManagers/ARTRenderableManager.m | 30 - .../ART/ViewManagers/ARTShapeManager.h | 14 - .../ART/ViewManagers/ARTShapeManager.m | 26 - .../ART/ViewManagers/ARTSurfaceViewManager.h | 14 - .../ART/ViewManagers/ARTSurfaceViewManager.m | 23 - .../ART/ViewManagers/ARTTextManager.h | 14 - .../ART/ViewManagers/ARTTextManager.m | 27 - .../ActionSheetIOS/ActionSheetIOS.js | 84 - .../RCTActionSheet.xcodeproj/project.pbxproj | 235 - .../ActionSheetIOS/RCTActionSheetManager.h | 16 - .../ActionSheetIOS/RCTActionSheetManager.m | 204 - docgen/Libraries/Alert/Alert.js | 155 - docgen/Libraries/Alert/AlertIOS.js | 262 - .../Alert/RCTAlertManager.android.js | 25 - docgen/Libraries/Alert/RCTAlertManager.ios.js | 16 - docgen/Libraries/Animated/examples/demo.html | 712 --- docgen/Libraries/Animated/examples/pic1.jpg | Bin 18446 -> 0 bytes docgen/Libraries/Animated/examples/pic2.jpg | Bin 22628 -> 0 bytes docgen/Libraries/Animated/examples/pic3.jpg | Bin 20286 -> 0 bytes docgen/Libraries/Animated/examples/style.css | 81 - docgen/Libraries/Animated/release/gulpfile.js | 161 - .../Libraries/Animated/release/package.json | 34 - docgen/Libraries/Animated/src/Animated.js | 37 - .../Libraries/Animated/src/AnimatedEvent.js | 196 - .../Animated/src/AnimatedImplementation.js | 840 --- docgen/Libraries/Animated/src/AnimatedWeb.js | 21 - docgen/Libraries/Animated/src/Easing.js | 267 - .../Animated/src/NativeAnimatedHelper.js | 253 - docgen/Libraries/Animated/src/SpringConfig.js | 102 - .../Animated/src/__tests__/Animated-test.js | 780 --- .../src/__tests__/AnimatedNative-test.js | 672 --- .../Animated/src/__tests__/Easing-test.js | 125 - .../src/__tests__/Interpolation-test.js | 314 -- .../Animated/src/__tests__/bezier-test.js | 105 - .../Animated/src/animations/Animation.js | 73 - .../Animated/src/animations/DecayAnimation.js | 112 - .../src/animations/SpringAnimation.js | 291 -- .../src/animations/TimingAnimation.js | 155 - docgen/Libraries/Animated/src/bezier.js | 108 - .../Animated/src/createAnimatedComponent.js | 193 - .../Animated/src/nodes/AnimatedAddition.js | 65 - .../Animated/src/nodes/AnimatedDiffClamp.js | 73 - .../Animated/src/nodes/AnimatedDivision.js | 70 - .../src/nodes/AnimatedInterpolation.js | 388 -- .../Animated/src/nodes/AnimatedModulo.js | 64 - .../src/nodes/AnimatedMultiplication.js | 65 - .../Animated/src/nodes/AnimatedNode.js | 73 - .../Animated/src/nodes/AnimatedProps.js | 167 - .../Animated/src/nodes/AnimatedStyle.js | 127 - .../Animated/src/nodes/AnimatedTracking.js | 67 - .../Animated/src/nodes/AnimatedTransform.js | 123 - .../Animated/src/nodes/AnimatedValue.js | 309 -- .../Animated/src/nodes/AnimatedValueXY.js | 180 - .../src/nodes/AnimatedWithChildren.js | 77 - .../src/polyfills/InteractionManager.js | 15 - .../Libraries/Animated/src/polyfills/Set.js | 26 - .../Animated/src/polyfills/flattenStyle.js | 12 - docgen/Libraries/AppState/AppState.js | 211 - .../Libraries/BatchedBridge/BatchedBridge.js | 30 - .../Libraries/BatchedBridge/MessageQueue.js | 413 -- .../Libraries/BatchedBridge/NativeModules.js | 150 - .../__mocks__/MessageQueueTestConfig.js | 21 - .../__mocks__/MessageQueueTestModule.js | 24 - .../__tests__/MessageQueue-test.js | 113 - .../__tests__/NativeModules-test.js | 112 - docgen/Libraries/Blob/Blob.js | 153 - docgen/Libraries/Blob/BlobTypes.js | 25 - .../Blob/RCTBlob.xcodeproj/project.pbxproj | 347 -- docgen/Libraries/Blob/RCTBlobManager.h | 16 - docgen/Libraries/Blob/RCTBlobManager.m | 218 - docgen/Libraries/Blob/URL.js | 70 - docgen/Libraries/BugReporting/BugReporting.js | 105 - .../Libraries/BugReporting/dumpReactTree.js | 152 - docgen/Libraries/BugReporting/getReactData.js | 168 - docgen/Libraries/CameraRoll/CameraRoll.js | 258 - docgen/Libraries/CameraRoll/ImagePickerIOS.js | 40 - .../RCTAssetsLibraryRequestHandler.h | 26 - .../RCTAssetsLibraryRequestHandler.m | 117 - .../RCTCameraRoll.xcodeproj/project.pbxproj | 283 -- .../CameraRoll/RCTCameraRollManager.h | 24 - .../CameraRoll/RCTCameraRollManager.m | 246 - .../CameraRoll/RCTImagePickerManager.h | 15 - .../CameraRoll/RCTImagePickerManager.m | 175 - .../CameraRoll/RCTPhotoLibraryImageLoader.h | 14 - .../CameraRoll/RCTPhotoLibraryImageLoader.m | 113 - .../AccessibilityInfo.android.js | 66 - .../AccessibilityInfo.ios.js | 167 - .../ActivityIndicator/ActivityIndicator.js | 147 - .../AppleTV/TVEventHandler.android.js | 20 - .../Components/AppleTV/TVEventHandler.ios.js | 49 - .../Components/AppleTV/TVViewPropTypes.js | 87 - docgen/Libraries/Components/Button.js | 174 - .../Libraries/Components/CheckBox/CheckBox.js | 126 - .../Components/Clipboard/Clipboard.js | 43 - .../DatePicker/DatePickerIOS.android.js | 46 - .../DatePicker/DatePickerIOS.ios.js | 166 - .../DatePickerAndroid.android.js | 89 - .../DatePickerAndroid.ios.js | 22 - .../DrawerLayoutAndroid.android.js | 320 -- .../DrawerAndroid/DrawerLayoutAndroid.ios.js | 13 - .../Libraries/Components/Keyboard/Keyboard.js | 144 - .../Keyboard/KeyboardAvoidingView.js | 197 - docgen/Libraries/Components/LazyRenderer.js | 45 - .../MaskedView/MaskedViewIOS.android.js | 14 - .../MaskedView/MaskedViewIOS.ios.js | 108 - .../Navigation/NavigatorIOS.android.js | 13 - .../Components/Navigation/NavigatorIOS.ios.js | 939 ---- docgen/Libraries/Components/Picker/Picker.js | 167 - .../Picker/PickerAndroid.android.js | 164 - .../Components/Picker/PickerAndroid.ios.js | 13 - .../Components/Picker/PickerIOS.android.js | 15 - .../Components/Picker/PickerIOS.ios.js | 137 - .../ProgressBarAndroid.android.js | 131 - .../ProgressBarAndroid.ios.js | 13 - .../ProgressViewIOS.android.js | 49 - .../ProgressViewIOS/ProgressViewIOS.ios.js | 86 - .../RefreshControl/RefreshControl.js | 188 - .../__mocks__/RefreshControlMock.js | 29 - .../Libraries/Components/ScrollResponder.js | 614 --- .../Components/ScrollView/ScrollView.js | 916 ---- .../ScrollView/ScrollViewStickyHeader.js | 118 - .../ScrollView/__mocks__/ScrollViewMock.js | 33 - .../ScrollView/processDecelerationRate.js | 22 - .../SegmentedControlIOS.android.js | 49 - .../SegmentedControlIOS.ios.js | 134 - docgen/Libraries/Components/Slider/Slider.js | 212 - .../Components/StaticContainer.react.js | 46 - docgen/Libraries/Components/StaticRenderer.js | 36 - .../Components/StatusBar/StatusBar.js | 416 -- .../StatusBar/StatusBarIOS.android.js | 16 - .../Components/StatusBar/StatusBarIOS.ios.js | 22 - docgen/Libraries/Components/Subscribable.js | 64 - docgen/Libraries/Components/Switch/Switch.js | 152 - .../Components/TabBarIOS/TabBarIOS.android.js | 38 - .../Components/TabBarIOS/TabBarIOS.ios.js | 104 - .../TabBarIOS/TabBarItemIOS.android.js | 44 - .../Components/TabBarIOS/TabBarItemIOS.ios.js | 153 - .../Components/TextInput/TextInput.js | 927 ---- .../Components/TextInput/TextInputState.js | 76 - .../TimePickerAndroid.android.js | 67 - .../TimePickerAndroid.ios.js | 22 - .../ToastAndroid/ToastAndroid.android.js | 75 - .../ToastAndroid/ToastAndroid.ios.js | 27 - .../ToolbarAndroid/ToolbarAndroid.android.js | 215 - .../ToolbarAndroid/ToolbarAndroid.ios.js | 13 - .../Touchable/BoundingDimensions.js | 48 - .../Components/Touchable/Position.js | 38 - .../Components/Touchable/Touchable.js | 808 --- .../Components/Touchable/TouchableBounce.js | 183 - .../Touchable/TouchableHighlight.js | 328 -- .../TouchableNativeFeedback.android.js | 267 - .../Touchable/TouchableNativeFeedback.ios.js | 46 - .../Components/Touchable/TouchableOpacity.js | 198 - .../Touchable/TouchableWithoutFeedback.js | 207 - .../__mocks__/ensureComponentIsNative.js | 11 - .../__tests__/TouchableHighlight-test.js | 26 - .../TouchableHighlight-test.js.snap | 40 - .../Touchable/ensureComponentIsNative.js | 24 - .../Touchable/ensurePositiveDelayProps.js | 24 - .../UnimplementedViews/UnimplementedView.js | 50 - .../View/PlatformViewPropTypes.android.js | 13 - .../View/PlatformViewPropTypes.ios.js | 20 - .../View/ReactNativeStyleAttributes.js | 47 - .../View/ReactNativeViewAttributes.js | 49 - .../Components/View/ShadowPropTypesIOS.js | 53 - docgen/Libraries/Components/View/View.js | 143 - .../Components/View/ViewAccessibility.js | 65 - .../Components/View/ViewPropTypes.js | 467 -- .../Components/View/ViewStylePropTypes.js | 56 - .../ViewPager/ViewPagerAndroid.android.js | 250 - .../ViewPager/ViewPagerAndroid.ios.js | 13 - .../Components/WebView/WebView.android.js | 429 -- .../Components/WebView/WebView.ios.js | 639 --- .../__tests__/parseErrorStack-test.js | 47 - .../Libraries/Core/Devtools/getDevServer.js | 40 - .../Core/Devtools/openFileInEditor.js | 23 - .../Core/Devtools/parseErrorStack.js | 40 - .../Libraries/Core/Devtools/setupDevtools.js | 65 - .../Core/Devtools/symbolicateStackTrace.js | 75 - docgen/Libraries/Core/ExceptionsManager.js | 114 - docgen/Libraries/Core/InitializeCore.js | 234 - docgen/Libraries/Core/ReactNativeVersion.js | 20 - docgen/Libraries/Core/Timers/JSTimers.js | 495 -- docgen/Libraries/Core/__mocks__/ErrorUtils.js | 33 - .../MissingNativeEventEmitterShim.js | 54 - .../EventEmitter/NativeEventEmitter.js | 60 - .../EventEmitter/RCTDeviceEventEmitter.js | 71 - .../Libraries/EventEmitter/RCTEventEmitter.js | 25 - .../EventEmitter/RCTNativeAppEventEmitter.js | 21 - .../__mocks__/NativeEventEmitter.js | 25 - docgen/Libraries/Experimental/Incremental.js | 188 - .../Experimental/IncrementalExample.js | 188 - .../Experimental/IncrementalGroup.js | 84 - .../Experimental/IncrementalPresenter.js | 99 - .../SwipeableRow/SwipeableListView.js | 219 - .../SwipeableListViewDataSource.js | 105 - .../SwipeableQuickActionButton.js | 75 - .../SwipeableRow/SwipeableQuickActions.js | 73 - .../Experimental/SwipeableRow/SwipeableRow.js | 395 -- .../Experimental/WindowedListView.js | 750 --- docgen/Libraries/Geolocation/Geolocation.js | 213 - .../RCTGeolocation.xcodeproj/project.pbxproj | 236 - .../Geolocation/RCTLocationObserver.h | 14 - .../Geolocation/RCTLocationObserver.m | 407 -- docgen/Libraries/Image/AssetRegistry.js | 40 - docgen/Libraries/Image/AssetSourceResolver.js | 164 - docgen/Libraries/Image/Image.android.js | 370 -- docgen/Libraries/Image/Image.ios.js | 397 -- docgen/Libraries/Image/ImageBackground.js | 97 - docgen/Libraries/Image/ImageEditor.js | 72 - docgen/Libraries/Image/ImageResizeMode.js | 51 - docgen/Libraries/Image/ImageSource.js | 28 - docgen/Libraries/Image/ImageSourcePropType.js | 92 - docgen/Libraries/Image/ImageStore.js | 84 - docgen/Libraries/Image/ImageStylePropTypes.js | 64 - docgen/Libraries/Image/RCTGIFImageDecoder.h | 14 - docgen/Libraries/Image/RCTGIFImageDecoder.m | 111 - .../Image/RCTImage.xcodeproj/project.pbxproj | 514 -- docgen/Libraries/Image/RCTImageBlurUtils.h | 16 - docgen/Libraries/Image/RCTImageBlurUtils.m | 77 - docgen/Libraries/Image/RCTImageCache.h | 15 - docgen/Libraries/Image/RCTImageCache.m | 99 - .../Libraries/Image/RCTImageEditingManager.h | 14 - .../Libraries/Image/RCTImageEditingManager.m | 82 - docgen/Libraries/Image/RCTImageLoader.h | 233 - docgen/Libraries/Image/RCTImageLoader.m | 851 ---- docgen/Libraries/Image/RCTImageShadowView.h | 14 - docgen/Libraries/Image/RCTImageShadowView.m | 25 - docgen/Libraries/Image/RCTImageStoreManager.h | 41 - docgen/Libraries/Image/RCTImageStoreManager.m | 237 - docgen/Libraries/Image/RCTImageUtils.h | 96 - docgen/Libraries/Image/RCTImageUtils.m | 388 -- docgen/Libraries/Image/RCTImageView.h | 28 - docgen/Libraries/Image/RCTImageView.m | 455 -- docgen/Libraries/Image/RCTImageViewManager.h | 14 - docgen/Libraries/Image/RCTImageViewManager.m | 87 - .../Image/RCTLocalAssetImageLoader.h | 14 - .../Image/RCTLocalAssetImageLoader.m | 71 - docgen/Libraries/Image/RCTResizeMode.h | 24 - docgen/Libraries/Image/RCTResizeMode.m | 22 - docgen/Libraries/Image/RelativeImageStub.js | 29 - .../__tests__/resolveAssetSource-test.js | 280 - docgen/Libraries/Image/nativeImageSource.js | 54 - docgen/Libraries/Image/resolveAssetSource.js | 92 - docgen/Libraries/Inspector/BorderBox.js | 38 - docgen/Libraries/Inspector/BoxInspector.js | 114 - docgen/Libraries/Inspector/ElementBox.js | 74 - .../Libraries/Inspector/ElementProperties.js | 159 - docgen/Libraries/Inspector/Inspector.js | 273 - .../Libraries/Inspector/InspectorOverlay.js | 86 - docgen/Libraries/Inspector/InspectorPanel.js | 156 - docgen/Libraries/Inspector/NetworkOverlay.js | 616 --- .../Libraries/Inspector/PerformanceOverlay.js | 68 - docgen/Libraries/Inspector/StyleInspector.js | 67 - docgen/Libraries/Inspector/resolveBoxStyle.js | 59 - docgen/Libraries/Interaction/Batchinator.js | 77 - .../Interaction/BridgeSpyStallHandler.js | 59 - .../Libraries/Interaction/FrameRateLogger.js | 74 - .../Interaction/InteractionManager.js | 214 - .../Libraries/Interaction/InteractionMixin.js | 55 - .../Interaction/InteractionStallDebugger.js | 28 - .../Interaction/JSEventLoopWatchdog.js | 88 - docgen/Libraries/Interaction/PanResponder.js | 415 -- .../Interaction/ReactPerfStallHandler.js | 35 - docgen/Libraries/Interaction/TaskQueue.js | 170 - .../Interaction/__tests__/Batchinator-test.js | 82 - .../__tests__/InteractionManager-test.js | 308 -- .../__tests__/InteractionMixin-test.js | 49 - .../Interaction/__tests__/TaskQueue-test.js | 154 - .../Libraries/JSInspector/InspectorAgent.js | 28 - docgen/Libraries/JSInspector/JSInspector.js | 37 - docgen/Libraries/JSInspector/NetworkAgent.js | 300 -- .../LayoutAnimation/LayoutAnimation.js | 166 - docgen/Libraries/Linking/Linking.js | 226 - .../RCTLinking.xcodeproj/project.pbxproj | 305 -- .../Libraries/LinkingIOS/RCTLinkingManager.h | 29 - .../Libraries/LinkingIOS/RCTLinkingManager.m | 136 - docgen/Libraries/Lists/FillRateHelper.js | 240 - docgen/Libraries/Lists/FlatList.js | 573 --- docgen/Libraries/Lists/ListView/ListView.js | 769 --- .../Lists/ListView/ListViewDataSource.js | 434 -- .../Lists/ListView/__mocks__/ListViewMock.js | 57 - docgen/Libraries/Lists/MetroListView.js | 214 - docgen/Libraries/Lists/SectionList.js | 342 -- docgen/Libraries/Lists/ViewabilityHelper.js | 299 -- docgen/Libraries/Lists/VirtualizeUtils.js | 208 - docgen/Libraries/Lists/VirtualizedList.js | 1327 ----- .../Libraries/Lists/VirtualizedSectionList.js | 524 -- .../Lists/__flowtests__/FlatList-flowtest.js | 113 - .../__flowtests__/SectionList-flowtest.js | 127 - .../Lists/__tests__/FillRateHelper-test.js | 121 - .../Lists/__tests__/FlatList-test.js | 62 - .../Lists/__tests__/SectionList-test.js | 107 - .../Lists/__tests__/ViewabilityHelper-test.js | 371 -- .../Lists/__tests__/VirtualizeUtils-test.js | 83 - .../Lists/__tests__/VirtualizedList-test.js | 162 - .../__snapshots__/FlatList-test.js.snap | 265 - .../__snapshots__/SectionList-test.js.snap | 535 -- .../VirtualizedList-test.js.snap | 828 --- docgen/Libraries/Modal/Modal.js | 241 - .../Drivers/RCTAnimationDriver.h | 39 - .../Drivers/RCTDecayAnimation.h | 14 - .../Drivers/RCTDecayAnimation.m | 124 - .../Drivers/RCTEventAnimation.h | 23 - .../Drivers/RCTEventAnimation.m | 40 - .../Drivers/RCTFrameAnimation.h | 14 - .../Drivers/RCTFrameAnimation.m | 151 - .../Drivers/RCTSpringAnimation.h | 14 - .../Drivers/RCTSpringAnimation.m | 207 - .../Nodes/RCTAdditionAnimatedNode.h | 14 - .../Nodes/RCTAdditionAnimatedNode.m | 28 - .../NativeAnimation/Nodes/RCTAnimatedNode.h | 48 - .../NativeAnimation/Nodes/RCTAnimatedNode.m | 120 - .../Nodes/RCTDiffClampAnimatedNode.h | 14 - .../Nodes/RCTDiffClampAnimatedNode.m | 63 - .../Nodes/RCTDivisionAnimatedNode.h | 14 - .../Nodes/RCTDivisionAnimatedNode.m | 35 - .../Nodes/RCTInterpolationAnimatedNode.h | 14 - .../Nodes/RCTInterpolationAnimatedNode.m | 73 - .../Nodes/RCTModuloAnimatedNode.h | 14 - .../Nodes/RCTModuloAnimatedNode.m | 23 - .../Nodes/RCTMultiplicationAnimatedNode.h | 14 - .../Nodes/RCTMultiplicationAnimatedNode.m | 29 - .../Nodes/RCTPropsAnimatedNode.h | 25 - .../Nodes/RCTPropsAnimatedNode.m | 108 - .../Nodes/RCTStyleAnimatedNode.h | 16 - .../Nodes/RCTStyleAnimatedNode.m | 53 - .../Nodes/RCTTransformAnimatedNode.h | 16 - .../Nodes/RCTTransformAnimatedNode.m | 59 - .../Nodes/RCTValueAnimatedNode.h | 31 - .../Nodes/RCTValueAnimatedNode.m | 58 - .../RCTAnimation.xcodeproj/project.pbxproj | 653 --- .../NativeAnimation/RCTAnimationUtils.h | 34 - .../NativeAnimation/RCTAnimationUtils.m | 97 - .../NativeAnimation/RCTNativeAnimatedModule.h | 20 - .../NativeAnimation/RCTNativeAnimatedModule.m | 249 - .../RCTNativeAnimatedNodesManager.h | 88 - .../RCTNativeAnimatedNodesManager.m | 430 -- docgen/Libraries/Network/FormData.js | 89 - docgen/Libraries/Network/NetInfo.js | 340 -- .../Libraries/Network/RCTDataRequestHandler.h | 18 - .../Libraries/Network/RCTDataRequestHandler.m | 75 - .../Libraries/Network/RCTFileRequestHandler.h | 18 - .../Libraries/Network/RCTFileRequestHandler.m | 92 - .../Libraries/Network/RCTHTTPRequestHandler.h | 18 - .../Network/RCTHTTPRequestHandler.mm | 150 - docgen/Libraries/Network/RCTNetInfo.h | 18 - docgen/Libraries/Network/RCTNetInfo.m | 154 - .../RCTNetwork.xcodeproj/project.pbxproj | 357 -- docgen/Libraries/Network/RCTNetworkTask.h | 49 - docgen/Libraries/Network/RCTNetworkTask.m | 202 - .../Network/RCTNetworking.android.js | 122 - docgen/Libraries/Network/RCTNetworking.h | 33 - docgen/Libraries/Network/RCTNetworking.ios.js | 90 - docgen/Libraries/Network/RCTNetworking.mm | 612 --- docgen/Libraries/Network/XHRInterceptor.js | 162 - docgen/Libraries/Network/XMLHttpRequest.js | 570 --- .../Network/__tests__/FormData-test.js | 57 - .../Network/__tests__/XMLHttpRequest-test.js | 224 - .../Libraries/Network/convertRequestBody.js | 40 - docgen/Libraries/Network/fetch.js | 19 - .../Performance/QuickPerformanceLogger.js | 95 - .../Libraries/Performance/SamplingProfiler.js | 36 - docgen/Libraries/Performance/Systrace.js | 322 -- .../PermissionsAndroid/PermissionsAndroid.js | 197 - docgen/Libraries/Promise.js | 47 - .../PushNotificationIOS.js | 514 -- .../project.pbxproj | 355 -- .../RCTPushNotificationManager.h | 27 - .../RCTPushNotificationManager.m | 478 -- .../FBSnapshotTestCase/FBSnapshotTestCase.h | 48 - .../FBSnapshotTestCase/FBSnapshotTestCase.m | 57 - .../FBSnapshotTestController.h | 122 - .../FBSnapshotTestController.m | 351 -- .../FBSnapshotTestCase/UIImage+Compare.h | 37 - .../FBSnapshotTestCase/UIImage+Compare.m | 91 - .../RCTTest/FBSnapshotTestCase/UIImage+Diff.h | 37 - .../RCTTest/FBSnapshotTestCase/UIImage+Diff.m | 56 - docgen/Libraries/RCTTest/RCTSnapshotManager.h | 14 - docgen/Libraries/RCTTest/RCTSnapshotManager.m | 48 - .../RCTTest/RCTTest.xcodeproj/project.pbxproj | 443 -- docgen/Libraries/RCTTest/RCTTestModule.h | 47 - docgen/Libraries/RCTTest/RCTTestModule.m | 91 - docgen/Libraries/RCTTest/RCTTestRunner.h | 132 - docgen/Libraries/RCTTest/RCTTestRunner.m | 176 - .../RCTTest/SnapshotViewIOS.android.js | 13 - .../Libraries/RCTTest/SnapshotViewIOS.ios.js | 69 - docgen/Libraries/ReactNative/AppContainer.js | 141 - docgen/Libraries/ReactNative/AppRegistry.js | 239 - docgen/Libraries/ReactNative/I18nManager.js | 26 - .../ReactNative/ReactNativeFeatureFlags.js | 46 - docgen/Libraries/ReactNative/UIManager.js | 84 - .../ReactNative/UIManagerStatTracker.js | 57 - docgen/Libraries/ReactNative/YellowBox.js | 515 -- .../Libraries/ReactNative/queryLayoutByID.js | 62 - .../ReactNative/renderApplication.js | 41 - .../ReactNative/requireNativeComponent.js | 151 - .../Libraries/ReactNative/verifyPropTypes.js | 81 - docgen/Libraries/Renderer/REVISION | 1 - .../Renderer/ReactNativeFiber-dev.js | 4522 ----------------- .../Renderer/ReactNativeFiber-prod.js | 3808 -------------- .../Renderer/ReactNativeStack-dev.js | 3054 ----------- .../Renderer/ReactNativeStack-prod.js | 2526 --------- .../Renderer/shims/NativeMethodsMixin.js | 23 - .../Libraries/Renderer/shims/PooledClass.js | 123 - .../Renderer/shims/ReactDebugTool.js | 19 - .../Renderer/shims/ReactGlobalSharedState.js | 19 - .../Libraries/Renderer/shims/ReactNative.js | 30 - .../shims/ReactNativeComponentTree.js | 20 - .../Renderer/shims/ReactNativePropRegistry.js | 20 - .../Renderer/shims/ReactNativeTypes.js | 93 - docgen/Libraries/Renderer/shims/ReactPerf.js | 18 - docgen/Libraries/Renderer/shims/ReactTypes.js | 52 - .../Renderer/shims/TouchHistoryMath.js | 19 - .../shims/createReactNativeComponentClass.js | 20 - .../Libraries/Renderer/shims/takeSnapshot.js | 19 - docgen/Libraries/Sample/Sample.android.js | 17 - docgen/Libraries/Sample/Sample.h | 5 - docgen/Libraries/Sample/Sample.ios.js | 19 - docgen/Libraries/Sample/Sample.m | 12 - .../Sample/Sample.xcodeproj/project.pbxproj | 254 - docgen/Libraries/Sample/package.json | 5 - .../RCTSettings.xcodeproj/project.pbxproj | 307 -- .../Libraries/Settings/RCTSettingsManager.h | 18 - .../Libraries/Settings/RCTSettingsManager.m | 109 - docgen/Libraries/Settings/Settings.android.js | 34 - docgen/Libraries/Settings/Settings.ios.js | 76 - docgen/Libraries/Share/Share.js | 118 - docgen/Libraries/Storage/AsyncStorage.js | 506 -- docgen/Libraries/StyleSheet/ColorPropType.js | 57 - .../StyleSheet/EdgeInsetsPropType.js | 32 - .../Libraries/StyleSheet/LayoutPropTypes.js | 514 -- docgen/Libraries/StyleSheet/PointPropType.js | 23 - docgen/Libraries/StyleSheet/StyleSheet.js | 205 - .../StyleSheet/StyleSheetPropType.js | 32 - .../Libraries/StyleSheet/StyleSheetTypes.js | 15 - .../StyleSheet/StyleSheetValidation.js | 80 - .../StyleSheet/TransformPropTypes.js | 95 - .../processTransform-test.js.snap | 29 - .../StyleSheet/__tests__/flattenStyle-test.js | 50 - .../__tests__/normalizeColor-test.js | 129 - .../StyleSheet/__tests__/processColor-test.js | 97 - .../__tests__/processTransform-test.js | 84 - .../__tests__/setNormalizedColorAlpha-test.js | 33 - docgen/Libraries/StyleSheet/flattenStyle.js | 51 - docgen/Libraries/StyleSheet/normalizeColor.js | 346 -- docgen/Libraries/StyleSheet/processColor.js | 42 - .../Libraries/StyleSheet/processTransform.js | 220 - .../StyleSheet/setNormalizedColorAlpha.js | 31 - .../Text/RCTBackedTextInputDelegate.h | 30 - .../Text/RCTBackedTextInputDelegateAdapter.h | 34 - .../Text/RCTBackedTextInputDelegateAdapter.m | 237 - .../Text/RCTBackedTextInputViewProtocol.h | 35 - docgen/Libraries/Text/RCTConvert+Text.h | 17 - docgen/Libraries/Text/RCTConvert+Text.m | 30 - docgen/Libraries/Text/RCTRawTextManager.h | 14 - docgen/Libraries/Text/RCTRawTextManager.m | 25 - docgen/Libraries/Text/RCTShadowRawText.h | 16 - docgen/Libraries/Text/RCTShadowRawText.m | 51 - docgen/Libraries/Text/RCTShadowText.h | 55 - docgen/Libraries/Text/RCTShadowText.m | 693 --- docgen/Libraries/Text/RCTShadowTextField.h | 14 - docgen/Libraries/Text/RCTShadowTextField.m | 19 - docgen/Libraries/Text/RCTShadowTextView.h | 14 - docgen/Libraries/Text/RCTShadowTextView.m | 19 - docgen/Libraries/Text/RCTText.h | 19 - docgen/Libraries/Text/RCTText.m | 268 - .../Text/RCTText.xcodeproj/project.pbxproj | 473 -- docgen/Libraries/Text/RCTTextField.h | 24 - docgen/Libraries/Text/RCTTextField.m | 140 - docgen/Libraries/Text/RCTTextFieldManager.h | 14 - docgen/Libraries/Text/RCTTextFieldManager.m | 94 - docgen/Libraries/Text/RCTTextInput.h | 62 - docgen/Libraries/Text/RCTTextInput.m | 331 -- docgen/Libraries/Text/RCTTextManager.h | 14 - docgen/Libraries/Text/RCTTextManager.m | 136 - docgen/Libraries/Text/RCTTextSelection.h | 28 - docgen/Libraries/Text/RCTTextSelection.m | 38 - docgen/Libraries/Text/RCTTextView.h | 36 - docgen/Libraries/Text/RCTTextView.m | 410 -- docgen/Libraries/Text/RCTTextViewManager.h | 14 - docgen/Libraries/Text/RCTTextViewManager.m | 101 - docgen/Libraries/Text/RCTUITextField.h | 33 - docgen/Libraries/Text/RCTUITextField.m | 165 - docgen/Libraries/Text/RCTUITextView.h | 36 - docgen/Libraries/Text/RCTUITextView.m | 241 - docgen/Libraries/Text/Text.js | 585 --- docgen/Libraries/Text/TextStylePropTypes.js | 97 - docgen/Libraries/Text/TextUpdateTest.js | 58 - docgen/Libraries/Utilities/BackAndroid.js | 49 - .../Utilities/BackHandler.android.js | 96 - docgen/Libraries/Utilities/BackHandler.ios.js | 116 - .../Libraries/Utilities/DebugEnvironment.js | 18 - docgen/Libraries/Utilities/DeviceInfo.js | 20 - docgen/Libraries/Utilities/Dimensions.js | 136 - docgen/Libraries/Utilities/HMRClient.js | 143 - .../Utilities/HMRLoadingView.android.js | 38 - .../Libraries/Utilities/HMRLoadingView.ios.js | 32 - docgen/Libraries/Utilities/HeapCapture.js | 28 - docgen/Libraries/Utilities/MatrixMath.js | 606 --- .../Libraries/Utilities/PerformanceLogger.js | 181 - docgen/Libraries/Utilities/PixelRatio.js | 122 - .../Libraries/Utilities/Platform.android.js | 30 - docgen/Libraries/Utilities/Platform.ios.js | 38 - docgen/Libraries/Utilities/RCTLog.js | 56 - docgen/Libraries/Utilities/SceneTracker.js | 41 - .../Utilities/__mocks__/BackHandler.js | 52 - .../Utilities/__mocks__/PixelRatio.js | 18 - .../Utilities/__tests__/MatrixMath-test.js | 141 - .../Utilities/__tests__/Platform-test.js | 31 - .../Utilities/__tests__/SceneTracker-test.js | 28 - .../__tests__/buildStyleInterpolator-test.js | 290 -- .../deepFreezeAndThrowOnMutationInDev-test.js | 122 - .../Utilities/__tests__/groupByEveryN-test.js | 38 - .../__tests__/mapWithSeparator-test.js | 55 - .../Utilities/__tests__/truncate-test.js | 56 - .../Utilities/__tests__/utf8-test.js | 61 - docgen/Libraries/Utilities/binaryToBase64.js | 30 - .../Utilities/buildStyleInterpolator.js | 572 --- docgen/Libraries/Utilities/clamp.js | 30 - .../Utilities/createStrictShapeTypeChecker.js | 77 - .../deepFreezeAndThrowOnMutationInDev.js | 75 - .../Utilities/defineLazyObjectProperty.js | 67 - .../Libraries/Utilities/deprecatedPropType.js | 38 - .../differ/__tests__/deepDiffer-test.js | 101 - .../Libraries/Utilities/differ/deepDiffer.js | 66 - .../Utilities/differ/insetsDiffer.js | 42 - .../Utilities/differ/matricesDiffer.js | 44 - .../Utilities/differ/pointsDiffer.js | 30 - .../Libraries/Utilities/differ/sizesDiffer.js | 24 - docgen/Libraries/Utilities/dismissKeyboard.js | 21 - docgen/Libraries/Utilities/groupByEveryN.js | 52 - docgen/Libraries/Utilities/infoLog.js | 20 - docgen/Libraries/Utilities/logError.js | 28 - .../Libraries/Utilities/mapWithSeparator.js | 29 - docgen/Libraries/Utilities/mergeFast.js | 34 - docgen/Libraries/Utilities/mergeIntoFast.js | 27 - docgen/Libraries/Utilities/stringifySafe.js | 49 - docgen/Libraries/Utilities/truncate.js | 45 - docgen/Libraries/Utilities/utf8.js | 91 - docgen/Libraries/Vibration/RCTVibration.h | 14 - docgen/Libraries/Vibration/RCTVibration.m | 23 - .../RCTVibration.xcodeproj/project.pbxproj | 232 - docgen/Libraries/Vibration/Vibration.js | 139 - .../Vibration/VibrationIOS.android.js | 23 - .../Libraries/Vibration/VibrationIOS.ios.js | 44 - .../WebSocket/RCTReconnectingWebSocket.h | 38 - .../WebSocket/RCTReconnectingWebSocket.m | 122 - docgen/Libraries/WebSocket/RCTSRWebSocket.h | 132 - docgen/Libraries/WebSocket/RCTSRWebSocket.m | 1608 ------ .../RCTWebSocket.xcodeproj/project.pbxproj | 561 -- .../WebSocket/RCTWebSocketExecutor.h | 21 - .../WebSocket/RCTWebSocketExecutor.m | 275 - .../Libraries/WebSocket/RCTWebSocketModule.h | 36 - .../Libraries/WebSocket/RCTWebSocketModule.m | 196 - .../WebSocket/RCTWebSocketObserver.h | 32 - .../WebSocket/RCTWebSocketObserver.m | 79 - docgen/Libraries/WebSocket/WebSocket.js | 267 - docgen/Libraries/WebSocket/WebSocketEvent.js | 29 - .../WebSocket/WebSocketInterceptor.js | 220 - .../WebSocket/__mocks__/event-target-shim.js | 18 - .../WebSocket/__tests__/WebSocket-test.js | 25 - docgen/Libraries/fishhook/LICENSE | 22 - docgen/Libraries/fishhook/README.md | 75 - docgen/Libraries/fishhook/fishhook.c | 210 - docgen/Libraries/fishhook/fishhook.h | 76 - docgen/Libraries/polyfills/Array.es6.js | 88 - .../polyfills/Array.prototype.es6.js | 97 - docgen/Libraries/polyfills/Number.es6.js | 43 - docgen/Libraries/polyfills/Object.es6.js | 70 - docgen/Libraries/polyfills/Object.es7.js | 61 - .../polyfills/String.prototype.es6.js | 130 - .../polyfills/__tests__/Object.es7-test.js | 125 - docgen/Libraries/polyfills/babelHelpers.js | 249 - docgen/Libraries/polyfills/console.js | 550 -- docgen/Libraries/polyfills/error-guard.js | 92 - docgen/Libraries/promiseRejectionIsError.js | 25 - docgen/Libraries/react-native/React.js | 14 - .../react-native-implementation.js | 131 - .../react-native/react-native-interface.js | 28 - docgen/Libraries/vendor/core/ErrorUtils.js | 27 - docgen/Libraries/vendor/core/Map.js | 623 --- docgen/Libraries/vendor/core/Set.js | 199 - .../core/_shouldPolyfillES6Collection.js | 65 - .../Libraries/vendor/core/getObjectValues.js | 31 - docgen/Libraries/vendor/core/guid.js | 25 - docgen/Libraries/vendor/core/isEmpty.js | 29 - docgen/Libraries/vendor/core/merge.js | 50 - docgen/Libraries/vendor/core/mergeHelpers.js | 140 - docgen/Libraries/vendor/core/mergeInto.js | 59 - docgen/Libraries/vendor/core/toIterator.js | 171 - .../selection/DocumentSelectionState.js | 151 - .../vendor/emitter/EmitterSubscription.js | 61 - .../Libraries/vendor/emitter/EventEmitter.js | 220 - .../vendor/emitter/EventEmitterWithHolding.js | 165 - .../Libraries/vendor/emitter/EventHolder.js | 121 - .../vendor/emitter/EventSubscription.js | 42 - .../vendor/emitter/EventSubscriptionVendor.js | 100 - .../vendor/emitter/EventValidator.js | 137 - .../vendor/emitter/mixInEventEmitter.js | 135 - docgen/server/convert.js | 10 +- docgen/server/docsList.js | 172 +- docgen/server/extractDocs.js | 7 +- docgen/server/generate.js | 208 +- docgen/server/server.js | 4 +- docs/NativeMethodsMixin.md | 4 + docs/accessibility.md | 175 + docs/android-building-from-source.md | 158 + docs/android-ui-performance.md | 4 + docs/animations.md | 507 ++ docs/app-extensions.md | 26 + docs/building-for-apple-tv.md | 90 + docs/colors.md | 182 + docs/communication-android.md | 119 + docs/communication-ios.md | 214 + docs/components-and-apis.md | 230 + docs/contributing.md | 216 + docs/custom-webview-android.md | 261 + docs/custom-webview-ios.md | 234 + docs/debugging.md | 233 + docs/direct-manipulation.md | 264 + docs/flexbox.md | 105 + docs/gesture-responder-system.md | 67 + docs/getting-started.md | 766 +++ docs/handling-text-input.md | 46 + docs/handling-touches.md | 178 + docs/headless-js-android.md | 144 + docs/height-and-width.md | 63 + docs/images.md | 207 + docs/improvingux.md | 63 + docs/integration-with-existing-apps.md | 948 ++++ docs/javascript-environment.md | 80 + docs/linking-libraries-ios.md | 89 + docs/maintainers.md | 318 ++ docs/more-resources.md | 52 + docs/native-components-android.md | 191 + docs/native-components-ios.md | 440 ++ docs/native-modules-android.md | 451 ++ docs/native-modules-ios.md | 467 ++ docs/navigation.md | 141 + docs/network.md | 179 + docs/performance.md | 611 +++ docs/platform-specific-code.md | 105 + docs/props.md | 70 + docs/running-on-device-android.md | 4 + docs/running-on-device-ios.md | 4 + docs/running-on-device.md | 484 ++ docs/running-on-simulator-ios.md | 14 + docs/signed-apk-android.md | 124 + docs/state.md | 59 + docs/style.md | 49 + docs/testing.md | 134 + docs/timers.md | 75 + docs/troubleshooting.md | 105 + docs/tutorial.md | 48 + docs/undefined.md | 4 + docs/understanding-cli.md | 32 + docs/upgrading.md | 131 + docs/using-a-listview.md | 105 + docs/using-a-scrollview.md | 64 + website/gen-sidebars.json | 1 + 697 files changed, 10345 insertions(+), 98503 deletions(-) delete mode 100644 docgen/Libraries/.eslintrc delete mode 100644 docgen/Libraries/ART/ART.xcodeproj/project.pbxproj delete mode 100644 docgen/Libraries/ART/ARTCGFloatArray.h delete mode 100644 docgen/Libraries/ART/ARTContainer.h delete mode 100644 docgen/Libraries/ART/ARTGroup.h delete mode 100644 docgen/Libraries/ART/ARTGroup.m delete mode 100644 docgen/Libraries/ART/ARTNode.h delete mode 100644 docgen/Libraries/ART/ARTNode.m delete mode 100644 docgen/Libraries/ART/ARTRenderable.h delete mode 100644 docgen/Libraries/ART/ARTRenderable.m delete mode 100644 docgen/Libraries/ART/ARTSerializablePath.js delete mode 100644 docgen/Libraries/ART/ARTShape.h delete mode 100644 docgen/Libraries/ART/ARTShape.m delete mode 100644 docgen/Libraries/ART/ARTSurfaceView.h delete mode 100644 docgen/Libraries/ART/ARTSurfaceView.m delete mode 100644 docgen/Libraries/ART/ARTText.h delete mode 100644 docgen/Libraries/ART/ARTText.m delete mode 100644 docgen/Libraries/ART/ARTTextFrame.h delete mode 100644 docgen/Libraries/ART/Brushes/ARTBrush.h delete mode 100644 docgen/Libraries/ART/Brushes/ARTBrush.m delete mode 100644 docgen/Libraries/ART/Brushes/ARTLinearGradient.h delete mode 100644 docgen/Libraries/ART/Brushes/ARTLinearGradient.m delete mode 100644 docgen/Libraries/ART/Brushes/ARTPattern.h delete mode 100644 docgen/Libraries/ART/Brushes/ARTPattern.m delete mode 100644 docgen/Libraries/ART/Brushes/ARTRadialGradient.h delete mode 100644 docgen/Libraries/ART/Brushes/ARTRadialGradient.m delete mode 100644 docgen/Libraries/ART/Brushes/ARTSolidColor.h delete mode 100644 docgen/Libraries/ART/Brushes/ARTSolidColor.m delete mode 100644 docgen/Libraries/ART/RCTConvert+ART.h delete mode 100644 docgen/Libraries/ART/RCTConvert+ART.m delete mode 100644 docgen/Libraries/ART/ReactNativeART.js delete mode 100644 docgen/Libraries/ART/ViewManagers/ARTGroupManager.h delete mode 100644 docgen/Libraries/ART/ViewManagers/ARTGroupManager.m delete mode 100644 docgen/Libraries/ART/ViewManagers/ARTNodeManager.h delete mode 100644 docgen/Libraries/ART/ViewManagers/ARTNodeManager.m delete mode 100644 docgen/Libraries/ART/ViewManagers/ARTRenderableManager.h delete mode 100644 docgen/Libraries/ART/ViewManagers/ARTRenderableManager.m delete mode 100644 docgen/Libraries/ART/ViewManagers/ARTShapeManager.h delete mode 100644 docgen/Libraries/ART/ViewManagers/ARTShapeManager.m delete mode 100644 docgen/Libraries/ART/ViewManagers/ARTSurfaceViewManager.h delete mode 100644 docgen/Libraries/ART/ViewManagers/ARTSurfaceViewManager.m delete mode 100644 docgen/Libraries/ART/ViewManagers/ARTTextManager.h delete mode 100644 docgen/Libraries/ART/ViewManagers/ARTTextManager.m delete mode 100644 docgen/Libraries/ActionSheetIOS/ActionSheetIOS.js delete mode 100644 docgen/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj/project.pbxproj delete mode 100644 docgen/Libraries/ActionSheetIOS/RCTActionSheetManager.h delete mode 100644 docgen/Libraries/ActionSheetIOS/RCTActionSheetManager.m delete mode 100644 docgen/Libraries/Alert/Alert.js delete mode 100644 docgen/Libraries/Alert/AlertIOS.js delete mode 100644 docgen/Libraries/Alert/RCTAlertManager.android.js delete mode 100644 docgen/Libraries/Alert/RCTAlertManager.ios.js delete mode 100644 docgen/Libraries/Animated/examples/demo.html delete mode 100644 docgen/Libraries/Animated/examples/pic1.jpg delete mode 100644 docgen/Libraries/Animated/examples/pic2.jpg delete mode 100644 docgen/Libraries/Animated/examples/pic3.jpg delete mode 100644 docgen/Libraries/Animated/examples/style.css delete mode 100644 docgen/Libraries/Animated/release/gulpfile.js delete mode 100644 docgen/Libraries/Animated/release/package.json delete mode 100644 docgen/Libraries/Animated/src/Animated.js delete mode 100644 docgen/Libraries/Animated/src/AnimatedEvent.js delete mode 100644 docgen/Libraries/Animated/src/AnimatedImplementation.js delete mode 100644 docgen/Libraries/Animated/src/AnimatedWeb.js delete mode 100644 docgen/Libraries/Animated/src/Easing.js delete mode 100644 docgen/Libraries/Animated/src/NativeAnimatedHelper.js delete mode 100644 docgen/Libraries/Animated/src/SpringConfig.js delete mode 100644 docgen/Libraries/Animated/src/__tests__/Animated-test.js delete mode 100644 docgen/Libraries/Animated/src/__tests__/AnimatedNative-test.js delete mode 100644 docgen/Libraries/Animated/src/__tests__/Easing-test.js delete mode 100644 docgen/Libraries/Animated/src/__tests__/Interpolation-test.js delete mode 100644 docgen/Libraries/Animated/src/__tests__/bezier-test.js delete mode 100644 docgen/Libraries/Animated/src/animations/Animation.js delete mode 100644 docgen/Libraries/Animated/src/animations/DecayAnimation.js delete mode 100644 docgen/Libraries/Animated/src/animations/SpringAnimation.js delete mode 100644 docgen/Libraries/Animated/src/animations/TimingAnimation.js delete mode 100644 docgen/Libraries/Animated/src/bezier.js delete mode 100644 docgen/Libraries/Animated/src/createAnimatedComponent.js delete mode 100644 docgen/Libraries/Animated/src/nodes/AnimatedAddition.js delete mode 100644 docgen/Libraries/Animated/src/nodes/AnimatedDiffClamp.js delete mode 100644 docgen/Libraries/Animated/src/nodes/AnimatedDivision.js delete mode 100644 docgen/Libraries/Animated/src/nodes/AnimatedInterpolation.js delete mode 100644 docgen/Libraries/Animated/src/nodes/AnimatedModulo.js delete mode 100644 docgen/Libraries/Animated/src/nodes/AnimatedMultiplication.js delete mode 100644 docgen/Libraries/Animated/src/nodes/AnimatedNode.js delete mode 100644 docgen/Libraries/Animated/src/nodes/AnimatedProps.js delete mode 100644 docgen/Libraries/Animated/src/nodes/AnimatedStyle.js delete mode 100644 docgen/Libraries/Animated/src/nodes/AnimatedTracking.js delete mode 100644 docgen/Libraries/Animated/src/nodes/AnimatedTransform.js delete mode 100644 docgen/Libraries/Animated/src/nodes/AnimatedValue.js delete mode 100644 docgen/Libraries/Animated/src/nodes/AnimatedValueXY.js delete mode 100644 docgen/Libraries/Animated/src/nodes/AnimatedWithChildren.js delete mode 100644 docgen/Libraries/Animated/src/polyfills/InteractionManager.js delete mode 100644 docgen/Libraries/Animated/src/polyfills/Set.js delete mode 100644 docgen/Libraries/Animated/src/polyfills/flattenStyle.js delete mode 100644 docgen/Libraries/AppState/AppState.js delete mode 100644 docgen/Libraries/BatchedBridge/BatchedBridge.js delete mode 100644 docgen/Libraries/BatchedBridge/MessageQueue.js delete mode 100644 docgen/Libraries/BatchedBridge/NativeModules.js delete mode 100644 docgen/Libraries/BatchedBridge/__mocks__/MessageQueueTestConfig.js delete mode 100644 docgen/Libraries/BatchedBridge/__mocks__/MessageQueueTestModule.js delete mode 100644 docgen/Libraries/BatchedBridge/__tests__/MessageQueue-test.js delete mode 100644 docgen/Libraries/BatchedBridge/__tests__/NativeModules-test.js delete mode 100644 docgen/Libraries/Blob/Blob.js delete mode 100644 docgen/Libraries/Blob/BlobTypes.js delete mode 100755 docgen/Libraries/Blob/RCTBlob.xcodeproj/project.pbxproj delete mode 100755 docgen/Libraries/Blob/RCTBlobManager.h delete mode 100755 docgen/Libraries/Blob/RCTBlobManager.m delete mode 100644 docgen/Libraries/Blob/URL.js delete mode 100644 docgen/Libraries/BugReporting/BugReporting.js delete mode 100644 docgen/Libraries/BugReporting/dumpReactTree.js delete mode 100644 docgen/Libraries/BugReporting/getReactData.js delete mode 100644 docgen/Libraries/CameraRoll/CameraRoll.js delete mode 100644 docgen/Libraries/CameraRoll/ImagePickerIOS.js delete mode 100644 docgen/Libraries/CameraRoll/RCTAssetsLibraryRequestHandler.h delete mode 100644 docgen/Libraries/CameraRoll/RCTAssetsLibraryRequestHandler.m delete mode 100644 docgen/Libraries/CameraRoll/RCTCameraRoll.xcodeproj/project.pbxproj delete mode 100644 docgen/Libraries/CameraRoll/RCTCameraRollManager.h delete mode 100644 docgen/Libraries/CameraRoll/RCTCameraRollManager.m delete mode 100644 docgen/Libraries/CameraRoll/RCTImagePickerManager.h delete mode 100644 docgen/Libraries/CameraRoll/RCTImagePickerManager.m delete mode 100644 docgen/Libraries/CameraRoll/RCTPhotoLibraryImageLoader.h delete mode 100644 docgen/Libraries/CameraRoll/RCTPhotoLibraryImageLoader.m delete mode 100644 docgen/Libraries/Components/AccessibilityInfo/AccessibilityInfo.android.js delete mode 100644 docgen/Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js delete mode 100644 docgen/Libraries/Components/ActivityIndicator/ActivityIndicator.js delete mode 100644 docgen/Libraries/Components/AppleTV/TVEventHandler.android.js delete mode 100644 docgen/Libraries/Components/AppleTV/TVEventHandler.ios.js delete mode 100644 docgen/Libraries/Components/AppleTV/TVViewPropTypes.js delete mode 100644 docgen/Libraries/Components/Button.js delete mode 100644 docgen/Libraries/Components/CheckBox/CheckBox.js delete mode 100644 docgen/Libraries/Components/Clipboard/Clipboard.js delete mode 100644 docgen/Libraries/Components/DatePicker/DatePickerIOS.android.js delete mode 100644 docgen/Libraries/Components/DatePicker/DatePickerIOS.ios.js delete mode 100644 docgen/Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js delete mode 100644 docgen/Libraries/Components/DatePickerAndroid/DatePickerAndroid.ios.js delete mode 100644 docgen/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js delete mode 100644 docgen/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.ios.js delete mode 100644 docgen/Libraries/Components/Keyboard/Keyboard.js delete mode 100644 docgen/Libraries/Components/Keyboard/KeyboardAvoidingView.js delete mode 100644 docgen/Libraries/Components/LazyRenderer.js delete mode 100644 docgen/Libraries/Components/MaskedView/MaskedViewIOS.android.js delete mode 100644 docgen/Libraries/Components/MaskedView/MaskedViewIOS.ios.js delete mode 100644 docgen/Libraries/Components/Navigation/NavigatorIOS.android.js delete mode 100644 docgen/Libraries/Components/Navigation/NavigatorIOS.ios.js delete mode 100644 docgen/Libraries/Components/Picker/Picker.js delete mode 100644 docgen/Libraries/Components/Picker/PickerAndroid.android.js delete mode 100644 docgen/Libraries/Components/Picker/PickerAndroid.ios.js delete mode 100644 docgen/Libraries/Components/Picker/PickerIOS.android.js delete mode 100644 docgen/Libraries/Components/Picker/PickerIOS.ios.js delete mode 100644 docgen/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js delete mode 100644 docgen/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.ios.js delete mode 100644 docgen/Libraries/Components/ProgressViewIOS/ProgressViewIOS.android.js delete mode 100644 docgen/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js delete mode 100644 docgen/Libraries/Components/RefreshControl/RefreshControl.js delete mode 100644 docgen/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js delete mode 100644 docgen/Libraries/Components/ScrollResponder.js delete mode 100644 docgen/Libraries/Components/ScrollView/ScrollView.js delete mode 100644 docgen/Libraries/Components/ScrollView/ScrollViewStickyHeader.js delete mode 100644 docgen/Libraries/Components/ScrollView/__mocks__/ScrollViewMock.js delete mode 100644 docgen/Libraries/Components/ScrollView/processDecelerationRate.js delete mode 100644 docgen/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.android.js delete mode 100644 docgen/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js delete mode 100644 docgen/Libraries/Components/Slider/Slider.js delete mode 100644 docgen/Libraries/Components/StaticContainer.react.js delete mode 100644 docgen/Libraries/Components/StaticRenderer.js delete mode 100644 docgen/Libraries/Components/StatusBar/StatusBar.js delete mode 100644 docgen/Libraries/Components/StatusBar/StatusBarIOS.android.js delete mode 100644 docgen/Libraries/Components/StatusBar/StatusBarIOS.ios.js delete mode 100644 docgen/Libraries/Components/Subscribable.js delete mode 100644 docgen/Libraries/Components/Switch/Switch.js delete mode 100644 docgen/Libraries/Components/TabBarIOS/TabBarIOS.android.js delete mode 100644 docgen/Libraries/Components/TabBarIOS/TabBarIOS.ios.js delete mode 100644 docgen/Libraries/Components/TabBarIOS/TabBarItemIOS.android.js delete mode 100644 docgen/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js delete mode 100644 docgen/Libraries/Components/TextInput/TextInput.js delete mode 100644 docgen/Libraries/Components/TextInput/TextInputState.js delete mode 100644 docgen/Libraries/Components/TimePickerAndroid/TimePickerAndroid.android.js delete mode 100644 docgen/Libraries/Components/TimePickerAndroid/TimePickerAndroid.ios.js delete mode 100644 docgen/Libraries/Components/ToastAndroid/ToastAndroid.android.js delete mode 100644 docgen/Libraries/Components/ToastAndroid/ToastAndroid.ios.js delete mode 100644 docgen/Libraries/Components/ToolbarAndroid/ToolbarAndroid.android.js delete mode 100644 docgen/Libraries/Components/ToolbarAndroid/ToolbarAndroid.ios.js delete mode 100644 docgen/Libraries/Components/Touchable/BoundingDimensions.js delete mode 100644 docgen/Libraries/Components/Touchable/Position.js delete mode 100644 docgen/Libraries/Components/Touchable/Touchable.js delete mode 100644 docgen/Libraries/Components/Touchable/TouchableBounce.js delete mode 100644 docgen/Libraries/Components/Touchable/TouchableHighlight.js delete mode 100644 docgen/Libraries/Components/Touchable/TouchableNativeFeedback.android.js delete mode 100644 docgen/Libraries/Components/Touchable/TouchableNativeFeedback.ios.js delete mode 100644 docgen/Libraries/Components/Touchable/TouchableOpacity.js delete mode 100755 docgen/Libraries/Components/Touchable/TouchableWithoutFeedback.js delete mode 100644 docgen/Libraries/Components/Touchable/__mocks__/ensureComponentIsNative.js delete mode 100644 docgen/Libraries/Components/Touchable/__tests__/TouchableHighlight-test.js delete mode 100644 docgen/Libraries/Components/Touchable/__tests__/__snapshots__/TouchableHighlight-test.js.snap delete mode 100644 docgen/Libraries/Components/Touchable/ensureComponentIsNative.js delete mode 100644 docgen/Libraries/Components/Touchable/ensurePositiveDelayProps.js delete mode 100644 docgen/Libraries/Components/UnimplementedViews/UnimplementedView.js delete mode 100644 docgen/Libraries/Components/View/PlatformViewPropTypes.android.js delete mode 100644 docgen/Libraries/Components/View/PlatformViewPropTypes.ios.js delete mode 100644 docgen/Libraries/Components/View/ReactNativeStyleAttributes.js delete mode 100644 docgen/Libraries/Components/View/ReactNativeViewAttributes.js delete mode 100644 docgen/Libraries/Components/View/ShadowPropTypesIOS.js delete mode 100644 docgen/Libraries/Components/View/View.js delete mode 100644 docgen/Libraries/Components/View/ViewAccessibility.js delete mode 100644 docgen/Libraries/Components/View/ViewPropTypes.js delete mode 100644 docgen/Libraries/Components/View/ViewStylePropTypes.js delete mode 100644 docgen/Libraries/Components/ViewPager/ViewPagerAndroid.android.js delete mode 100644 docgen/Libraries/Components/ViewPager/ViewPagerAndroid.ios.js delete mode 100644 docgen/Libraries/Components/WebView/WebView.android.js delete mode 100644 docgen/Libraries/Components/WebView/WebView.ios.js delete mode 100644 docgen/Libraries/Core/Devtools/__tests__/parseErrorStack-test.js delete mode 100644 docgen/Libraries/Core/Devtools/getDevServer.js delete mode 100644 docgen/Libraries/Core/Devtools/openFileInEditor.js delete mode 100644 docgen/Libraries/Core/Devtools/parseErrorStack.js delete mode 100644 docgen/Libraries/Core/Devtools/setupDevtools.js delete mode 100644 docgen/Libraries/Core/Devtools/symbolicateStackTrace.js delete mode 100644 docgen/Libraries/Core/ExceptionsManager.js delete mode 100644 docgen/Libraries/Core/InitializeCore.js delete mode 100644 docgen/Libraries/Core/ReactNativeVersion.js delete mode 100644 docgen/Libraries/Core/Timers/JSTimers.js delete mode 100644 docgen/Libraries/Core/__mocks__/ErrorUtils.js delete mode 100644 docgen/Libraries/EventEmitter/MissingNativeEventEmitterShim.js delete mode 100644 docgen/Libraries/EventEmitter/NativeEventEmitter.js delete mode 100644 docgen/Libraries/EventEmitter/RCTDeviceEventEmitter.js delete mode 100644 docgen/Libraries/EventEmitter/RCTEventEmitter.js delete mode 100644 docgen/Libraries/EventEmitter/RCTNativeAppEventEmitter.js delete mode 100644 docgen/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js delete mode 100644 docgen/Libraries/Experimental/Incremental.js delete mode 100644 docgen/Libraries/Experimental/IncrementalExample.js delete mode 100644 docgen/Libraries/Experimental/IncrementalGroup.js delete mode 100644 docgen/Libraries/Experimental/IncrementalPresenter.js delete mode 100644 docgen/Libraries/Experimental/SwipeableRow/SwipeableListView.js delete mode 100644 docgen/Libraries/Experimental/SwipeableRow/SwipeableListViewDataSource.js delete mode 100644 docgen/Libraries/Experimental/SwipeableRow/SwipeableQuickActionButton.js delete mode 100644 docgen/Libraries/Experimental/SwipeableRow/SwipeableQuickActions.js delete mode 100644 docgen/Libraries/Experimental/SwipeableRow/SwipeableRow.js delete mode 100644 docgen/Libraries/Experimental/WindowedListView.js delete mode 100644 docgen/Libraries/Geolocation/Geolocation.js delete mode 100644 docgen/Libraries/Geolocation/RCTGeolocation.xcodeproj/project.pbxproj delete mode 100644 docgen/Libraries/Geolocation/RCTLocationObserver.h delete mode 100644 docgen/Libraries/Geolocation/RCTLocationObserver.m delete mode 100644 docgen/Libraries/Image/AssetRegistry.js delete mode 100644 docgen/Libraries/Image/AssetSourceResolver.js delete mode 100644 docgen/Libraries/Image/Image.android.js delete mode 100644 docgen/Libraries/Image/Image.ios.js delete mode 100644 docgen/Libraries/Image/ImageBackground.js delete mode 100644 docgen/Libraries/Image/ImageEditor.js delete mode 100644 docgen/Libraries/Image/ImageResizeMode.js delete mode 100644 docgen/Libraries/Image/ImageSource.js delete mode 100644 docgen/Libraries/Image/ImageSourcePropType.js delete mode 100644 docgen/Libraries/Image/ImageStore.js delete mode 100644 docgen/Libraries/Image/ImageStylePropTypes.js delete mode 100644 docgen/Libraries/Image/RCTGIFImageDecoder.h delete mode 100644 docgen/Libraries/Image/RCTGIFImageDecoder.m delete mode 100644 docgen/Libraries/Image/RCTImage.xcodeproj/project.pbxproj delete mode 100644 docgen/Libraries/Image/RCTImageBlurUtils.h delete mode 100644 docgen/Libraries/Image/RCTImageBlurUtils.m delete mode 100644 docgen/Libraries/Image/RCTImageCache.h delete mode 100644 docgen/Libraries/Image/RCTImageCache.m delete mode 100644 docgen/Libraries/Image/RCTImageEditingManager.h delete mode 100644 docgen/Libraries/Image/RCTImageEditingManager.m delete mode 100644 docgen/Libraries/Image/RCTImageLoader.h delete mode 100644 docgen/Libraries/Image/RCTImageLoader.m delete mode 100644 docgen/Libraries/Image/RCTImageShadowView.h delete mode 100644 docgen/Libraries/Image/RCTImageShadowView.m delete mode 100644 docgen/Libraries/Image/RCTImageStoreManager.h delete mode 100644 docgen/Libraries/Image/RCTImageStoreManager.m delete mode 100644 docgen/Libraries/Image/RCTImageUtils.h delete mode 100644 docgen/Libraries/Image/RCTImageUtils.m delete mode 100644 docgen/Libraries/Image/RCTImageView.h delete mode 100644 docgen/Libraries/Image/RCTImageView.m delete mode 100644 docgen/Libraries/Image/RCTImageViewManager.h delete mode 100644 docgen/Libraries/Image/RCTImageViewManager.m delete mode 100644 docgen/Libraries/Image/RCTLocalAssetImageLoader.h delete mode 100644 docgen/Libraries/Image/RCTLocalAssetImageLoader.m delete mode 100644 docgen/Libraries/Image/RCTResizeMode.h delete mode 100644 docgen/Libraries/Image/RCTResizeMode.m delete mode 100644 docgen/Libraries/Image/RelativeImageStub.js delete mode 100644 docgen/Libraries/Image/__tests__/resolveAssetSource-test.js delete mode 100644 docgen/Libraries/Image/nativeImageSource.js delete mode 100644 docgen/Libraries/Image/resolveAssetSource.js delete mode 100644 docgen/Libraries/Inspector/BorderBox.js delete mode 100644 docgen/Libraries/Inspector/BoxInspector.js delete mode 100644 docgen/Libraries/Inspector/ElementBox.js delete mode 100644 docgen/Libraries/Inspector/ElementProperties.js delete mode 100644 docgen/Libraries/Inspector/Inspector.js delete mode 100644 docgen/Libraries/Inspector/InspectorOverlay.js delete mode 100644 docgen/Libraries/Inspector/InspectorPanel.js delete mode 100644 docgen/Libraries/Inspector/NetworkOverlay.js delete mode 100644 docgen/Libraries/Inspector/PerformanceOverlay.js delete mode 100644 docgen/Libraries/Inspector/StyleInspector.js delete mode 100644 docgen/Libraries/Inspector/resolveBoxStyle.js delete mode 100644 docgen/Libraries/Interaction/Batchinator.js delete mode 100644 docgen/Libraries/Interaction/BridgeSpyStallHandler.js delete mode 100644 docgen/Libraries/Interaction/FrameRateLogger.js delete mode 100644 docgen/Libraries/Interaction/InteractionManager.js delete mode 100644 docgen/Libraries/Interaction/InteractionMixin.js delete mode 100644 docgen/Libraries/Interaction/InteractionStallDebugger.js delete mode 100644 docgen/Libraries/Interaction/JSEventLoopWatchdog.js delete mode 100644 docgen/Libraries/Interaction/PanResponder.js delete mode 100644 docgen/Libraries/Interaction/ReactPerfStallHandler.js delete mode 100644 docgen/Libraries/Interaction/TaskQueue.js delete mode 100644 docgen/Libraries/Interaction/__tests__/Batchinator-test.js delete mode 100644 docgen/Libraries/Interaction/__tests__/InteractionManager-test.js delete mode 100644 docgen/Libraries/Interaction/__tests__/InteractionMixin-test.js delete mode 100644 docgen/Libraries/Interaction/__tests__/TaskQueue-test.js delete mode 100644 docgen/Libraries/JSInspector/InspectorAgent.js delete mode 100644 docgen/Libraries/JSInspector/JSInspector.js delete mode 100644 docgen/Libraries/JSInspector/NetworkAgent.js delete mode 100644 docgen/Libraries/LayoutAnimation/LayoutAnimation.js delete mode 100644 docgen/Libraries/Linking/Linking.js delete mode 100644 docgen/Libraries/LinkingIOS/RCTLinking.xcodeproj/project.pbxproj delete mode 100644 docgen/Libraries/LinkingIOS/RCTLinkingManager.h delete mode 100644 docgen/Libraries/LinkingIOS/RCTLinkingManager.m delete mode 100644 docgen/Libraries/Lists/FillRateHelper.js delete mode 100644 docgen/Libraries/Lists/FlatList.js delete mode 100644 docgen/Libraries/Lists/ListView/ListView.js delete mode 100644 docgen/Libraries/Lists/ListView/ListViewDataSource.js delete mode 100644 docgen/Libraries/Lists/ListView/__mocks__/ListViewMock.js delete mode 100644 docgen/Libraries/Lists/MetroListView.js delete mode 100644 docgen/Libraries/Lists/SectionList.js delete mode 100644 docgen/Libraries/Lists/ViewabilityHelper.js delete mode 100644 docgen/Libraries/Lists/VirtualizeUtils.js delete mode 100644 docgen/Libraries/Lists/VirtualizedList.js delete mode 100644 docgen/Libraries/Lists/VirtualizedSectionList.js delete mode 100644 docgen/Libraries/Lists/__flowtests__/FlatList-flowtest.js delete mode 100644 docgen/Libraries/Lists/__flowtests__/SectionList-flowtest.js delete mode 100644 docgen/Libraries/Lists/__tests__/FillRateHelper-test.js delete mode 100644 docgen/Libraries/Lists/__tests__/FlatList-test.js delete mode 100644 docgen/Libraries/Lists/__tests__/SectionList-test.js delete mode 100644 docgen/Libraries/Lists/__tests__/ViewabilityHelper-test.js delete mode 100644 docgen/Libraries/Lists/__tests__/VirtualizeUtils-test.js delete mode 100644 docgen/Libraries/Lists/__tests__/VirtualizedList-test.js delete mode 100644 docgen/Libraries/Lists/__tests__/__snapshots__/FlatList-test.js.snap delete mode 100644 docgen/Libraries/Lists/__tests__/__snapshots__/SectionList-test.js.snap delete mode 100644 docgen/Libraries/Lists/__tests__/__snapshots__/VirtualizedList-test.js.snap delete mode 100644 docgen/Libraries/Modal/Modal.js delete mode 100644 docgen/Libraries/NativeAnimation/Drivers/RCTAnimationDriver.h delete mode 100644 docgen/Libraries/NativeAnimation/Drivers/RCTDecayAnimation.h delete mode 100644 docgen/Libraries/NativeAnimation/Drivers/RCTDecayAnimation.m delete mode 100644 docgen/Libraries/NativeAnimation/Drivers/RCTEventAnimation.h delete mode 100644 docgen/Libraries/NativeAnimation/Drivers/RCTEventAnimation.m delete mode 100644 docgen/Libraries/NativeAnimation/Drivers/RCTFrameAnimation.h delete mode 100644 docgen/Libraries/NativeAnimation/Drivers/RCTFrameAnimation.m delete mode 100644 docgen/Libraries/NativeAnimation/Drivers/RCTSpringAnimation.h delete mode 100644 docgen/Libraries/NativeAnimation/Drivers/RCTSpringAnimation.m delete mode 100644 docgen/Libraries/NativeAnimation/Nodes/RCTAdditionAnimatedNode.h delete mode 100644 docgen/Libraries/NativeAnimation/Nodes/RCTAdditionAnimatedNode.m delete mode 100644 docgen/Libraries/NativeAnimation/Nodes/RCTAnimatedNode.h delete mode 100644 docgen/Libraries/NativeAnimation/Nodes/RCTAnimatedNode.m delete mode 100644 docgen/Libraries/NativeAnimation/Nodes/RCTDiffClampAnimatedNode.h delete mode 100644 docgen/Libraries/NativeAnimation/Nodes/RCTDiffClampAnimatedNode.m delete mode 100644 docgen/Libraries/NativeAnimation/Nodes/RCTDivisionAnimatedNode.h delete mode 100644 docgen/Libraries/NativeAnimation/Nodes/RCTDivisionAnimatedNode.m delete mode 100644 docgen/Libraries/NativeAnimation/Nodes/RCTInterpolationAnimatedNode.h delete mode 100644 docgen/Libraries/NativeAnimation/Nodes/RCTInterpolationAnimatedNode.m delete mode 100644 docgen/Libraries/NativeAnimation/Nodes/RCTModuloAnimatedNode.h delete mode 100644 docgen/Libraries/NativeAnimation/Nodes/RCTModuloAnimatedNode.m delete mode 100644 docgen/Libraries/NativeAnimation/Nodes/RCTMultiplicationAnimatedNode.h delete mode 100644 docgen/Libraries/NativeAnimation/Nodes/RCTMultiplicationAnimatedNode.m delete mode 100644 docgen/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.h delete mode 100644 docgen/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.m delete mode 100644 docgen/Libraries/NativeAnimation/Nodes/RCTStyleAnimatedNode.h delete mode 100644 docgen/Libraries/NativeAnimation/Nodes/RCTStyleAnimatedNode.m delete mode 100644 docgen/Libraries/NativeAnimation/Nodes/RCTTransformAnimatedNode.h delete mode 100644 docgen/Libraries/NativeAnimation/Nodes/RCTTransformAnimatedNode.m delete mode 100644 docgen/Libraries/NativeAnimation/Nodes/RCTValueAnimatedNode.h delete mode 100644 docgen/Libraries/NativeAnimation/Nodes/RCTValueAnimatedNode.m delete mode 100644 docgen/Libraries/NativeAnimation/RCTAnimation.xcodeproj/project.pbxproj delete mode 100644 docgen/Libraries/NativeAnimation/RCTAnimationUtils.h delete mode 100644 docgen/Libraries/NativeAnimation/RCTAnimationUtils.m delete mode 100644 docgen/Libraries/NativeAnimation/RCTNativeAnimatedModule.h delete mode 100644 docgen/Libraries/NativeAnimation/RCTNativeAnimatedModule.m delete mode 100644 docgen/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h delete mode 100644 docgen/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.m delete mode 100644 docgen/Libraries/Network/FormData.js delete mode 100644 docgen/Libraries/Network/NetInfo.js delete mode 100644 docgen/Libraries/Network/RCTDataRequestHandler.h delete mode 100644 docgen/Libraries/Network/RCTDataRequestHandler.m delete mode 100644 docgen/Libraries/Network/RCTFileRequestHandler.h delete mode 100644 docgen/Libraries/Network/RCTFileRequestHandler.m delete mode 100644 docgen/Libraries/Network/RCTHTTPRequestHandler.h delete mode 100644 docgen/Libraries/Network/RCTHTTPRequestHandler.mm delete mode 100644 docgen/Libraries/Network/RCTNetInfo.h delete mode 100644 docgen/Libraries/Network/RCTNetInfo.m delete mode 100644 docgen/Libraries/Network/RCTNetwork.xcodeproj/project.pbxproj delete mode 100644 docgen/Libraries/Network/RCTNetworkTask.h delete mode 100644 docgen/Libraries/Network/RCTNetworkTask.m delete mode 100644 docgen/Libraries/Network/RCTNetworking.android.js delete mode 100644 docgen/Libraries/Network/RCTNetworking.h delete mode 100644 docgen/Libraries/Network/RCTNetworking.ios.js delete mode 100644 docgen/Libraries/Network/RCTNetworking.mm delete mode 100644 docgen/Libraries/Network/XHRInterceptor.js delete mode 100644 docgen/Libraries/Network/XMLHttpRequest.js delete mode 100644 docgen/Libraries/Network/__tests__/FormData-test.js delete mode 100644 docgen/Libraries/Network/__tests__/XMLHttpRequest-test.js delete mode 100644 docgen/Libraries/Network/convertRequestBody.js delete mode 100644 docgen/Libraries/Network/fetch.js delete mode 100644 docgen/Libraries/Performance/QuickPerformanceLogger.js delete mode 100644 docgen/Libraries/Performance/SamplingProfiler.js delete mode 100644 docgen/Libraries/Performance/Systrace.js delete mode 100644 docgen/Libraries/PermissionsAndroid/PermissionsAndroid.js delete mode 100644 docgen/Libraries/Promise.js delete mode 100644 docgen/Libraries/PushNotificationIOS/PushNotificationIOS.js delete mode 100644 docgen/Libraries/PushNotificationIOS/RCTPushNotification.xcodeproj/project.pbxproj delete mode 100644 docgen/Libraries/PushNotificationIOS/RCTPushNotificationManager.h delete mode 100644 docgen/Libraries/PushNotificationIOS/RCTPushNotificationManager.m delete mode 100644 docgen/Libraries/RCTTest/FBSnapshotTestCase/FBSnapshotTestCase.h delete mode 100644 docgen/Libraries/RCTTest/FBSnapshotTestCase/FBSnapshotTestCase.m delete mode 100644 docgen/Libraries/RCTTest/FBSnapshotTestCase/FBSnapshotTestController.h delete mode 100644 docgen/Libraries/RCTTest/FBSnapshotTestCase/FBSnapshotTestController.m delete mode 100644 docgen/Libraries/RCTTest/FBSnapshotTestCase/UIImage+Compare.h delete mode 100644 docgen/Libraries/RCTTest/FBSnapshotTestCase/UIImage+Compare.m delete mode 100644 docgen/Libraries/RCTTest/FBSnapshotTestCase/UIImage+Diff.h delete mode 100644 docgen/Libraries/RCTTest/FBSnapshotTestCase/UIImage+Diff.m delete mode 100644 docgen/Libraries/RCTTest/RCTSnapshotManager.h delete mode 100644 docgen/Libraries/RCTTest/RCTSnapshotManager.m delete mode 100644 docgen/Libraries/RCTTest/RCTTest.xcodeproj/project.pbxproj delete mode 100644 docgen/Libraries/RCTTest/RCTTestModule.h delete mode 100644 docgen/Libraries/RCTTest/RCTTestModule.m delete mode 100644 docgen/Libraries/RCTTest/RCTTestRunner.h delete mode 100644 docgen/Libraries/RCTTest/RCTTestRunner.m delete mode 100644 docgen/Libraries/RCTTest/SnapshotViewIOS.android.js delete mode 100644 docgen/Libraries/RCTTest/SnapshotViewIOS.ios.js delete mode 100644 docgen/Libraries/ReactNative/AppContainer.js delete mode 100644 docgen/Libraries/ReactNative/AppRegistry.js delete mode 100644 docgen/Libraries/ReactNative/I18nManager.js delete mode 100644 docgen/Libraries/ReactNative/ReactNativeFeatureFlags.js delete mode 100644 docgen/Libraries/ReactNative/UIManager.js delete mode 100644 docgen/Libraries/ReactNative/UIManagerStatTracker.js delete mode 100644 docgen/Libraries/ReactNative/YellowBox.js delete mode 100644 docgen/Libraries/ReactNative/queryLayoutByID.js delete mode 100644 docgen/Libraries/ReactNative/renderApplication.js delete mode 100644 docgen/Libraries/ReactNative/requireNativeComponent.js delete mode 100644 docgen/Libraries/ReactNative/verifyPropTypes.js delete mode 100644 docgen/Libraries/Renderer/REVISION delete mode 100644 docgen/Libraries/Renderer/ReactNativeFiber-dev.js delete mode 100644 docgen/Libraries/Renderer/ReactNativeFiber-prod.js delete mode 100644 docgen/Libraries/Renderer/ReactNativeStack-dev.js delete mode 100644 docgen/Libraries/Renderer/ReactNativeStack-prod.js delete mode 100644 docgen/Libraries/Renderer/shims/NativeMethodsMixin.js delete mode 100644 docgen/Libraries/Renderer/shims/PooledClass.js delete mode 100644 docgen/Libraries/Renderer/shims/ReactDebugTool.js delete mode 100644 docgen/Libraries/Renderer/shims/ReactGlobalSharedState.js delete mode 100644 docgen/Libraries/Renderer/shims/ReactNative.js delete mode 100644 docgen/Libraries/Renderer/shims/ReactNativeComponentTree.js delete mode 100644 docgen/Libraries/Renderer/shims/ReactNativePropRegistry.js delete mode 100644 docgen/Libraries/Renderer/shims/ReactNativeTypes.js delete mode 100644 docgen/Libraries/Renderer/shims/ReactPerf.js delete mode 100644 docgen/Libraries/Renderer/shims/ReactTypes.js delete mode 100644 docgen/Libraries/Renderer/shims/TouchHistoryMath.js delete mode 100644 docgen/Libraries/Renderer/shims/createReactNativeComponentClass.js delete mode 100644 docgen/Libraries/Renderer/shims/takeSnapshot.js delete mode 100644 docgen/Libraries/Sample/Sample.android.js delete mode 100644 docgen/Libraries/Sample/Sample.h delete mode 100644 docgen/Libraries/Sample/Sample.ios.js delete mode 100644 docgen/Libraries/Sample/Sample.m delete mode 100644 docgen/Libraries/Sample/Sample.xcodeproj/project.pbxproj delete mode 100644 docgen/Libraries/Sample/package.json delete mode 100644 docgen/Libraries/Settings/RCTSettings.xcodeproj/project.pbxproj delete mode 100644 docgen/Libraries/Settings/RCTSettingsManager.h delete mode 100644 docgen/Libraries/Settings/RCTSettingsManager.m delete mode 100644 docgen/Libraries/Settings/Settings.android.js delete mode 100644 docgen/Libraries/Settings/Settings.ios.js delete mode 100644 docgen/Libraries/Share/Share.js delete mode 100644 docgen/Libraries/Storage/AsyncStorage.js delete mode 100644 docgen/Libraries/StyleSheet/ColorPropType.js delete mode 100644 docgen/Libraries/StyleSheet/EdgeInsetsPropType.js delete mode 100644 docgen/Libraries/StyleSheet/LayoutPropTypes.js delete mode 100644 docgen/Libraries/StyleSheet/PointPropType.js delete mode 100644 docgen/Libraries/StyleSheet/StyleSheet.js delete mode 100644 docgen/Libraries/StyleSheet/StyleSheetPropType.js delete mode 100644 docgen/Libraries/StyleSheet/StyleSheetTypes.js delete mode 100644 docgen/Libraries/StyleSheet/StyleSheetValidation.js delete mode 100644 docgen/Libraries/StyleSheet/TransformPropTypes.js delete mode 100644 docgen/Libraries/StyleSheet/__tests__/__snapshots__/processTransform-test.js.snap delete mode 100644 docgen/Libraries/StyleSheet/__tests__/flattenStyle-test.js delete mode 100644 docgen/Libraries/StyleSheet/__tests__/normalizeColor-test.js delete mode 100644 docgen/Libraries/StyleSheet/__tests__/processColor-test.js delete mode 100644 docgen/Libraries/StyleSheet/__tests__/processTransform-test.js delete mode 100644 docgen/Libraries/StyleSheet/__tests__/setNormalizedColorAlpha-test.js delete mode 100644 docgen/Libraries/StyleSheet/flattenStyle.js delete mode 100755 docgen/Libraries/StyleSheet/normalizeColor.js delete mode 100644 docgen/Libraries/StyleSheet/processColor.js delete mode 100644 docgen/Libraries/StyleSheet/processTransform.js delete mode 100644 docgen/Libraries/StyleSheet/setNormalizedColorAlpha.js delete mode 100644 docgen/Libraries/Text/RCTBackedTextInputDelegate.h delete mode 100644 docgen/Libraries/Text/RCTBackedTextInputDelegateAdapter.h delete mode 100644 docgen/Libraries/Text/RCTBackedTextInputDelegateAdapter.m delete mode 100644 docgen/Libraries/Text/RCTBackedTextInputViewProtocol.h delete mode 100644 docgen/Libraries/Text/RCTConvert+Text.h delete mode 100644 docgen/Libraries/Text/RCTConvert+Text.m delete mode 100644 docgen/Libraries/Text/RCTRawTextManager.h delete mode 100644 docgen/Libraries/Text/RCTRawTextManager.m delete mode 100644 docgen/Libraries/Text/RCTShadowRawText.h delete mode 100644 docgen/Libraries/Text/RCTShadowRawText.m delete mode 100644 docgen/Libraries/Text/RCTShadowText.h delete mode 100644 docgen/Libraries/Text/RCTShadowText.m delete mode 100644 docgen/Libraries/Text/RCTShadowTextField.h delete mode 100644 docgen/Libraries/Text/RCTShadowTextField.m delete mode 100644 docgen/Libraries/Text/RCTShadowTextView.h delete mode 100644 docgen/Libraries/Text/RCTShadowTextView.m delete mode 100644 docgen/Libraries/Text/RCTText.h delete mode 100644 docgen/Libraries/Text/RCTText.m delete mode 100644 docgen/Libraries/Text/RCTText.xcodeproj/project.pbxproj delete mode 100644 docgen/Libraries/Text/RCTTextField.h delete mode 100644 docgen/Libraries/Text/RCTTextField.m delete mode 100644 docgen/Libraries/Text/RCTTextFieldManager.h delete mode 100644 docgen/Libraries/Text/RCTTextFieldManager.m delete mode 100644 docgen/Libraries/Text/RCTTextInput.h delete mode 100644 docgen/Libraries/Text/RCTTextInput.m delete mode 100644 docgen/Libraries/Text/RCTTextManager.h delete mode 100644 docgen/Libraries/Text/RCTTextManager.m delete mode 100644 docgen/Libraries/Text/RCTTextSelection.h delete mode 100644 docgen/Libraries/Text/RCTTextSelection.m delete mode 100644 docgen/Libraries/Text/RCTTextView.h delete mode 100644 docgen/Libraries/Text/RCTTextView.m delete mode 100644 docgen/Libraries/Text/RCTTextViewManager.h delete mode 100644 docgen/Libraries/Text/RCTTextViewManager.m delete mode 100644 docgen/Libraries/Text/RCTUITextField.h delete mode 100644 docgen/Libraries/Text/RCTUITextField.m delete mode 100644 docgen/Libraries/Text/RCTUITextView.h delete mode 100644 docgen/Libraries/Text/RCTUITextView.m delete mode 100644 docgen/Libraries/Text/Text.js delete mode 100644 docgen/Libraries/Text/TextStylePropTypes.js delete mode 100644 docgen/Libraries/Text/TextUpdateTest.js delete mode 100644 docgen/Libraries/Utilities/BackAndroid.js delete mode 100644 docgen/Libraries/Utilities/BackHandler.android.js delete mode 100644 docgen/Libraries/Utilities/BackHandler.ios.js delete mode 100644 docgen/Libraries/Utilities/DebugEnvironment.js delete mode 100644 docgen/Libraries/Utilities/DeviceInfo.js delete mode 100644 docgen/Libraries/Utilities/Dimensions.js delete mode 100644 docgen/Libraries/Utilities/HMRClient.js delete mode 100644 docgen/Libraries/Utilities/HMRLoadingView.android.js delete mode 100644 docgen/Libraries/Utilities/HMRLoadingView.ios.js delete mode 100644 docgen/Libraries/Utilities/HeapCapture.js delete mode 100755 docgen/Libraries/Utilities/MatrixMath.js delete mode 100644 docgen/Libraries/Utilities/PerformanceLogger.js delete mode 100644 docgen/Libraries/Utilities/PixelRatio.js delete mode 100644 docgen/Libraries/Utilities/Platform.android.js delete mode 100644 docgen/Libraries/Utilities/Platform.ios.js delete mode 100644 docgen/Libraries/Utilities/RCTLog.js delete mode 100644 docgen/Libraries/Utilities/SceneTracker.js delete mode 100644 docgen/Libraries/Utilities/__mocks__/BackHandler.js delete mode 100644 docgen/Libraries/Utilities/__mocks__/PixelRatio.js delete mode 100644 docgen/Libraries/Utilities/__tests__/MatrixMath-test.js delete mode 100644 docgen/Libraries/Utilities/__tests__/Platform-test.js delete mode 100644 docgen/Libraries/Utilities/__tests__/SceneTracker-test.js delete mode 100644 docgen/Libraries/Utilities/__tests__/buildStyleInterpolator-test.js delete mode 100644 docgen/Libraries/Utilities/__tests__/deepFreezeAndThrowOnMutationInDev-test.js delete mode 100644 docgen/Libraries/Utilities/__tests__/groupByEveryN-test.js delete mode 100644 docgen/Libraries/Utilities/__tests__/mapWithSeparator-test.js delete mode 100644 docgen/Libraries/Utilities/__tests__/truncate-test.js delete mode 100644 docgen/Libraries/Utilities/__tests__/utf8-test.js delete mode 100644 docgen/Libraries/Utilities/binaryToBase64.js delete mode 100644 docgen/Libraries/Utilities/buildStyleInterpolator.js delete mode 100644 docgen/Libraries/Utilities/clamp.js delete mode 100644 docgen/Libraries/Utilities/createStrictShapeTypeChecker.js delete mode 100644 docgen/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js delete mode 100644 docgen/Libraries/Utilities/defineLazyObjectProperty.js delete mode 100644 docgen/Libraries/Utilities/deprecatedPropType.js delete mode 100644 docgen/Libraries/Utilities/differ/__tests__/deepDiffer-test.js delete mode 100644 docgen/Libraries/Utilities/differ/deepDiffer.js delete mode 100644 docgen/Libraries/Utilities/differ/insetsDiffer.js delete mode 100644 docgen/Libraries/Utilities/differ/matricesDiffer.js delete mode 100644 docgen/Libraries/Utilities/differ/pointsDiffer.js delete mode 100644 docgen/Libraries/Utilities/differ/sizesDiffer.js delete mode 100644 docgen/Libraries/Utilities/dismissKeyboard.js delete mode 100644 docgen/Libraries/Utilities/groupByEveryN.js delete mode 100644 docgen/Libraries/Utilities/infoLog.js delete mode 100644 docgen/Libraries/Utilities/logError.js delete mode 100644 docgen/Libraries/Utilities/mapWithSeparator.js delete mode 100644 docgen/Libraries/Utilities/mergeFast.js delete mode 100644 docgen/Libraries/Utilities/mergeIntoFast.js delete mode 100644 docgen/Libraries/Utilities/stringifySafe.js delete mode 100644 docgen/Libraries/Utilities/truncate.js delete mode 100644 docgen/Libraries/Utilities/utf8.js delete mode 100644 docgen/Libraries/Vibration/RCTVibration.h delete mode 100644 docgen/Libraries/Vibration/RCTVibration.m delete mode 100644 docgen/Libraries/Vibration/RCTVibration.xcodeproj/project.pbxproj delete mode 100644 docgen/Libraries/Vibration/Vibration.js delete mode 100644 docgen/Libraries/Vibration/VibrationIOS.android.js delete mode 100644 docgen/Libraries/Vibration/VibrationIOS.ios.js delete mode 100644 docgen/Libraries/WebSocket/RCTReconnectingWebSocket.h delete mode 100644 docgen/Libraries/WebSocket/RCTReconnectingWebSocket.m delete mode 100644 docgen/Libraries/WebSocket/RCTSRWebSocket.h delete mode 100644 docgen/Libraries/WebSocket/RCTSRWebSocket.m delete mode 100644 docgen/Libraries/WebSocket/RCTWebSocket.xcodeproj/project.pbxproj delete mode 100644 docgen/Libraries/WebSocket/RCTWebSocketExecutor.h delete mode 100644 docgen/Libraries/WebSocket/RCTWebSocketExecutor.m delete mode 100644 docgen/Libraries/WebSocket/RCTWebSocketModule.h delete mode 100644 docgen/Libraries/WebSocket/RCTWebSocketModule.m delete mode 100644 docgen/Libraries/WebSocket/RCTWebSocketObserver.h delete mode 100644 docgen/Libraries/WebSocket/RCTWebSocketObserver.m delete mode 100644 docgen/Libraries/WebSocket/WebSocket.js delete mode 100644 docgen/Libraries/WebSocket/WebSocketEvent.js delete mode 100644 docgen/Libraries/WebSocket/WebSocketInterceptor.js delete mode 100644 docgen/Libraries/WebSocket/__mocks__/event-target-shim.js delete mode 100644 docgen/Libraries/WebSocket/__tests__/WebSocket-test.js delete mode 100755 docgen/Libraries/fishhook/LICENSE delete mode 100755 docgen/Libraries/fishhook/README.md delete mode 100755 docgen/Libraries/fishhook/fishhook.c delete mode 100755 docgen/Libraries/fishhook/fishhook.h delete mode 100644 docgen/Libraries/polyfills/Array.es6.js delete mode 100644 docgen/Libraries/polyfills/Array.prototype.es6.js delete mode 100644 docgen/Libraries/polyfills/Number.es6.js delete mode 100644 docgen/Libraries/polyfills/Object.es6.js delete mode 100644 docgen/Libraries/polyfills/Object.es7.js delete mode 100644 docgen/Libraries/polyfills/String.prototype.es6.js delete mode 100644 docgen/Libraries/polyfills/__tests__/Object.es7-test.js delete mode 100644 docgen/Libraries/polyfills/babelHelpers.js delete mode 100644 docgen/Libraries/polyfills/console.js delete mode 100644 docgen/Libraries/polyfills/error-guard.js delete mode 100644 docgen/Libraries/promiseRejectionIsError.js delete mode 100644 docgen/Libraries/react-native/React.js delete mode 100644 docgen/Libraries/react-native/react-native-implementation.js delete mode 100644 docgen/Libraries/react-native/react-native-interface.js delete mode 100644 docgen/Libraries/vendor/core/ErrorUtils.js delete mode 100644 docgen/Libraries/vendor/core/Map.js delete mode 100644 docgen/Libraries/vendor/core/Set.js delete mode 100644 docgen/Libraries/vendor/core/_shouldPolyfillES6Collection.js delete mode 100644 docgen/Libraries/vendor/core/getObjectValues.js delete mode 100644 docgen/Libraries/vendor/core/guid.js delete mode 100644 docgen/Libraries/vendor/core/isEmpty.js delete mode 100644 docgen/Libraries/vendor/core/merge.js delete mode 100644 docgen/Libraries/vendor/core/mergeHelpers.js delete mode 100644 docgen/Libraries/vendor/core/mergeInto.js delete mode 100644 docgen/Libraries/vendor/core/toIterator.js delete mode 100644 docgen/Libraries/vendor/document/selection/DocumentSelectionState.js delete mode 100644 docgen/Libraries/vendor/emitter/EmitterSubscription.js delete mode 100644 docgen/Libraries/vendor/emitter/EventEmitter.js delete mode 100644 docgen/Libraries/vendor/emitter/EventEmitterWithHolding.js delete mode 100644 docgen/Libraries/vendor/emitter/EventHolder.js delete mode 100644 docgen/Libraries/vendor/emitter/EventSubscription.js delete mode 100644 docgen/Libraries/vendor/emitter/EventSubscriptionVendor.js delete mode 100644 docgen/Libraries/vendor/emitter/EventValidator.js delete mode 100644 docgen/Libraries/vendor/emitter/mixInEventEmitter.js create mode 100644 docs/NativeMethodsMixin.md create mode 100644 docs/accessibility.md create mode 100644 docs/android-building-from-source.md create mode 100644 docs/android-ui-performance.md create mode 100644 docs/animations.md create mode 100644 docs/app-extensions.md create mode 100644 docs/building-for-apple-tv.md create mode 100644 docs/colors.md create mode 100644 docs/communication-android.md create mode 100644 docs/communication-ios.md create mode 100644 docs/components-and-apis.md create mode 100644 docs/contributing.md create mode 100644 docs/custom-webview-android.md create mode 100644 docs/custom-webview-ios.md create mode 100644 docs/debugging.md create mode 100644 docs/direct-manipulation.md create mode 100644 docs/flexbox.md create mode 100644 docs/gesture-responder-system.md create mode 100644 docs/getting-started.md create mode 100644 docs/handling-text-input.md create mode 100644 docs/handling-touches.md create mode 100644 docs/headless-js-android.md create mode 100644 docs/height-and-width.md create mode 100644 docs/images.md create mode 100644 docs/improvingux.md create mode 100644 docs/integration-with-existing-apps.md create mode 100644 docs/javascript-environment.md create mode 100644 docs/linking-libraries-ios.md create mode 100644 docs/maintainers.md create mode 100644 docs/more-resources.md create mode 100644 docs/native-components-android.md create mode 100644 docs/native-components-ios.md create mode 100644 docs/native-modules-android.md create mode 100644 docs/native-modules-ios.md create mode 100644 docs/navigation.md create mode 100644 docs/network.md create mode 100644 docs/performance.md create mode 100644 docs/platform-specific-code.md create mode 100644 docs/props.md create mode 100644 docs/running-on-device-android.md create mode 100644 docs/running-on-device-ios.md create mode 100644 docs/running-on-device.md create mode 100644 docs/running-on-simulator-ios.md create mode 100644 docs/signed-apk-android.md create mode 100644 docs/state.md create mode 100644 docs/style.md create mode 100644 docs/testing.md create mode 100644 docs/timers.md create mode 100644 docs/troubleshooting.md create mode 100644 docs/tutorial.md create mode 100644 docs/undefined.md create mode 100644 docs/understanding-cli.md create mode 100644 docs/upgrading.md create mode 100644 docs/using-a-listview.md create mode 100644 docs/using-a-scrollview.md create mode 100644 website/gen-sidebars.json diff --git a/docgen/Libraries/.eslintrc b/docgen/Libraries/.eslintrc deleted file mode 100644 index ddcf4e27251..00000000000 --- a/docgen/Libraries/.eslintrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "rules": { - // This folder currently runs through babel and doesn't need to be - // compatible with node 4 - "comma-dangle": 0 - } -} diff --git a/docgen/Libraries/ART/ART.xcodeproj/project.pbxproj b/docgen/Libraries/ART/ART.xcodeproj/project.pbxproj deleted file mode 100644 index 75eec541171..00000000000 --- a/docgen/Libraries/ART/ART.xcodeproj/project.pbxproj +++ /dev/null @@ -1,491 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 0CF68B051AF0549300FF9E5C /* ARTGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68ADE1AF0549300FF9E5C /* ARTGroup.m */; }; - 0CF68B061AF0549300FF9E5C /* ARTNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AE01AF0549300FF9E5C /* ARTNode.m */; }; - 0CF68B071AF0549300FF9E5C /* ARTRenderable.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AE21AF0549300FF9E5C /* ARTRenderable.m */; }; - 0CF68B081AF0549300FF9E5C /* ARTShape.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AE41AF0549300FF9E5C /* ARTShape.m */; }; - 0CF68B091AF0549300FF9E5C /* ARTSurfaceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AE61AF0549300FF9E5C /* ARTSurfaceView.m */; }; - 0CF68B0A1AF0549300FF9E5C /* ARTText.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AE81AF0549300FF9E5C /* ARTText.m */; }; - 0CF68B0B1AF0549300FF9E5C /* ARTBrush.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AEC1AF0549300FF9E5C /* ARTBrush.m */; }; - 0CF68B0C1AF0549300FF9E5C /* ARTLinearGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AEE1AF0549300FF9E5C /* ARTLinearGradient.m */; }; - 0CF68B0D1AF0549300FF9E5C /* ARTPattern.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AF01AF0549300FF9E5C /* ARTPattern.m */; }; - 0CF68B0E1AF0549300FF9E5C /* ARTRadialGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AF21AF0549300FF9E5C /* ARTRadialGradient.m */; }; - 0CF68B0F1AF0549300FF9E5C /* ARTSolidColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AF41AF0549300FF9E5C /* ARTSolidColor.m */; }; - 0CF68B101AF0549300FF9E5C /* RCTConvert+ART.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AF71AF0549300FF9E5C /* RCTConvert+ART.m */; }; - 0CF68B111AF0549300FF9E5C /* ARTGroupManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AFA1AF0549300FF9E5C /* ARTGroupManager.m */; }; - 0CF68B121AF0549300FF9E5C /* ARTNodeManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AFC1AF0549300FF9E5C /* ARTNodeManager.m */; }; - 0CF68B131AF0549300FF9E5C /* ARTRenderableManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AFE1AF0549300FF9E5C /* ARTRenderableManager.m */; }; - 0CF68B141AF0549300FF9E5C /* ARTShapeManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68B001AF0549300FF9E5C /* ARTShapeManager.m */; }; - 0CF68B151AF0549300FF9E5C /* ARTSurfaceViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68B021AF0549300FF9E5C /* ARTSurfaceViewManager.m */; }; - 0CF68B161AF0549300FF9E5C /* ARTTextManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68B041AF0549300FF9E5C /* ARTTextManager.m */; }; - 325CF7AD1E5F2ABA00AC9606 /* ARTBrush.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AEC1AF0549300FF9E5C /* ARTBrush.m */; }; - 325CF7AE1E5F2ABA00AC9606 /* ARTLinearGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AEE1AF0549300FF9E5C /* ARTLinearGradient.m */; }; - 325CF7AF1E5F2ABA00AC9606 /* ARTPattern.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AF01AF0549300FF9E5C /* ARTPattern.m */; }; - 325CF7B01E5F2ABA00AC9606 /* ARTRadialGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AF21AF0549300FF9E5C /* ARTRadialGradient.m */; }; - 325CF7B11E5F2ABA00AC9606 /* ARTSolidColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AF41AF0549300FF9E5C /* ARTSolidColor.m */; }; - 325CF7B21E5F2ABA00AC9606 /* ARTGroupManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AFA1AF0549300FF9E5C /* ARTGroupManager.m */; }; - 325CF7B31E5F2ABA00AC9606 /* ARTNodeManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AFC1AF0549300FF9E5C /* ARTNodeManager.m */; }; - 325CF7B41E5F2ABA00AC9606 /* ARTRenderableManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AFE1AF0549300FF9E5C /* ARTRenderableManager.m */; }; - 325CF7B51E5F2ABA00AC9606 /* ARTShapeManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68B001AF0549300FF9E5C /* ARTShapeManager.m */; }; - 325CF7B61E5F2ABA00AC9606 /* ARTSurfaceViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68B021AF0549300FF9E5C /* ARTSurfaceViewManager.m */; }; - 325CF7B71E5F2ABA00AC9606 /* ARTTextManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68B041AF0549300FF9E5C /* ARTTextManager.m */; }; - 325CF7B81E5F2ABA00AC9606 /* ARTGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68ADE1AF0549300FF9E5C /* ARTGroup.m */; }; - 325CF7B91E5F2ABA00AC9606 /* ARTNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AE01AF0549300FF9E5C /* ARTNode.m */; }; - 325CF7BA1E5F2ABA00AC9606 /* ARTRenderable.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AE21AF0549300FF9E5C /* ARTRenderable.m */; }; - 325CF7BB1E5F2ABA00AC9606 /* ARTShape.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AE41AF0549300FF9E5C /* ARTShape.m */; }; - 325CF7BC1E5F2ABA00AC9606 /* ARTSurfaceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AE61AF0549300FF9E5C /* ARTSurfaceView.m */; }; - 325CF7BD1E5F2ABA00AC9606 /* ARTText.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AE81AF0549300FF9E5C /* ARTText.m */; }; - 325CF7BE1E5F2ABA00AC9606 /* RCTConvert+ART.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68AF71AF0549300FF9E5C /* RCTConvert+ART.m */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 0CF68ABF1AF0540F00FF9E5C /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = "include/$(PRODUCT_NAME)"; - dstSubfolderSpec = 16; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 323A12851E5F266B004975B8 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = "include/$(PRODUCT_NAME)"; - dstSubfolderSpec = 16; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 0CF68AC11AF0540F00FF9E5C /* libART.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libART.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 0CF68ADB1AF0549300FF9E5C /* ARTCGFloatArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTCGFloatArray.h; sourceTree = ""; }; - 0CF68ADC1AF0549300FF9E5C /* ARTContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTContainer.h; sourceTree = ""; }; - 0CF68ADD1AF0549300FF9E5C /* ARTGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTGroup.h; sourceTree = ""; }; - 0CF68ADE1AF0549300FF9E5C /* ARTGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTGroup.m; sourceTree = ""; }; - 0CF68ADF1AF0549300FF9E5C /* ARTNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTNode.h; sourceTree = ""; }; - 0CF68AE01AF0549300FF9E5C /* ARTNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTNode.m; sourceTree = ""; }; - 0CF68AE11AF0549300FF9E5C /* ARTRenderable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTRenderable.h; sourceTree = ""; }; - 0CF68AE21AF0549300FF9E5C /* ARTRenderable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTRenderable.m; sourceTree = ""; }; - 0CF68AE31AF0549300FF9E5C /* ARTShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTShape.h; sourceTree = ""; }; - 0CF68AE41AF0549300FF9E5C /* ARTShape.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTShape.m; sourceTree = ""; }; - 0CF68AE51AF0549300FF9E5C /* ARTSurfaceView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTSurfaceView.h; sourceTree = ""; }; - 0CF68AE61AF0549300FF9E5C /* ARTSurfaceView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTSurfaceView.m; sourceTree = ""; }; - 0CF68AE71AF0549300FF9E5C /* ARTText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTText.h; sourceTree = ""; }; - 0CF68AE81AF0549300FF9E5C /* ARTText.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTText.m; sourceTree = ""; }; - 0CF68AE91AF0549300FF9E5C /* ARTTextFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTTextFrame.h; sourceTree = ""; }; - 0CF68AEB1AF0549300FF9E5C /* ARTBrush.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTBrush.h; sourceTree = ""; }; - 0CF68AEC1AF0549300FF9E5C /* ARTBrush.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTBrush.m; sourceTree = ""; }; - 0CF68AED1AF0549300FF9E5C /* ARTLinearGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTLinearGradient.h; sourceTree = ""; }; - 0CF68AEE1AF0549300FF9E5C /* ARTLinearGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTLinearGradient.m; sourceTree = ""; }; - 0CF68AEF1AF0549300FF9E5C /* ARTPattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTPattern.h; sourceTree = ""; }; - 0CF68AF01AF0549300FF9E5C /* ARTPattern.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTPattern.m; sourceTree = ""; }; - 0CF68AF11AF0549300FF9E5C /* ARTRadialGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTRadialGradient.h; sourceTree = ""; }; - 0CF68AF21AF0549300FF9E5C /* ARTRadialGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTRadialGradient.m; sourceTree = ""; }; - 0CF68AF31AF0549300FF9E5C /* ARTSolidColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTSolidColor.h; sourceTree = ""; }; - 0CF68AF41AF0549300FF9E5C /* ARTSolidColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTSolidColor.m; sourceTree = ""; }; - 0CF68AF61AF0549300FF9E5C /* RCTConvert+ART.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RCTConvert+ART.h"; sourceTree = ""; }; - 0CF68AF71AF0549300FF9E5C /* RCTConvert+ART.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "RCTConvert+ART.m"; sourceTree = ""; }; - 0CF68AF91AF0549300FF9E5C /* ARTGroupManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTGroupManager.h; sourceTree = ""; }; - 0CF68AFA1AF0549300FF9E5C /* ARTGroupManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTGroupManager.m; sourceTree = ""; }; - 0CF68AFB1AF0549300FF9E5C /* ARTNodeManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTNodeManager.h; sourceTree = ""; }; - 0CF68AFC1AF0549300FF9E5C /* ARTNodeManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTNodeManager.m; sourceTree = ""; }; - 0CF68AFD1AF0549300FF9E5C /* ARTRenderableManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTRenderableManager.h; sourceTree = ""; }; - 0CF68AFE1AF0549300FF9E5C /* ARTRenderableManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTRenderableManager.m; sourceTree = ""; }; - 0CF68AFF1AF0549300FF9E5C /* ARTShapeManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTShapeManager.h; sourceTree = ""; }; - 0CF68B001AF0549300FF9E5C /* ARTShapeManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTShapeManager.m; sourceTree = ""; }; - 0CF68B011AF0549300FF9E5C /* ARTSurfaceViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTSurfaceViewManager.h; sourceTree = ""; }; - 0CF68B021AF0549300FF9E5C /* ARTSurfaceViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTSurfaceViewManager.m; sourceTree = ""; }; - 0CF68B031AF0549300FF9E5C /* ARTTextManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTTextManager.h; sourceTree = ""; }; - 0CF68B041AF0549300FF9E5C /* ARTTextManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTTextManager.m; sourceTree = ""; }; - 323A12871E5F266B004975B8 /* libART-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libART-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 0CF68ABE1AF0540F00FF9E5C /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 323A12841E5F266B004975B8 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 0CF68AB81AF0540F00FF9E5C = { - isa = PBXGroup; - children = ( - 0CF68AEA1AF0549300FF9E5C /* Brushes */, - 0CF68AF81AF0549300FF9E5C /* ViewManagers */, - 0CF68ADB1AF0549300FF9E5C /* ARTCGFloatArray.h */, - 0CF68ADC1AF0549300FF9E5C /* ARTContainer.h */, - 0CF68ADD1AF0549300FF9E5C /* ARTGroup.h */, - 0CF68ADE1AF0549300FF9E5C /* ARTGroup.m */, - 0CF68ADF1AF0549300FF9E5C /* ARTNode.h */, - 0CF68AE01AF0549300FF9E5C /* ARTNode.m */, - 0CF68AE11AF0549300FF9E5C /* ARTRenderable.h */, - 0CF68AE21AF0549300FF9E5C /* ARTRenderable.m */, - 0CF68AE31AF0549300FF9E5C /* ARTShape.h */, - 0CF68AE41AF0549300FF9E5C /* ARTShape.m */, - 0CF68AE51AF0549300FF9E5C /* ARTSurfaceView.h */, - 0CF68AE61AF0549300FF9E5C /* ARTSurfaceView.m */, - 0CF68AE71AF0549300FF9E5C /* ARTText.h */, - 0CF68AE81AF0549300FF9E5C /* ARTText.m */, - 0CF68AE91AF0549300FF9E5C /* ARTTextFrame.h */, - 0CF68AF61AF0549300FF9E5C /* RCTConvert+ART.h */, - 0CF68AF71AF0549300FF9E5C /* RCTConvert+ART.m */, - 0CF68AC21AF0540F00FF9E5C /* Products */, - ); - indentWidth = 2; - sourceTree = ""; - tabWidth = 2; - usesTabs = 0; - }; - 0CF68AC21AF0540F00FF9E5C /* Products */ = { - isa = PBXGroup; - children = ( - 0CF68AC11AF0540F00FF9E5C /* libART.a */, - 323A12871E5F266B004975B8 /* libART-tvOS.a */, - ); - name = Products; - sourceTree = ""; - }; - 0CF68AEA1AF0549300FF9E5C /* Brushes */ = { - isa = PBXGroup; - children = ( - 0CF68AEB1AF0549300FF9E5C /* ARTBrush.h */, - 0CF68AEC1AF0549300FF9E5C /* ARTBrush.m */, - 0CF68AED1AF0549300FF9E5C /* ARTLinearGradient.h */, - 0CF68AEE1AF0549300FF9E5C /* ARTLinearGradient.m */, - 0CF68AEF1AF0549300FF9E5C /* ARTPattern.h */, - 0CF68AF01AF0549300FF9E5C /* ARTPattern.m */, - 0CF68AF11AF0549300FF9E5C /* ARTRadialGradient.h */, - 0CF68AF21AF0549300FF9E5C /* ARTRadialGradient.m */, - 0CF68AF31AF0549300FF9E5C /* ARTSolidColor.h */, - 0CF68AF41AF0549300FF9E5C /* ARTSolidColor.m */, - ); - path = Brushes; - sourceTree = ""; - }; - 0CF68AF81AF0549300FF9E5C /* ViewManagers */ = { - isa = PBXGroup; - children = ( - 0CF68AF91AF0549300FF9E5C /* ARTGroupManager.h */, - 0CF68AFA1AF0549300FF9E5C /* ARTGroupManager.m */, - 0CF68AFB1AF0549300FF9E5C /* ARTNodeManager.h */, - 0CF68AFC1AF0549300FF9E5C /* ARTNodeManager.m */, - 0CF68AFD1AF0549300FF9E5C /* ARTRenderableManager.h */, - 0CF68AFE1AF0549300FF9E5C /* ARTRenderableManager.m */, - 0CF68AFF1AF0549300FF9E5C /* ARTShapeManager.h */, - 0CF68B001AF0549300FF9E5C /* ARTShapeManager.m */, - 0CF68B011AF0549300FF9E5C /* ARTSurfaceViewManager.h */, - 0CF68B021AF0549300FF9E5C /* ARTSurfaceViewManager.m */, - 0CF68B031AF0549300FF9E5C /* ARTTextManager.h */, - 0CF68B041AF0549300FF9E5C /* ARTTextManager.m */, - ); - path = ViewManagers; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 0CF68AC01AF0540F00FF9E5C /* ART */ = { - isa = PBXNativeTarget; - buildConfigurationList = 0CF68AD51AF0540F00FF9E5C /* Build configuration list for PBXNativeTarget "ART" */; - buildPhases = ( - 0CF68ABD1AF0540F00FF9E5C /* Sources */, - 0CF68ABE1AF0540F00FF9E5C /* Frameworks */, - 0CF68ABF1AF0540F00FF9E5C /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = ART; - productName = ART; - productReference = 0CF68AC11AF0540F00FF9E5C /* libART.a */; - productType = "com.apple.product-type.library.static"; - }; - 323A12861E5F266B004975B8 /* ART-tvOS */ = { - isa = PBXNativeTarget; - buildConfigurationList = 323A128D1E5F266B004975B8 /* Build configuration list for PBXNativeTarget "ART-tvOS" */; - buildPhases = ( - 323A12831E5F266B004975B8 /* Sources */, - 323A12841E5F266B004975B8 /* Frameworks */, - 323A12851E5F266B004975B8 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "ART-tvOS"; - productName = "ART-tvOS"; - productReference = 323A12871E5F266B004975B8 /* libART-tvOS.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 0CF68AB91AF0540F00FF9E5C /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0620; - TargetAttributes = { - 0CF68AC01AF0540F00FF9E5C = { - CreatedOnToolsVersion = 6.2; - }; - 323A12861E5F266B004975B8 = { - CreatedOnToolsVersion = 6.2; - ProvisioningStyle = Automatic; - }; - }; - }; - buildConfigurationList = 0CF68ABC1AF0540F00FF9E5C /* Build configuration list for PBXProject "ART" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 0CF68AB81AF0540F00FF9E5C; - productRefGroup = 0CF68AC21AF0540F00FF9E5C /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 0CF68AC01AF0540F00FF9E5C /* ART */, - 323A12861E5F266B004975B8 /* ART-tvOS */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 0CF68ABD1AF0540F00FF9E5C /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 0CF68B161AF0549300FF9E5C /* ARTTextManager.m in Sources */, - 0CF68B111AF0549300FF9E5C /* ARTGroupManager.m in Sources */, - 0CF68B0D1AF0549300FF9E5C /* ARTPattern.m in Sources */, - 0CF68B0A1AF0549300FF9E5C /* ARTText.m in Sources */, - 0CF68B121AF0549300FF9E5C /* ARTNodeManager.m in Sources */, - 0CF68B051AF0549300FF9E5C /* ARTGroup.m in Sources */, - 0CF68B131AF0549300FF9E5C /* ARTRenderableManager.m in Sources */, - 0CF68B091AF0549300FF9E5C /* ARTSurfaceView.m in Sources */, - 0CF68B0E1AF0549300FF9E5C /* ARTRadialGradient.m in Sources */, - 0CF68B151AF0549300FF9E5C /* ARTSurfaceViewManager.m in Sources */, - 0CF68B081AF0549300FF9E5C /* ARTShape.m in Sources */, - 0CF68B071AF0549300FF9E5C /* ARTRenderable.m in Sources */, - 0CF68B101AF0549300FF9E5C /* RCTConvert+ART.m in Sources */, - 0CF68B061AF0549300FF9E5C /* ARTNode.m in Sources */, - 0CF68B0F1AF0549300FF9E5C /* ARTSolidColor.m in Sources */, - 0CF68B0C1AF0549300FF9E5C /* ARTLinearGradient.m in Sources */, - 0CF68B0B1AF0549300FF9E5C /* ARTBrush.m in Sources */, - 0CF68B141AF0549300FF9E5C /* ARTShapeManager.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 323A12831E5F266B004975B8 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 325CF7B71E5F2ABA00AC9606 /* ARTTextManager.m in Sources */, - 325CF7B21E5F2ABA00AC9606 /* ARTGroupManager.m in Sources */, - 325CF7AF1E5F2ABA00AC9606 /* ARTPattern.m in Sources */, - 325CF7BD1E5F2ABA00AC9606 /* ARTText.m in Sources */, - 325CF7B31E5F2ABA00AC9606 /* ARTNodeManager.m in Sources */, - 325CF7B81E5F2ABA00AC9606 /* ARTGroup.m in Sources */, - 325CF7B41E5F2ABA00AC9606 /* ARTRenderableManager.m in Sources */, - 325CF7BC1E5F2ABA00AC9606 /* ARTSurfaceView.m in Sources */, - 325CF7B01E5F2ABA00AC9606 /* ARTRadialGradient.m in Sources */, - 325CF7B61E5F2ABA00AC9606 /* ARTSurfaceViewManager.m in Sources */, - 325CF7BB1E5F2ABA00AC9606 /* ARTShape.m in Sources */, - 325CF7BA1E5F2ABA00AC9606 /* ARTRenderable.m in Sources */, - 325CF7BE1E5F2ABA00AC9606 /* RCTConvert+ART.m in Sources */, - 325CF7B91E5F2ABA00AC9606 /* ARTNode.m in Sources */, - 325CF7B11E5F2ABA00AC9606 /* ARTSolidColor.m in Sources */, - 325CF7AE1E5F2ABA00AC9606 /* ARTLinearGradient.m in Sources */, - 325CF7AD1E5F2ABA00AC9606 /* ARTBrush.m in Sources */, - 325CF7B51E5F2ABA00AC9606 /* ARTShapeManager.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 0CF68AD31AF0540F00FF9E5C /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 0CF68AD41AF0540F00FF9E5C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 0CF68AD61AF0540F00FF9E5C /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 0CF68AD71AF0540F00FF9E5C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; - 323A128E1E5F266B004975B8 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NONNULL = YES; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_TESTABILITY = YES; - GCC_NO_COMMON_BLOCKS = YES; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = appletvos; - SKIP_INSTALL = YES; - TVOS_DEPLOYMENT_TARGET = 9.2; - }; - name = Debug; - }; - 323A128F1E5F266B004975B8 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NONNULL = YES; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_NO_COMMON_BLOCKS = YES; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = appletvos; - SKIP_INSTALL = YES; - TVOS_DEPLOYMENT_TARGET = 9.2; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 0CF68ABC1AF0540F00FF9E5C /* Build configuration list for PBXProject "ART" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 0CF68AD31AF0540F00FF9E5C /* Debug */, - 0CF68AD41AF0540F00FF9E5C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 0CF68AD51AF0540F00FF9E5C /* Build configuration list for PBXNativeTarget "ART" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 0CF68AD61AF0540F00FF9E5C /* Debug */, - 0CF68AD71AF0540F00FF9E5C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 323A128D1E5F266B004975B8 /* Build configuration list for PBXNativeTarget "ART-tvOS" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 323A128E1E5F266B004975B8 /* Debug */, - 323A128F1E5F266B004975B8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 0CF68AB91AF0540F00FF9E5C /* Project object */; -} diff --git a/docgen/Libraries/ART/ARTCGFloatArray.h b/docgen/Libraries/ART/ARTCGFloatArray.h deleted file mode 100644 index 9d748549973..00000000000 --- a/docgen/Libraries/ART/ARTCGFloatArray.h +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -// A little helper to make sure we have the right memory allocation ready for use. -// We assume that we will only this in one place so no reference counting is necessary. -// Needs to be freed when dealloced. - -// This is fragile since this relies on these values not getting reused. Consider -// wrapping these in an Obj-C class or some ARC hackery to get refcounting. - -typedef struct { - size_t count; - CGFloat *array; -} ARTCGFloatArray; diff --git a/docgen/Libraries/ART/ARTContainer.h b/docgen/Libraries/ART/ARTContainer.h deleted file mode 100644 index d83f7ae1a55..00000000000 --- a/docgen/Libraries/ART/ARTContainer.h +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -@protocol ARTContainer - -// This is used as a hook for child to mark it's parent as dirty. -// This bubbles up to the root which gets marked as dirty. -- (void)invalidate; - -@end diff --git a/docgen/Libraries/ART/ARTGroup.h b/docgen/Libraries/ART/ARTGroup.h deleted file mode 100644 index 4d94a9acded..00000000000 --- a/docgen/Libraries/ART/ARTGroup.h +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import "ARTContainer.h" -#import "ARTNode.h" - -@interface ARTGroup : ARTNode - -@property (nonatomic, assign) CGRect clipping; - -@end diff --git a/docgen/Libraries/ART/ARTGroup.m b/docgen/Libraries/ART/ARTGroup.m deleted file mode 100644 index 672c3b6ebeb..00000000000 --- a/docgen/Libraries/ART/ARTGroup.m +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ARTGroup.h" - -@implementation ARTGroup - -- (void)renderLayerTo:(CGContextRef)context -{ - - if (!CGRectIsEmpty(self.clipping)) { - CGContextClipToRect(context, self.clipping); - } - - for (ARTNode *node in self.subviews) { - [node renderTo:context]; - } -} - -@end diff --git a/docgen/Libraries/ART/ARTNode.h b/docgen/Libraries/ART/ARTNode.h deleted file mode 100644 index 0ade1f21b57..00000000000 --- a/docgen/Libraries/ART/ARTNode.h +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -/** - * ART nodes are implemented as empty UIViews but this is just an implementation detail to fit - * into the existing view management. They should also be shadow views and painted on a background - * thread. - */ - -@interface ARTNode : UIView - -@property (nonatomic, assign) CGFloat opacity; - -- (void)invalidate; -- (void)renderTo:(CGContextRef)context; - -/** - * renderTo will take opacity into account and draw renderLayerTo off-screen if there is opacity - * specified, then composite that onto the context. renderLayerTo always draws at opacity=1. - * @abstract - */ -- (void)renderLayerTo:(CGContextRef)context; - -@end diff --git a/docgen/Libraries/ART/ARTNode.m b/docgen/Libraries/ART/ARTNode.m deleted file mode 100644 index 38b01a0c56c..00000000000 --- a/docgen/Libraries/ART/ARTNode.m +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ARTNode.h" - -#import "ARTContainer.h" - -@implementation ARTNode - -- (void)insertReactSubview:(UIView *)subview atIndex:(NSInteger)atIndex -{ - [super insertReactSubview:subview atIndex:atIndex]; - [self insertSubview:subview atIndex:atIndex]; - [self invalidate]; -} - -- (void)removeReactSubview:(UIView *)subview -{ - [super removeReactSubview:subview]; - [self invalidate]; -} - -- (void)didUpdateReactSubviews -{ - // Do nothing, as subviews are inserted by insertReactSubview: -} - -- (void)setOpacity:(CGFloat)opacity -{ - [self invalidate]; - _opacity = opacity; -} - -- (void)setTransform:(CGAffineTransform)transform -{ - [self invalidate]; - super.transform = transform; -} - -- (void)invalidate -{ - id container = (id)self.superview; - [container invalidate]; -} - -- (void)renderTo:(CGContextRef)context -{ - if (self.opacity <= 0) { - // Nothing to paint - return; - } - if (self.opacity >= 1) { - // Just paint at full opacity - CGContextSaveGState(context); - CGContextConcatCTM(context, self.transform); - CGContextSetAlpha(context, 1); - [self renderLayerTo:context]; - CGContextRestoreGState(context); - return; - } - // This needs to be painted on a layer before being composited. - CGContextSaveGState(context); - CGContextConcatCTM(context, self.transform); - CGContextSetAlpha(context, self.opacity); - CGContextBeginTransparencyLayer(context, NULL); - [self renderLayerTo:context]; - CGContextEndTransparencyLayer(context); - CGContextRestoreGState(context); -} - -- (void)renderLayerTo:(CGContextRef)context -{ - // abstract -} - -@end diff --git a/docgen/Libraries/ART/ARTRenderable.h b/docgen/Libraries/ART/ARTRenderable.h deleted file mode 100644 index 8eae9c25ae4..00000000000 --- a/docgen/Libraries/ART/ARTRenderable.h +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import "ARTBrush.h" -#import "ARTCGFloatArray.h" -#import "ARTNode.h" - -@interface ARTRenderable : ARTNode - -@property (nonatomic, strong) ARTBrush *fill; -@property (nonatomic, assign) CGColorRef stroke; -@property (nonatomic, assign) CGFloat strokeWidth; -@property (nonatomic, assign) CGLineCap strokeCap; -@property (nonatomic, assign) CGLineJoin strokeJoin; -@property (nonatomic, assign) ARTCGFloatArray strokeDash; - -@end diff --git a/docgen/Libraries/ART/ARTRenderable.m b/docgen/Libraries/ART/ARTRenderable.m deleted file mode 100644 index 7ba9a9a6073..00000000000 --- a/docgen/Libraries/ART/ARTRenderable.m +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ARTRenderable.h" - -@implementation ARTRenderable - -- (void)setFill:(ARTBrush *)fill -{ - [self invalidate]; - _fill = fill; -} - -- (void)setStroke:(CGColorRef)stroke -{ - if (stroke == _stroke) { - return; - } - [self invalidate]; - CGColorRelease(_stroke); - _stroke = CGColorRetain(stroke); -} - -- (void)setStrokeWidth:(CGFloat)strokeWidth -{ - [self invalidate]; - _strokeWidth = strokeWidth; -} - -- (void)setStrokeCap:(CGLineCap)strokeCap -{ - [self invalidate]; - _strokeCap = strokeCap; -} - -- (void)setStrokeJoin:(CGLineJoin)strokeJoin -{ - [self invalidate]; - _strokeJoin = strokeJoin; -} - -- (void)setStrokeDash:(ARTCGFloatArray)strokeDash -{ - if (strokeDash.array == _strokeDash.array) { - return; - } - if (_strokeDash.array) { - free(_strokeDash.array); - } - [self invalidate]; - _strokeDash = strokeDash; -} - -- (void)dealloc -{ - CGColorRelease(_stroke); - if (_strokeDash.array) { - free(_strokeDash.array); - } -} - -- (void)renderTo:(CGContextRef)context -{ - if (self.opacity <= 0 || self.opacity >= 1 || (self.fill && self.stroke)) { - // If we have both fill and stroke, we will need to paint this using normal compositing - [super renderTo: context]; - return; - } - // This is a terminal with only one painting. Therefore we don't need to paint this - // off-screen. We can just composite it straight onto the buffer. - CGContextSaveGState(context); - CGContextConcatCTM(context, self.transform); - CGContextSetAlpha(context, self.opacity); - [self renderLayerTo:context]; - CGContextRestoreGState(context); -} - -- (void)renderLayerTo:(CGContextRef)context -{ - // abstract -} - -@end diff --git a/docgen/Libraries/ART/ARTSerializablePath.js b/docgen/Libraries/ART/ARTSerializablePath.js deleted file mode 100644 index 4e8b3c2271a..00000000000 --- a/docgen/Libraries/ART/ARTSerializablePath.js +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule ARTSerializablePath - */ -'use strict'; - -// TODO: Move this into an ART mode called "serialized" or something - -var Class = require('art/core/class.js'); -var Path = require('art/core/path.js'); - -var MOVE_TO = 0; -var CLOSE = 1; -var LINE_TO = 2; -var CURVE_TO = 3; -var ARC = 4; - -var SerializablePath = Class(Path, { - - initialize: function(path) { - this.reset(); - if (path instanceof SerializablePath) { - this.path = path.path.slice(0); - } else if (path) { - if (path.applyToPath) { - path.applyToPath(this); - } else { - this.push(path); - } - } - }, - - onReset: function() { - this.path = []; - }, - - onMove: function(sx, sy, x, y) { - this.path.push(MOVE_TO, x, y); - }, - - onLine: function(sx, sy, x, y) { - this.path.push(LINE_TO, x, y); - }, - - onBezierCurve: function(sx, sy, p1x, p1y, p2x, p2y, x, y) { - this.path.push(CURVE_TO, p1x, p1y, p2x, p2y, x, y); - }, - - _arcToBezier: Path.prototype.onArc, - - onArc: function(sx, sy, ex, ey, cx, cy, rx, ry, sa, ea, ccw, rotation) { - if (rx !== ry || rotation) { - return this._arcToBezier( - sx, sy, ex, ey, cx, cy, rx, ry, sa, ea, ccw, rotation - ); - } - this.path.push(ARC, cx, cy, rx, sa, ea, ccw ? 0 : 1); - }, - - onClose: function() { - this.path.push(CLOSE); - }, - - toJSON: function() { - return this.path; - } - -}); - -module.exports = SerializablePath; diff --git a/docgen/Libraries/ART/ARTShape.h b/docgen/Libraries/ART/ARTShape.h deleted file mode 100644 index 7d13c268f6e..00000000000 --- a/docgen/Libraries/ART/ARTShape.h +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import "ARTRenderable.h" - -@interface ARTShape : ARTRenderable - -@property (nonatomic, assign) CGPathRef d; - -@end diff --git a/docgen/Libraries/ART/ARTShape.m b/docgen/Libraries/ART/ARTShape.m deleted file mode 100644 index c07d68e62aa..00000000000 --- a/docgen/Libraries/ART/ARTShape.m +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ARTShape.h" - -@implementation ARTShape - -- (void)setD:(CGPathRef)d -{ - if (d == _d) { - return; - } - [self invalidate]; - CGPathRelease(_d); - _d = CGPathRetain(d); -} - -- (void)dealloc -{ - CGPathRelease(_d); -} - -- (void)renderLayerTo:(CGContextRef)context -{ - if ((!self.fill && !self.stroke) || !self.d) { - return; - } - - CGPathDrawingMode mode = kCGPathStroke; - if (self.fill) { - if ([self.fill applyFillColor:context]) { - mode = kCGPathFill; - } else { - CGContextSaveGState(context); - CGContextAddPath(context, self.d); - CGContextClip(context); - [self.fill paint:context]; - CGContextRestoreGState(context); - if (!self.stroke) { - return; - } - } - } - if (self.stroke) { - CGContextSetStrokeColorWithColor(context, self.stroke); - CGContextSetLineWidth(context, self.strokeWidth); - CGContextSetLineCap(context, self.strokeCap); - CGContextSetLineJoin(context, self.strokeJoin); - ARTCGFloatArray dash = self.strokeDash; - if (dash.count) { - CGContextSetLineDash(context, 0, dash.array, dash.count); - } - if (mode == kCGPathFill) { - mode = kCGPathFillStroke; - } - } - - CGContextAddPath(context, self.d); - CGContextDrawPath(context, mode); -} - -@end diff --git a/docgen/Libraries/ART/ARTSurfaceView.h b/docgen/Libraries/ART/ARTSurfaceView.h deleted file mode 100644 index 8be8d95040c..00000000000 --- a/docgen/Libraries/ART/ARTSurfaceView.h +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import "ARTContainer.h" - -@interface ARTSurfaceView : UIView - -@end diff --git a/docgen/Libraries/ART/ARTSurfaceView.m b/docgen/Libraries/ART/ARTSurfaceView.m deleted file mode 100644 index 96191360ac7..00000000000 --- a/docgen/Libraries/ART/ARTSurfaceView.m +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ARTSurfaceView.h" - -#import - -#import "ARTNode.h" - -@implementation ARTSurfaceView - -- (void)insertReactSubview:(UIView *)subview atIndex:(NSInteger)atIndex -{ - [super insertReactSubview:subview atIndex:atIndex]; - [self insertSubview:subview atIndex:atIndex]; - [self invalidate]; -} - -- (void)removeReactSubview:(UIView *)subview -{ - [super removeReactSubview:subview]; - [self invalidate]; -} - -- (void)didUpdateReactSubviews -{ - // Do nothing, as subviews are inserted by insertReactSubview: -} - -- (void)invalidate -{ - [self setNeedsDisplay]; -} - -- (void)drawRect:(CGRect)rect -{ - CGContextRef context = UIGraphicsGetCurrentContext(); - for (ARTNode *node in self.subviews) { - [node renderTo:context]; - } -} - -- (void)reactSetInheritedBackgroundColor:(UIColor *)inheritedBackgroundColor -{ - self.backgroundColor = inheritedBackgroundColor; -} - -@end diff --git a/docgen/Libraries/ART/ARTText.h b/docgen/Libraries/ART/ARTText.h deleted file mode 100644 index ee976e329a4..00000000000 --- a/docgen/Libraries/ART/ARTText.h +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import "ARTRenderable.h" -#import "ARTTextFrame.h" - -@interface ARTText : ARTRenderable - -@property (nonatomic, assign) CTTextAlignment alignment; -@property (nonatomic, assign) ARTTextFrame textFrame; - -@end diff --git a/docgen/Libraries/ART/ARTText.m b/docgen/Libraries/ART/ARTText.m deleted file mode 100644 index dfffde26546..00000000000 --- a/docgen/Libraries/ART/ARTText.m +++ /dev/null @@ -1,127 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ARTText.h" - -#import - -@implementation ARTText - -- (void)setAlignment:(CTTextAlignment)alignment -{ - [self invalidate]; - _alignment = alignment; -} - -static void ARTFreeTextFrame(ARTTextFrame frame) -{ - if (frame.count) { - // We must release each line before freeing up this struct - for (int i = 0; i < frame.count; i++) { - CFRelease(frame.lines[i]); - } - free(frame.lines); - free(frame.widths); - } -} - -- (void)setTextFrame:(ARTTextFrame)frame -{ - if (frame.lines != _textFrame.lines) { - ARTFreeTextFrame(_textFrame); - } - [self invalidate]; - _textFrame = frame; -} - -- (void)dealloc -{ - ARTFreeTextFrame(_textFrame); -} - -- (void)renderLayerTo:(CGContextRef)context -{ - ARTTextFrame frame = self.textFrame; - - if ((!self.fill && !self.stroke) || !frame.count) { - return; - } - - // to-do: draw along a path - - CGTextDrawingMode mode = kCGTextStroke; - if (self.fill) { - if ([self.fill applyFillColor:context]) { - mode = kCGTextFill; - } else { - - for (int i = 0; i < frame.count; i++) { - CGContextSaveGState(context); - // Inverse the coordinate space since CoreText assumes a bottom-up coordinate space - CGContextScaleCTM(context, 1.0, -1.0); - CGContextSetTextDrawingMode(context, kCGTextClip); - [self renderLineTo:context atIndex:i]; - // Inverse the coordinate space back to the original before filling - CGContextScaleCTM(context, 1.0, -1.0); - [self.fill paint:context]; - // Restore the state so that the next line can be clipped separately - CGContextRestoreGState(context); - } - - if (!self.stroke) { - return; - } - } - } - if (self.stroke) { - CGContextSetStrokeColorWithColor(context, self.stroke); - CGContextSetLineWidth(context, self.strokeWidth); - CGContextSetLineCap(context, self.strokeCap); - CGContextSetLineJoin(context, self.strokeJoin); - ARTCGFloatArray dash = self.strokeDash; - if (dash.count) { - CGContextSetLineDash(context, 0, dash.array, dash.count); - } - if (mode == kCGTextFill) { - mode = kCGTextFillStroke; - } - } - - CGContextSetTextDrawingMode(context, mode); - - // Inverse the coordinate space since CoreText assumes a bottom-up coordinate space - CGContextScaleCTM(context, 1.0, -1.0); - for (int i = 0; i < frame.count; i++) { - [self renderLineTo:context atIndex:i]; - } -} - -- (void)renderLineTo:(CGContextRef)context atIndex:(int)index -{ - ARTTextFrame frame = self.textFrame; - CGFloat shift; - switch (self.alignment) { - case kCTTextAlignmentRight: - shift = frame.widths[index]; - break; - case kCTTextAlignmentCenter: - shift = (frame.widths[index] / 2); - break; - default: - shift = 0; - break; - } - // We should consider snapping this shift to device pixels to improve rendering quality - // when a line has subpixel width. - CGContextSetTextPosition(context, -shift, -frame.baseLine - frame.lineHeight * index); - CTLineRef line = frame.lines[index]; - CTLineDraw(line, context); -} - -@end diff --git a/docgen/Libraries/ART/ARTTextFrame.h b/docgen/Libraries/ART/ARTTextFrame.h deleted file mode 100644 index 1f6b557bfc7..00000000000 --- a/docgen/Libraries/ART/ARTTextFrame.h +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -// A little helper to make sure we have a set of lines including width ready for use. -// We assume that we will only this in one place so no reference counting is necessary. -// Needs to be freed when dealloced. - -// This is fragile since this relies on these values not getting reused. Consider -// wrapping these in an Obj-C class or some ARC hackery to get refcounting. - -typedef struct { - size_t count; - CGFloat baseLine; // Distance from the origin to the base line of the first line - CGFloat lineHeight; // Distance between lines - CTLineRef *lines; - CGFloat *widths; // Width of each line -} ARTTextFrame; diff --git a/docgen/Libraries/ART/Brushes/ARTBrush.h b/docgen/Libraries/ART/Brushes/ARTBrush.h deleted file mode 100644 index 05020dd7baf..00000000000 --- a/docgen/Libraries/ART/Brushes/ARTBrush.h +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import -#import - -@interface ARTBrush : NSObject - -/* @abstract */ -- (instancetype)initWithArray:(NSArray *)data NS_DESIGNATED_INITIALIZER; - -/** - * For certain brushes we can fast path a combined fill and stroke. - * For those brushes we override applyFillColor which sets the fill - * color to be used by those batch paints. Those return YES. - * We can't batch gradient painting in CoreGraphics, so those will - * return NO and paint gets called instead. - * @abstract - */ -- (BOOL)applyFillColor:(CGContextRef)context; - -/** - * paint fills the context with a brush. The context is assumed to - * be clipped. - * @abstract - */ -- (void)paint:(CGContextRef)context; - -@end diff --git a/docgen/Libraries/ART/Brushes/ARTBrush.m b/docgen/Libraries/ART/Brushes/ARTBrush.m deleted file mode 100644 index 1cc762b650f..00000000000 --- a/docgen/Libraries/ART/Brushes/ARTBrush.m +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ARTBrush.h" - -#import - -@implementation ARTBrush - -- (instancetype)initWithArray:(NSArray *)data -{ - return [super init]; -} - -RCT_NOT_IMPLEMENTED(- (instancetype)init) - -- (BOOL)applyFillColor:(CGContextRef)context -{ - return NO; -} - -- (void)paint:(CGContextRef)context -{ - // abstract -} - -@end diff --git a/docgen/Libraries/ART/Brushes/ARTLinearGradient.h b/docgen/Libraries/ART/Brushes/ARTLinearGradient.h deleted file mode 100644 index d7ff2e56844..00000000000 --- a/docgen/Libraries/ART/Brushes/ARTLinearGradient.h +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ARTBrush.h" - -@interface ARTLinearGradient : ARTBrush - -@end diff --git a/docgen/Libraries/ART/Brushes/ARTLinearGradient.m b/docgen/Libraries/ART/Brushes/ARTLinearGradient.m deleted file mode 100644 index f8412163b31..00000000000 --- a/docgen/Libraries/ART/Brushes/ARTLinearGradient.m +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ARTLinearGradient.h" - -#import - -#import "RCTConvert+ART.h" - -@implementation ARTLinearGradient -{ - CGGradientRef _gradient; - CGPoint _startPoint; - CGPoint _endPoint; -} - -- (instancetype)initWithArray:(NSArray *)array -{ - if ((self = [super initWithArray:array])) { - if (array.count < 5) { - RCTLogError(@"-[%@ %@] expects 5 elements, received %@", - self.class, NSStringFromSelector(_cmd), array); - return nil; - } - _startPoint = [RCTConvert CGPoint:array offset:1]; - _endPoint = [RCTConvert CGPoint:array offset:3]; - _gradient = CGGradientRetain([RCTConvert CGGradient:array offset:5]); - } - return self; -} - -- (void)dealloc -{ - CGGradientRelease(_gradient); -} - -- (void)paint:(CGContextRef)context -{ - CGGradientDrawingOptions extendOptions = - kCGGradientDrawsBeforeStartLocation | kCGGradientDrawsAfterEndLocation; - CGContextDrawLinearGradient(context, _gradient, _startPoint, _endPoint, extendOptions); -} - -@end diff --git a/docgen/Libraries/ART/Brushes/ARTPattern.h b/docgen/Libraries/ART/Brushes/ARTPattern.h deleted file mode 100644 index 5f513ec60e2..00000000000 --- a/docgen/Libraries/ART/Brushes/ARTPattern.h +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ARTBrush.h" - -@interface ARTPattern : ARTBrush - -@end diff --git a/docgen/Libraries/ART/Brushes/ARTPattern.m b/docgen/Libraries/ART/Brushes/ARTPattern.m deleted file mode 100644 index 0d720613b80..00000000000 --- a/docgen/Libraries/ART/Brushes/ARTPattern.m +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ARTPattern.h" - -#import - -#import "RCTConvert+ART.h" - -@implementation ARTPattern -{ - CGImageRef _image; - CGRect _rect; -} - -- (instancetype)initWithArray:(NSArray *)array -{ - if ((self = [super initWithArray:array])) { - if (array.count < 6) { - RCTLogError(@"-[%@ %@] expects 6 elements, received %@", - self.class, NSStringFromSelector(_cmd), array); - return nil; - } - _image = CGImageRetain([RCTConvert CGImage:array[1]]); - _rect = [RCTConvert CGRect:array offset:2]; - } - return self; -} - -- (void)dealloc -{ - CGImageRelease(_image); -} - -// Note: This could use applyFillColor with a pattern. This could be more efficient but -// to do that, we need to calculate our own user space CTM. - -- (void)paint:(CGContextRef)context -{ - CGContextDrawTiledImage(context, _rect, _image); -} - - - -@end diff --git a/docgen/Libraries/ART/Brushes/ARTRadialGradient.h b/docgen/Libraries/ART/Brushes/ARTRadialGradient.h deleted file mode 100644 index 7f86d93058c..00000000000 --- a/docgen/Libraries/ART/Brushes/ARTRadialGradient.h +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ARTBrush.h" - -@interface ARTRadialGradient : ARTBrush - -@end diff --git a/docgen/Libraries/ART/Brushes/ARTRadialGradient.m b/docgen/Libraries/ART/Brushes/ARTRadialGradient.m deleted file mode 100644 index 1dd44959531..00000000000 --- a/docgen/Libraries/ART/Brushes/ARTRadialGradient.m +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ARTRadialGradient.h" - -#import - -#import "RCTConvert+ART.h" - -@implementation ARTRadialGradient -{ - CGGradientRef _gradient; - CGPoint _focusPoint; - CGPoint _centerPoint; - CGFloat _radius; - CGFloat _radiusRatio; -} - -- (instancetype)initWithArray:(NSArray *)array -{ - if ((self = [super initWithArray:array])) { - if (array.count < 7) { - RCTLogError(@"-[%@ %@] expects 7 elements, received %@", - self.class, NSStringFromSelector(_cmd), array); - return nil; - } - _radius = [RCTConvert CGFloat:array[3]]; - _radiusRatio = [RCTConvert CGFloat:array[4]] / _radius; - _focusPoint.x = [RCTConvert CGFloat:array[1]]; - _focusPoint.y = [RCTConvert CGFloat:array[2]] / _radiusRatio; - _centerPoint.x = [RCTConvert CGFloat:array[5]]; - _centerPoint.y = [RCTConvert CGFloat:array[6]] / _radiusRatio; - _gradient = CGGradientRetain([RCTConvert CGGradient:array offset:7]); - } - return self; -} - -- (void)dealloc -{ - CGGradientRelease(_gradient); -} - -- (void)paint:(CGContextRef)context -{ - CGAffineTransform transform = CGAffineTransformMakeScale(1, _radiusRatio); - CGContextConcatCTM(context, transform); - CGGradientDrawingOptions extendOptions = kCGGradientDrawsBeforeStartLocation | kCGGradientDrawsAfterEndLocation; - CGContextDrawRadialGradient(context, _gradient, _focusPoint, 0, _centerPoint, _radius, extendOptions); -} - -@end diff --git a/docgen/Libraries/ART/Brushes/ARTSolidColor.h b/docgen/Libraries/ART/Brushes/ARTSolidColor.h deleted file mode 100644 index f212c735680..00000000000 --- a/docgen/Libraries/ART/Brushes/ARTSolidColor.h +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ARTBrush.h" - -@interface ARTSolidColor : ARTBrush - -@end diff --git a/docgen/Libraries/ART/Brushes/ARTSolidColor.m b/docgen/Libraries/ART/Brushes/ARTSolidColor.m deleted file mode 100644 index 900621cfb4e..00000000000 --- a/docgen/Libraries/ART/Brushes/ARTSolidColor.m +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ARTSolidColor.h" - -#import - -#import "RCTConvert+ART.h" - -@implementation ARTSolidColor -{ - CGColorRef _color; -} - -- (instancetype)initWithArray:(NSArray *)array -{ - if ((self = [super initWithArray:array])) { - _color = CGColorRetain([RCTConvert CGColor:array offset:1]); - } - return self; -} - -- (void)dealloc -{ - CGColorRelease(_color); -} - -- (BOOL)applyFillColor:(CGContextRef)context -{ - CGContextSetFillColorWithColor(context, _color); - return YES; -} - -@end diff --git a/docgen/Libraries/ART/RCTConvert+ART.h b/docgen/Libraries/ART/RCTConvert+ART.h deleted file mode 100644 index ef46e4e9341..00000000000 --- a/docgen/Libraries/ART/RCTConvert+ART.h +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import - -#import "ARTBrush.h" -#import "ARTCGFloatArray.h" -#import "ARTTextFrame.h" - -@interface RCTConvert (ART) - -+ (CGPathRef)CGPath:(id)json; -+ (CTTextAlignment)CTTextAlignment:(id)json; -+ (ARTTextFrame)ARTTextFrame:(id)json; -+ (ARTCGFloatArray)ARTCGFloatArray:(id)json; -+ (ARTBrush *)ARTBrush:(id)json; - -+ (CGPoint)CGPoint:(id)json offset:(NSUInteger)offset; -+ (CGRect)CGRect:(id)json offset:(NSUInteger)offset; -+ (CGColorRef)CGColor:(id)json offset:(NSUInteger)offset; -+ (CGGradientRef)CGGradient:(id)json offset:(NSUInteger)offset; - -@end diff --git a/docgen/Libraries/ART/RCTConvert+ART.m b/docgen/Libraries/ART/RCTConvert+ART.m deleted file mode 100644 index 704f12697eb..00000000000 --- a/docgen/Libraries/ART/RCTConvert+ART.m +++ /dev/null @@ -1,224 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "RCTConvert+ART.h" - -#import -#import - -#import "ARTLinearGradient.h" -#import "ARTPattern.h" -#import "ARTRadialGradient.h" -#import "ARTSolidColor.h" - -@implementation RCTConvert (ART) - -+ (CGPathRef)CGPath:(id)json -{ - NSArray *arr = [self NSNumberArray:json]; - - NSUInteger count = [arr count]; - -#define NEXT_VALUE [self double:arr[i++]] - - CGMutablePathRef path = CGPathCreateMutable(); - CGPathMoveToPoint(path, NULL, 0, 0); - - @try { - NSUInteger i = 0; - while (i < count) { - NSUInteger type = [arr[i++] unsignedIntegerValue]; - switch (type) { - case 0: - CGPathMoveToPoint(path, NULL, NEXT_VALUE, NEXT_VALUE); - break; - case 1: - CGPathCloseSubpath(path); - break; - case 2: - CGPathAddLineToPoint(path, NULL, NEXT_VALUE, NEXT_VALUE); - break; - case 3: - CGPathAddCurveToPoint(path, NULL, NEXT_VALUE, NEXT_VALUE, NEXT_VALUE, NEXT_VALUE, NEXT_VALUE, NEXT_VALUE); - break; - case 4: - CGPathAddArc(path, NULL, NEXT_VALUE, NEXT_VALUE, NEXT_VALUE, NEXT_VALUE, NEXT_VALUE, NEXT_VALUE == 0); - break; - default: - RCTLogError(@"Invalid CGPath type %zd at element %zd of %@", type, i, arr); - CGPathRelease(path); - return NULL; - } - } - } - @catch (NSException *exception) { - RCTLogError(@"Invalid CGPath format: %@", arr); - CGPathRelease(path); - return NULL; - } - - return (CGPathRef)CFAutorelease(path); -} - -RCT_ENUM_CONVERTER(CTTextAlignment, (@{ - @"auto": @(kCTTextAlignmentNatural), - @"left": @(kCTTextAlignmentLeft), - @"center": @(kCTTextAlignmentCenter), - @"right": @(kCTTextAlignmentRight), - @"justify": @(kCTTextAlignmentJustified), -}), kCTTextAlignmentNatural, integerValue) - -// This takes a tuple of text lines and a font to generate a CTLine for each text line. -// This prepares everything for rendering a frame of text in ARTText. -+ (ARTTextFrame)ARTTextFrame:(id)json -{ - NSDictionary *dict = [self NSDictionary:json]; - ARTTextFrame frame; - frame.count = 0; - - NSArray *lines = [self NSArray:dict[@"lines"]]; - NSUInteger lineCount = [lines count]; - if (lineCount == 0) { - return frame; - } - - CTFontRef font = (__bridge CTFontRef)[self UIFont:dict[@"font"]]; - if (!font) { - return frame; - } - - // Create a dictionary for this font - CFDictionaryRef attributes = (__bridge CFDictionaryRef)@{ - (NSString *)kCTFontAttributeName:(__bridge id)font, - (NSString *)kCTForegroundColorFromContextAttributeName: @YES - }; - - // Set up text frame with font metrics - CGFloat size = CTFontGetSize(font); - frame.count = lineCount; - frame.baseLine = size; // estimate base line - frame.lineHeight = size * 1.1; // Base on ART canvas line height estimate - frame.lines = malloc(sizeof(CTLineRef) * lineCount); - frame.widths = malloc(sizeof(CGFloat) * lineCount); - - [lines enumerateObjectsUsingBlock:^(NSString *text, NSUInteger i, BOOL *stop) { - - CFStringRef string = (__bridge CFStringRef)text; - CFAttributedStringRef attrString = CFAttributedStringCreate(kCFAllocatorDefault, string, attributes); - CTLineRef line = CTLineCreateWithAttributedString(attrString); - CFRelease(attrString); - - frame.lines[i] = line; - frame.widths[i] = CTLineGetTypographicBounds(line, NULL, NULL, NULL); - }]; - - return frame; -} - -+ (ARTCGFloatArray)ARTCGFloatArray:(id)json -{ - NSArray *arr = [self NSNumberArray:json]; - NSUInteger count = arr.count; - - ARTCGFloatArray array; - array.count = count; - array.array = NULL; - - if (count) { - // Ideally, these arrays should already use the same memory layout. - // In that case we shouldn't need this new malloc. - array.array = malloc(sizeof(CGFloat) * count); - for (NSUInteger i = 0; i < count; i++) { - array.array[i] = [arr[i] doubleValue]; - } - } - - return array; -} - -+ (ARTBrush *)ARTBrush:(id)json -{ - NSArray *arr = [self NSArray:json]; - NSUInteger type = [self NSUInteger:arr.firstObject]; - switch (type) { - case 0: // solid color - // These are probably expensive allocations since it's often the same value. - // We should memoize colors but look ups may be just as expensive. - return [[ARTSolidColor alloc] initWithArray:arr]; - case 1: // linear gradient - return [[ARTLinearGradient alloc] initWithArray:arr]; - case 2: // radial gradient - return [[ARTRadialGradient alloc] initWithArray:arr]; - case 3: // pattern - return [[ARTPattern alloc] initWithArray:arr]; - default: - RCTLogError(@"Unknown brush type: %zd", type); - return nil; - } -} - -+ (CGPoint)CGPoint:(id)json offset:(NSUInteger)offset -{ - NSArray *arr = [self NSArray:json]; - if (arr.count < offset + 2) { - RCTLogError(@"Too few elements in array (expected at least %zd): %@", 2 + offset, arr); - return CGPointZero; - } - return (CGPoint){ - [self CGFloat:arr[offset]], - [self CGFloat:arr[offset + 1]], - }; -} - -+ (CGRect)CGRect:(id)json offset:(NSUInteger)offset -{ - NSArray *arr = [self NSArray:json]; - if (arr.count < offset + 4) { - RCTLogError(@"Too few elements in array (expected at least %zd): %@", 4 + offset, arr); - return CGRectZero; - } - return (CGRect){ - {[self CGFloat:arr[offset]], [self CGFloat:arr[offset + 1]]}, - {[self CGFloat:arr[offset + 2]], [self CGFloat:arr[offset + 3]]}, - }; -} - -+ (CGColorRef)CGColor:(id)json offset:(NSUInteger)offset -{ - NSArray *arr = [self NSArray:json]; - if (arr.count < offset + 4) { - RCTLogError(@"Too few elements in array (expected at least %zd): %@", 4 + offset, arr); - return NULL; - } - return [self CGColor:[arr subarrayWithRange:(NSRange){offset, 4}]]; -} - -+ (CGGradientRef)CGGradient:(id)json offset:(NSUInteger)offset -{ - NSArray *arr = [self NSArray:json]; - if (arr.count < offset) { - RCTLogError(@"Too few elements in array (expected at least %zd): %@", offset, arr); - return NULL; - } - arr = [arr subarrayWithRange:(NSRange){offset, arr.count - offset}]; - ARTCGFloatArray colorsAndOffsets = [self ARTCGFloatArray:arr]; - size_t stops = colorsAndOffsets.count / 5; - CGColorSpaceRef rgb = CGColorSpaceCreateDeviceRGB(); - CGGradientRef gradient = CGGradientCreateWithColorComponents( - rgb, - colorsAndOffsets.array, - colorsAndOffsets.array + stops * 4, - stops - ); - CGColorSpaceRelease(rgb); - free(colorsAndOffsets.array); - return (CGGradientRef)CFAutorelease(gradient); -} - -@end diff --git a/docgen/Libraries/ART/ReactNativeART.js b/docgen/Libraries/ART/ReactNativeART.js deleted file mode 100644 index a54fafdfe50..00000000000 --- a/docgen/Libraries/ART/ReactNativeART.js +++ /dev/null @@ -1,586 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule ReactNativeART - */ -'use strict'; - -var Color = require('art/core/color'); -var Path = require('ARTSerializablePath'); -var Transform = require('art/core/transform'); - -var React = require('React'); -var PropTypes = require('prop-types'); -var ReactNativeViewAttributes = require('ReactNativeViewAttributes'); - -var createReactNativeComponentClass = require('createReactNativeComponentClass'); -var merge = require('merge'); -var invariant = require('fbjs/lib/invariant'); - -// Diff Helpers - -function arrayDiffer(a, b) { - if (a == null || b == null) { - return true; - } - if (a.length !== b.length) { - return true; - } - for (var i = 0; i < a.length; i++) { - if (a[i] !== b[i]) { - return true; - } - } - return false; -} - -function fontAndLinesDiffer(a, b) { - if (a === b) { - return false; - } - if (a.font !== b.font) { - if (a.font === null) { - return true; - } - if (b.font === null) { - return true; - } - - if ( - a.font.fontFamily !== b.font.fontFamily || - a.font.fontSize !== b.font.fontSize || - a.font.fontWeight !== b.font.fontWeight || - a.font.fontStyle !== b.font.fontStyle - ) { - return true; - } - } - return arrayDiffer(a.lines, b.lines); -} - -// Native Attributes - -var SurfaceViewAttributes = merge(ReactNativeViewAttributes.UIView, { - // This should contain pixel information such as width, height and - // resolution to know what kind of buffer needs to be allocated. - // Currently we rely on UIViews and style to figure that out. -}); - -var NodeAttributes = { - transform: { diff: arrayDiffer }, - opacity: true, -}; - -var GroupAttributes = merge(NodeAttributes, { - clipping: { diff: arrayDiffer } -}); - -var RenderableAttributes = merge(NodeAttributes, { - fill: { diff: arrayDiffer }, - stroke: { diff: arrayDiffer }, - strokeWidth: true, - strokeCap: true, - strokeJoin: true, - strokeDash: { diff: arrayDiffer }, -}); - -var ShapeAttributes = merge(RenderableAttributes, { - d: { diff: arrayDiffer }, -}); - -var TextAttributes = merge(RenderableAttributes, { - alignment: true, - frame: { diff: fontAndLinesDiffer }, - path: { diff: arrayDiffer } -}); - -// Native Components - -var NativeSurfaceView = createReactNativeComponentClass({ - validAttributes: SurfaceViewAttributes, - uiViewClassName: 'ARTSurfaceView', -}); - -var NativeGroup = createReactNativeComponentClass({ - validAttributes: GroupAttributes, - uiViewClassName: 'ARTGroup', -}); - -var NativeShape = createReactNativeComponentClass({ - validAttributes: ShapeAttributes, - uiViewClassName: 'ARTShape', -}); - -var NativeText = createReactNativeComponentClass({ - validAttributes: TextAttributes, - uiViewClassName: 'ARTText', -}); - -// Utilities - -function childrenAsString(children) { - if (!children) { - return ''; - } - if (typeof children === 'string') { - return children; - } - if (children.length) { - return children.join('\n'); - } - return ''; -} - -// Surface - Root node of all ART - -class Surface extends React.Component { - static childContextTypes = { - isInSurface: PropTypes.bool, - }; - - getChildContext() { - return { isInSurface: true }; - } - - render() { - var props = this.props; - var w = extractNumber(props.width, 0); - var h = extractNumber(props.height, 0); - return ( - - {this.props.children} - - ); - } -} - -// Node Props - -// TODO: The desktop version of ART has title and cursor. We should have -// accessibility support here too even though hovering doesn't work. - -function extractNumber(value, defaultValue) { - if (value == null) { - return defaultValue; - } - return +value; -} - -var pooledTransform = new Transform(); - -function extractTransform(props) { - var scaleX = props.scaleX != null ? props.scaleX : - props.scale != null ? props.scale : 1; - var scaleY = props.scaleY != null ? props.scaleY : - props.scale != null ? props.scale : 1; - - pooledTransform - .transformTo(1, 0, 0, 1, 0, 0) - .move(props.x || 0, props.y || 0) - .rotate(props.rotation || 0, props.originX, props.originY) - .scale(scaleX, scaleY, props.originX, props.originY); - - if (props.transform != null) { - pooledTransform.transform(props.transform); - } - - return [ - pooledTransform.xx, pooledTransform.yx, - pooledTransform.xy, pooledTransform.yy, - pooledTransform.x, pooledTransform.y, - ]; -} - -function extractOpacity(props) { - // TODO: visible === false should also have no hit detection - if (props.visible === false) { - return 0; - } - if (props.opacity == null) { - return 1; - } - return +props.opacity; -} - -// Groups - -// Note: ART has a notion of width and height on Group but AFAIK it's a noop in -// ReactART. - -class Group extends React.Component { - static contextTypes = { - isInSurface: PropTypes.bool.isRequired, - }; - - render() { - var props = this.props; - invariant( - this.context.isInSurface, - 'ART: must be a child of a ' - ); - return ( - - {this.props.children} - - ); - } -} - -class ClippingRectangle extends React.Component { - render() { - var props = this.props; - var x = extractNumber(props.x, 0); - var y = extractNumber(props.y, 0); - var w = extractNumber(props.width, 0); - var h = extractNumber(props.height, 0); - var clipping = [x, y, w, h]; - // The current clipping API requires x and y to be ignored in the transform - var propsExcludingXAndY = merge(props); - delete propsExcludingXAndY.x; - delete propsExcludingXAndY.y; - return ( - - {this.props.children} - - ); - } -} - -// Renderables - -var SOLID_COLOR = 0; -var LINEAR_GRADIENT = 1; -var RADIAL_GRADIENT = 2; -var PATTERN = 3; - -function insertColorIntoArray(color, targetArray, atIndex) { - var c = new Color(color); - targetArray[atIndex + 0] = c.red / 255; - targetArray[atIndex + 1] = c.green / 255; - targetArray[atIndex + 2] = c.blue / 255; - targetArray[atIndex + 3] = c.alpha; -} - -function insertColorsIntoArray(stops, targetArray, atIndex) { - var i = 0; - if ('length' in stops) { - while (i < stops.length) { - insertColorIntoArray(stops[i], targetArray, atIndex + i * 4); - i++; - } - } else { - for (var offset in stops) { - insertColorIntoArray(stops[offset], targetArray, atIndex + i * 4); - i++; - } - } - return atIndex + i * 4; -} - -function insertOffsetsIntoArray(stops, targetArray, atIndex, multi, reverse) { - var offsetNumber; - var i = 0; - if ('length' in stops) { - while (i < stops.length) { - offsetNumber = i / (stops.length - 1) * multi; - targetArray[atIndex + i] = reverse ? 1 - offsetNumber : offsetNumber; - i++; - } - } else { - for (var offsetString in stops) { - offsetNumber = (+offsetString) * multi; - targetArray[atIndex + i] = reverse ? 1 - offsetNumber : offsetNumber; - i++; - } - } - return atIndex + i; -} - -function insertColorStopsIntoArray(stops, targetArray, atIndex) { - var lastIndex = insertColorsIntoArray(stops, targetArray, atIndex); - insertOffsetsIntoArray(stops, targetArray, lastIndex, 1, false); -} - -function insertDoubleColorStopsIntoArray(stops, targetArray, atIndex) { - var lastIndex = insertColorsIntoArray(stops, targetArray, atIndex); - lastIndex = insertColorsIntoArray(stops, targetArray, lastIndex); - lastIndex = insertOffsetsIntoArray(stops, targetArray, lastIndex, 0.5, false); - insertOffsetsIntoArray(stops, targetArray, lastIndex, 0.5, true); -} - -function applyBoundingBoxToBrushData(brushData, props) { - var type = brushData[0]; - var width = +props.width; - var height = +props.height; - if (type === LINEAR_GRADIENT) { - brushData[1] *= width; - brushData[2] *= height; - brushData[3] *= width; - brushData[4] *= height; - } else if (type === RADIAL_GRADIENT) { - brushData[1] *= width; - brushData[2] *= height; - brushData[3] *= width; - brushData[4] *= height; - brushData[5] *= width; - brushData[6] *= height; - } else if (type === PATTERN) { - // todo - } -} - -function extractBrush(colorOrBrush, props) { - if (colorOrBrush == null) { - return null; - } - if (colorOrBrush._brush) { - if (colorOrBrush._bb) { - // The legacy API for Gradients allow for the bounding box to be used - // as a convenience for specifying gradient positions. This should be - // deprecated. It's not properly implemented in canvas mode. ReactART - // doesn't handle update to the bounding box correctly. That's why we - // mutate this so that if it's reused, we reuse the same resolved box. - applyBoundingBoxToBrushData(colorOrBrush._brush, props); - colorOrBrush._bb = false; - } - return colorOrBrush._brush; - } - var c = new Color(colorOrBrush); - return [SOLID_COLOR, c.red / 255, c.green / 255, c.blue / 255, c.alpha]; -} - -function extractColor(color) { - if (color == null) { - return null; - } - var c = new Color(color); - return [c.red / 255, c.green / 255, c.blue / 255, c.alpha]; -} - -function extractStrokeCap(strokeCap) { - switch (strokeCap) { - case 'butt': return 0; - case 'square': return 2; - default: return 1; // round - } -} - -function extractStrokeJoin(strokeJoin) { - switch (strokeJoin) { - case 'miter': return 0; - case 'bevel': return 2; - default: return 1; // round - } -} - -// Shape - -// Note: ART has a notion of width and height on Shape but AFAIK it's a noop in -// ReactART. - -class Shape extends React.Component { - render() { - var props = this.props; - var path = props.d || childrenAsString(props.children); - var d = (path instanceof Path ? path : new Path(path)).toJSON(); - return ( - - ); - } -} - -// Text - -var cachedFontObjectsFromString = {}; - -var fontFamilyPrefix = /^[\s"']*/; -var fontFamilySuffix = /[\s"']*$/; - -function extractSingleFontFamily(fontFamilyString) { - // ART on the web allows for multiple font-families to be specified. - // For compatibility, we extract the first font-family, hoping - // we'll get a match. - return fontFamilyString.split(',')[0] - .replace(fontFamilyPrefix, '') - .replace(fontFamilySuffix, ''); -} - -function parseFontString(font) { - if (cachedFontObjectsFromString.hasOwnProperty(font)) { - return cachedFontObjectsFromString[font]; - } - var regexp = /^\s*((?:(?:normal|bold|italic)\s+)*)(?:(\d+(?:\.\d+)?)[ptexm\%]*(?:\s*\/.*?)?\s+)?\s*\"?([^\"]*)/i; - var match = regexp.exec(font); - if (!match) { - return null; - } - var fontFamily = extractSingleFontFamily(match[3]); - var fontSize = +match[2] || 12; - var isBold = /bold/.exec(match[1]); - var isItalic = /italic/.exec(match[1]); - cachedFontObjectsFromString[font] = { - fontFamily: fontFamily, - fontSize: fontSize, - fontWeight: isBold ? 'bold' : 'normal', - fontStyle: isItalic ? 'italic' : 'normal', - }; - return cachedFontObjectsFromString[font]; -} - -function extractFont(font) { - if (font == null) { - return null; - } - if (typeof font === 'string') { - return parseFontString(font); - } - var fontFamily = extractSingleFontFamily(font.fontFamily); - var fontSize = +font.fontSize || 12; - var fontWeight = font.fontWeight != null ? font.fontWeight.toString() : '400'; - return { - // Normalize - fontFamily: fontFamily, - fontSize: fontSize, - fontWeight: fontWeight, - fontStyle: font.fontStyle, - }; -} - -var newLine = /\n/g; -function extractFontAndLines(font, text) { - return { font: extractFont(font), lines: text.split(newLine) }; -} - -function extractAlignment(alignment) { - switch (alignment) { - case 'right': - return 1; - case 'center': - return 2; - default: - return 0; - } -} - -class Text extends React.Component { - render() { - var props = this.props; - var path = props.path; - var textPath = path ? (path instanceof Path ? path : new Path(path)).toJSON() : null; - var textFrame = extractFontAndLines( - props.font, - childrenAsString(props.children) - ); - return ( - - ); - } -} - -// Declarative fill type objects - API design not finalized - -function LinearGradient(stops, x1, y1, x2, y2) { - var type = LINEAR_GRADIENT; - - if (arguments.length < 5) { - var angle = ((x1 == null) ? 270 : x1) * Math.PI / 180; - - var x = Math.cos(angle); - var y = -Math.sin(angle); - var l = (Math.abs(x) + Math.abs(y)) / 2; - - x *= l; y *= l; - - x1 = 0.5 - x; - x2 = 0.5 + x; - y1 = 0.5 - y; - y2 = 0.5 + y; - this._bb = true; - } else { - this._bb = false; - } - - var brushData = [type, +x1, +y1, +x2, +y2]; - insertColorStopsIntoArray(stops, brushData, 5); - this._brush = brushData; -} - -function RadialGradient(stops, fx, fy, rx, ry, cx, cy) { - if (ry == null) { - ry = rx; - } - if (cx == null) { - cx = fx; - } - if (cy == null) { - cy = fy; - } - if (fx == null) { - // As a convenience we allow the whole radial gradient to cover the - // bounding box. We should consider dropping this API. - fx = fy = rx = ry = cx = cy = 0.5; - this._bb = true; - } else { - this._bb = false; - } - // The ART API expects the radial gradient to be repeated at the edges. - // To simulate this we render the gradient twice as large and add double - // color stops. Ideally this API would become more restrictive so that this - // extra work isn't needed. - var brushData = [RADIAL_GRADIENT, +fx, +fy, +rx * 2, +ry * 2, +cx, +cy]; - insertDoubleColorStopsIntoArray(stops, brushData, 7); - this._brush = brushData; -} - -function Pattern(url, width, height, left, top) { - this._brush = [PATTERN, url, +left || 0, +top || 0, +width, +height]; -} - -var ReactART = { - LinearGradient: LinearGradient, - RadialGradient: RadialGradient, - Pattern: Pattern, - Transform: Transform, - Path: Path, - Surface: Surface, - Group: Group, - ClippingRectangle: ClippingRectangle, - Shape: Shape, - Text: Text, -}; - -module.exports = ReactART; diff --git a/docgen/Libraries/ART/ViewManagers/ARTGroupManager.h b/docgen/Libraries/ART/ViewManagers/ARTGroupManager.h deleted file mode 100644 index 0a90eb3d6c1..00000000000 --- a/docgen/Libraries/ART/ViewManagers/ARTGroupManager.h +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ARTNodeManager.h" - -@interface ARTGroupManager : ARTNodeManager - -@end diff --git a/docgen/Libraries/ART/ViewManagers/ARTGroupManager.m b/docgen/Libraries/ART/ViewManagers/ARTGroupManager.m deleted file mode 100644 index 8b277641588..00000000000 --- a/docgen/Libraries/ART/ViewManagers/ARTGroupManager.m +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ARTGroupManager.h" - -#import "ARTGroup.h" -#import "RCTConvert+ART.h" - -@implementation ARTGroupManager - -RCT_EXPORT_MODULE() - -- (ARTNode *)node -{ - return [ARTGroup new]; -} - -RCT_EXPORT_VIEW_PROPERTY(clipping, CGRect) - -@end diff --git a/docgen/Libraries/ART/ViewManagers/ARTNodeManager.h b/docgen/Libraries/ART/ViewManagers/ARTNodeManager.h deleted file mode 100644 index 22f2ef166b2..00000000000 --- a/docgen/Libraries/ART/ViewManagers/ARTNodeManager.h +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -@class ARTNode; - -@interface ARTNodeManager : RCTViewManager - -- (ARTNode *)node; - -@end diff --git a/docgen/Libraries/ART/ViewManagers/ARTNodeManager.m b/docgen/Libraries/ART/ViewManagers/ARTNodeManager.m deleted file mode 100644 index 3c697c12978..00000000000 --- a/docgen/Libraries/ART/ViewManagers/ARTNodeManager.m +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ARTNodeManager.h" - -#import "ARTNode.h" - -@implementation ARTNodeManager - -RCT_EXPORT_MODULE() - -- (ARTNode *)node -{ - return [ARTNode new]; -} - -- (UIView *)view -{ - return [self node]; -} - -- (RCTShadowView *)shadowView -{ - return nil; -} - -RCT_EXPORT_VIEW_PROPERTY(opacity, CGFloat) -RCT_EXPORT_VIEW_PROPERTY(transform, CGAffineTransform) - -@end diff --git a/docgen/Libraries/ART/ViewManagers/ARTRenderableManager.h b/docgen/Libraries/ART/ViewManagers/ARTRenderableManager.h deleted file mode 100644 index 376fcf518b3..00000000000 --- a/docgen/Libraries/ART/ViewManagers/ARTRenderableManager.h +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ARTNodeManager.h" -#import "ARTRenderable.h" - -@interface ARTRenderableManager : ARTNodeManager - -- (ARTRenderable *)node; - -@end diff --git a/docgen/Libraries/ART/ViewManagers/ARTRenderableManager.m b/docgen/Libraries/ART/ViewManagers/ARTRenderableManager.m deleted file mode 100644 index aaed2e31d11..00000000000 --- a/docgen/Libraries/ART/ViewManagers/ARTRenderableManager.m +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ARTRenderableManager.h" - -#import "RCTConvert+ART.h" - -@implementation ARTRenderableManager - -RCT_EXPORT_MODULE() - -- (ARTRenderable *)node -{ - return [ARTRenderable new]; -} - -RCT_EXPORT_VIEW_PROPERTY(strokeWidth, CGFloat) -RCT_EXPORT_VIEW_PROPERTY(strokeCap, CGLineCap) -RCT_EXPORT_VIEW_PROPERTY(strokeJoin, CGLineJoin) -RCT_EXPORT_VIEW_PROPERTY(fill, ARTBrush) -RCT_EXPORT_VIEW_PROPERTY(stroke, CGColor) -RCT_EXPORT_VIEW_PROPERTY(strokeDash, ARTCGFloatArray) - -@end diff --git a/docgen/Libraries/ART/ViewManagers/ARTShapeManager.h b/docgen/Libraries/ART/ViewManagers/ARTShapeManager.h deleted file mode 100644 index d6bc76baa09..00000000000 --- a/docgen/Libraries/ART/ViewManagers/ARTShapeManager.h +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ARTRenderableManager.h" - -@interface ARTShapeManager : ARTRenderableManager - -@end diff --git a/docgen/Libraries/ART/ViewManagers/ARTShapeManager.m b/docgen/Libraries/ART/ViewManagers/ARTShapeManager.m deleted file mode 100644 index 3997586d18e..00000000000 --- a/docgen/Libraries/ART/ViewManagers/ARTShapeManager.m +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ARTShapeManager.h" - -#import "ARTShape.h" -#import "RCTConvert+ART.h" - -@implementation ARTShapeManager - -RCT_EXPORT_MODULE() - -- (ARTRenderable *)node -{ - return [ARTShape new]; -} - -RCT_EXPORT_VIEW_PROPERTY(d, CGPath) - -@end diff --git a/docgen/Libraries/ART/ViewManagers/ARTSurfaceViewManager.h b/docgen/Libraries/ART/ViewManagers/ARTSurfaceViewManager.h deleted file mode 100644 index fc36435edb7..00000000000 --- a/docgen/Libraries/ART/ViewManagers/ARTSurfaceViewManager.h +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -@interface ARTSurfaceViewManager : RCTViewManager - -@end diff --git a/docgen/Libraries/ART/ViewManagers/ARTSurfaceViewManager.m b/docgen/Libraries/ART/ViewManagers/ARTSurfaceViewManager.m deleted file mode 100644 index 10772b72c7f..00000000000 --- a/docgen/Libraries/ART/ViewManagers/ARTSurfaceViewManager.m +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ARTSurfaceViewManager.h" - -#import "ARTSurfaceView.h" - -@implementation ARTSurfaceViewManager - -RCT_EXPORT_MODULE() - -- (UIView *)view -{ - return [ARTSurfaceView new]; -} - -@end diff --git a/docgen/Libraries/ART/ViewManagers/ARTTextManager.h b/docgen/Libraries/ART/ViewManagers/ARTTextManager.h deleted file mode 100644 index 48da9c891f4..00000000000 --- a/docgen/Libraries/ART/ViewManagers/ARTTextManager.h +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ARTRenderableManager.h" - -@interface ARTTextManager : ARTRenderableManager - -@end diff --git a/docgen/Libraries/ART/ViewManagers/ARTTextManager.m b/docgen/Libraries/ART/ViewManagers/ARTTextManager.m deleted file mode 100644 index 430f26db537..00000000000 --- a/docgen/Libraries/ART/ViewManagers/ARTTextManager.m +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ARTTextManager.h" - -#import "ARTText.h" -#import "RCTConvert+ART.h" - -@implementation ARTTextManager - -RCT_EXPORT_MODULE() - -- (ARTRenderable *)node -{ - return [ARTText new]; -} - -RCT_EXPORT_VIEW_PROPERTY(alignment, CTTextAlignment) -RCT_REMAP_VIEW_PROPERTY(frame, textFrame, ARTTextFrame) - -@end diff --git a/docgen/Libraries/ActionSheetIOS/ActionSheetIOS.js b/docgen/Libraries/ActionSheetIOS/ActionSheetIOS.js deleted file mode 100644 index d7e666be901..00000000000 --- a/docgen/Libraries/ActionSheetIOS/ActionSheetIOS.js +++ /dev/null @@ -1,84 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule ActionSheetIOS - * @flow - */ -'use strict'; - -var RCTActionSheetManager = require('NativeModules').ActionSheetManager; - -var invariant = require('fbjs/lib/invariant'); -var processColor = require('processColor'); - -var ActionSheetIOS = { - /** - * Display an iOS action sheet. The `options` object must contain one or more - * of: - * - * - `options` (array of strings) - a list of button titles (required) - * - `cancelButtonIndex` (int) - index of cancel button in `options` - * - `destructiveButtonIndex` (int) - index of destructive button in `options` - * - `title` (string) - a title to show above the action sheet - * - `message` (string) - a message to show below the title - */ - showActionSheetWithOptions(options: Object, callback: Function) { - invariant( - typeof options === 'object' && options !== null, - 'Options must be a valid object' - ); - invariant( - typeof callback === 'function', - 'Must provide a valid callback' - ); - RCTActionSheetManager.showActionSheetWithOptions( - {...options, tintColor: processColor(options.tintColor)}, - callback - ); - }, - - /** - * Display the iOS share sheet. The `options` object should contain - * one or both of `message` and `url` and can additionally have - * a `subject` or `excludedActivityTypes`: - * - * - `url` (string) - a URL to share - * - `message` (string) - a message to share - * - `subject` (string) - a subject for the message - * - `excludedActivityTypes` (array) - the activities to exclude from the ActionSheet - * - * NOTE: if `url` points to a local file, or is a base64-encoded - * uri, the file it points to will be loaded and shared directly. - * In this way, you can share images, videos, PDF files, etc. - */ - showShareActionSheetWithOptions( - options: Object, - failureCallback: Function, - successCallback: Function - ) { - invariant( - typeof options === 'object' && options !== null, - 'Options must be a valid object' - ); - invariant( - typeof failureCallback === 'function', - 'Must provide a valid failureCallback' - ); - invariant( - typeof successCallback === 'function', - 'Must provide a valid successCallback' - ); - RCTActionSheetManager.showShareActionSheetWithOptions( - {...options, tintColor: processColor(options.tintColor)}, - failureCallback, - successCallback - ); - } -}; - -module.exports = ActionSheetIOS; diff --git a/docgen/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj/project.pbxproj b/docgen/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj/project.pbxproj deleted file mode 100644 index 40d08248bc3..00000000000 --- a/docgen/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj/project.pbxproj +++ /dev/null @@ -1,235 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 14C644C41AB0DFC900DE3C65 /* RCTActionSheetManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 14C644C21AB0DFC900DE3C65 /* RCTActionSheetManager.m */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 134814201AA4EA6300B7C361 /* libRCTActionSheet.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTActionSheet.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 14C644C11AB0DFC900DE3C65 /* RCTActionSheetManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTActionSheetManager.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - 14C644C21AB0DFC900DE3C65 /* RCTActionSheetManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTActionSheetManager.m; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXGroup section */ - 134814211AA4EA7D00B7C361 /* Products */ = { - isa = PBXGroup; - children = ( - 134814201AA4EA6300B7C361 /* libRCTActionSheet.a */, - ); - name = Products; - sourceTree = ""; - }; - 58B511D21A9E6C8500147676 = { - isa = PBXGroup; - children = ( - 14C644C11AB0DFC900DE3C65 /* RCTActionSheetManager.h */, - 14C644C21AB0DFC900DE3C65 /* RCTActionSheetManager.m */, - 134814211AA4EA7D00B7C361 /* Products */, - ); - indentWidth = 2; - sourceTree = ""; - tabWidth = 2; - usesTabs = 0; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 58B511DA1A9E6C8500147676 /* RCTActionSheet */ = { - isa = PBXNativeTarget; - buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RCTActionSheet" */; - buildPhases = ( - 58B511D71A9E6C8500147676 /* Sources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = RCTActionSheet; - productName = RCTDataManager; - productReference = 134814201AA4EA6300B7C361 /* libRCTActionSheet.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 58B511D31A9E6C8500147676 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0610; - ORGANIZATIONNAME = Facebook; - TargetAttributes = { - 58B511DA1A9E6C8500147676 = { - CreatedOnToolsVersion = 6.1.1; - }; - }; - }; - buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RCTActionSheet" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 58B511D21A9E6C8500147676; - productRefGroup = 58B511D21A9E6C8500147676; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 58B511DA1A9E6C8500147676 /* RCTActionSheet */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 58B511D71A9E6C8500147676 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 14C644C41AB0DFC900DE3C65 /* RCTActionSheetManager.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 58B511ED1A9E6C8500147676 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; - GCC_WARN_SHADOW = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - WARNING_CFLAGS = ( - "-Werror", - "-Wall", - ); - }; - name = Debug; - }; - 58B511EE1A9E6C8500147676 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; - GCC_WARN_SHADOW = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - VALIDATE_PRODUCT = YES; - WARNING_CFLAGS = ( - "-Werror", - "-Wall", - ); - }; - name = Release; - }; - 58B511F01A9E6C8500147676 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_STATIC_ANALYZER_MODE = deep; - LIBRARY_SEARCH_PATHS = "$(inherited)"; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = RCTActionSheet; - RUN_CLANG_STATIC_ANALYZER = YES; - }; - name = Debug; - }; - 58B511F11A9E6C8500147676 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_STATIC_ANALYZER_MODE = deep; - LIBRARY_SEARCH_PATHS = "$(inherited)"; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = RCTActionSheet; - RUN_CLANG_STATIC_ANALYZER = NO; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RCTActionSheet" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 58B511ED1A9E6C8500147676 /* Debug */, - 58B511EE1A9E6C8500147676 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RCTActionSheet" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 58B511F01A9E6C8500147676 /* Debug */, - 58B511F11A9E6C8500147676 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 58B511D31A9E6C8500147676 /* Project object */; -} diff --git a/docgen/Libraries/ActionSheetIOS/RCTActionSheetManager.h b/docgen/Libraries/ActionSheetIOS/RCTActionSheetManager.h deleted file mode 100644 index 313939149fd..00000000000 --- a/docgen/Libraries/ActionSheetIOS/RCTActionSheetManager.h +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import - -@interface RCTActionSheetManager : NSObject - -@end diff --git a/docgen/Libraries/ActionSheetIOS/RCTActionSheetManager.m b/docgen/Libraries/ActionSheetIOS/RCTActionSheetManager.m deleted file mode 100644 index 9f550f77af3..00000000000 --- a/docgen/Libraries/ActionSheetIOS/RCTActionSheetManager.m +++ /dev/null @@ -1,204 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "RCTActionSheetManager.h" - -#import -#import -#import -#import -#import - -@interface RCTActionSheetManager () -@end - -@implementation RCTActionSheetManager -{ - // Use NSMapTable, as UIAlertViews do not implement - // which is required for NSDictionary keys - NSMapTable *_callbacks; -} - -RCT_EXPORT_MODULE() - -@synthesize bridge = _bridge; - -- (dispatch_queue_t)methodQueue -{ - return dispatch_get_main_queue(); -} - -/* - * The `anchor` option takes a view to set as the anchor for the share - * popup to point to, on iPads running iOS 8. If it is not passed, it - * defaults to centering the share popup on screen without any arrows. - */ -- (CGRect)sourceRectInView:(UIView *)sourceView - anchorViewTag:(NSNumber *)anchorViewTag -{ - if (anchorViewTag) { - UIView *anchorView = [self.bridge.uiManager viewForReactTag:anchorViewTag]; - return [anchorView convertRect:anchorView.bounds toView:sourceView]; - } else { - return (CGRect){sourceView.center, {1, 1}}; - } -} - -RCT_EXPORT_METHOD(showActionSheetWithOptions:(NSDictionary *)options - callback:(RCTResponseSenderBlock)callback) -{ - if (RCTRunningInAppExtension()) { - RCTLogError(@"Unable to show action sheet from app extension"); - return; - } - - if (!_callbacks) { - _callbacks = [NSMapTable strongToStrongObjectsMapTable]; - } - - NSString *title = [RCTConvert NSString:options[@"title"]]; - NSString *message = [RCTConvert NSString:options[@"message"]]; - NSArray *buttons = [RCTConvert NSStringArray:options[@"options"]]; - NSInteger destructiveButtonIndex = options[@"destructiveButtonIndex"] ? [RCTConvert NSInteger:options[@"destructiveButtonIndex"]] : -1; - NSInteger cancelButtonIndex = options[@"cancelButtonIndex"] ? [RCTConvert NSInteger:options[@"cancelButtonIndex"]] : -1; - - UIViewController *controller = RCTPresentedViewController(); - - if (controller == nil) { - RCTLogError(@"Tried to display action sheet but there is no application window. options: %@", options); - return; - } - - /* - * The `anchor` option takes a view to set as the anchor for the share - * popup to point to, on iPads running iOS 8. If it is not passed, it - * defaults to centering the share popup on screen without any arrows. - */ - NSNumber *anchorViewTag = [RCTConvert NSNumber:options[@"anchor"]]; - UIView *sourceView = controller.view; - CGRect sourceRect = [self sourceRectInView:sourceView anchorViewTag:anchorViewTag]; - - UIAlertController *alertController = - [UIAlertController alertControllerWithTitle:title - message:message - preferredStyle:UIAlertControllerStyleActionSheet]; - - NSInteger index = 0; - for (NSString *option in buttons) { - UIAlertActionStyle style = UIAlertActionStyleDefault; - if (index == destructiveButtonIndex) { - style = UIAlertActionStyleDestructive; - } else if (index == cancelButtonIndex) { - style = UIAlertActionStyleCancel; - } - - NSInteger localIndex = index; - [alertController addAction:[UIAlertAction actionWithTitle:option - style:style - handler:^(__unused UIAlertAction *action){ - callback(@[@(localIndex)]); - }]]; - - index++; - } - - alertController.modalPresentationStyle = UIModalPresentationPopover; - alertController.popoverPresentationController.sourceView = sourceView; - alertController.popoverPresentationController.sourceRect = sourceRect; - if (!anchorViewTag) { - alertController.popoverPresentationController.permittedArrowDirections = 0; - } - [controller presentViewController:alertController animated:YES completion:nil]; - - alertController.view.tintColor = [RCTConvert UIColor:options[@"tintColor"]]; -} - -RCT_EXPORT_METHOD(showShareActionSheetWithOptions:(NSDictionary *)options - failureCallback:(RCTResponseErrorBlock)failureCallback - successCallback:(RCTResponseSenderBlock)successCallback) -{ - if (RCTRunningInAppExtension()) { - RCTLogError(@"Unable to show action sheet from app extension"); - return; - } - - NSMutableArray *items = [NSMutableArray array]; - NSString *message = [RCTConvert NSString:options[@"message"]]; - if (message) { - [items addObject:message]; - } - NSURL *URL = [RCTConvert NSURL:options[@"url"]]; - if (URL) { - if ([URL.scheme.lowercaseString isEqualToString:@"data"]) { - NSError *error; - NSData *data = [NSData dataWithContentsOfURL:URL - options:(NSDataReadingOptions)0 - error:&error]; - if (!data) { - failureCallback(error); - return; - } - [items addObject:data]; - } else { - [items addObject:URL]; - } - } - if (items.count == 0) { - RCTLogError(@"No `url` or `message` to share"); - return; - } - - UIActivityViewController *shareController = [[UIActivityViewController alloc] initWithActivityItems:items applicationActivities:nil]; - - NSString *subject = [RCTConvert NSString:options[@"subject"]]; - if (subject) { - [shareController setValue:subject forKey:@"subject"]; - } - - NSArray *excludedActivityTypes = [RCTConvert NSStringArray:options[@"excludedActivityTypes"]]; - if (excludedActivityTypes) { - shareController.excludedActivityTypes = excludedActivityTypes; - } - - UIViewController *controller = RCTPresentedViewController(); - shareController.completionWithItemsHandler = ^(NSString *activityType, BOOL completed, __unused NSArray *returnedItems, NSError *activityError) { - if (activityError) { - failureCallback(activityError); - } else { - successCallback(@[@(completed), RCTNullIfNil(activityType)]); - } - }; - - shareController.modalPresentationStyle = UIModalPresentationPopover; - NSNumber *anchorViewTag = [RCTConvert NSNumber:options[@"anchor"]]; - if (!anchorViewTag) { - shareController.popoverPresentationController.permittedArrowDirections = 0; - } - shareController.popoverPresentationController.sourceView = controller.view; - shareController.popoverPresentationController.sourceRect = [self sourceRectInView:controller.view anchorViewTag:anchorViewTag]; - - [controller presentViewController:shareController animated:YES completion:nil]; - - shareController.view.tintColor = [RCTConvert UIColor:options[@"tintColor"]]; -} - -#pragma mark UIActionSheetDelegate Methods - -- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex -{ - RCTResponseSenderBlock callback = [_callbacks objectForKey:actionSheet]; - if (callback) { - callback(@[@(buttonIndex)]); - [_callbacks removeObjectForKey:actionSheet]; - } else { - RCTLogWarn(@"No callback registered for action sheet: %@", actionSheet.title); - } -} - -@end diff --git a/docgen/Libraries/Alert/Alert.js b/docgen/Libraries/Alert/Alert.js deleted file mode 100644 index bd7d46f51be..00000000000 --- a/docgen/Libraries/Alert/Alert.js +++ /dev/null @@ -1,155 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule Alert - * @flow - */ -'use strict'; - -const AlertIOS = require('AlertIOS'); -const NativeModules = require('NativeModules'); -const Platform = require('Platform'); - -import type { AlertType, AlertButtonStyle } from 'AlertIOS'; - -type Buttons = Array<{ - text?: string, - onPress?: ?Function, - style?: AlertButtonStyle, -}>; - -type Options = { - cancelable?: ?boolean, - onDismiss?: ?Function, -}; - -/** - * Launches an alert dialog with the specified title and message. - * - * Optionally provide a list of buttons. Tapping any button will fire the - * respective onPress callback and dismiss the alert. By default, the only - * button will be an 'OK' button. - * - * This is an API that works both on iOS and Android and can show static - * alerts. To show an alert that prompts the user to enter some information, - * see `AlertIOS`; entering text in an alert is common on iOS only. - * - * ## iOS - * - * On iOS you can specify any number of buttons. Each button can optionally - * specify a style, which is one of 'default', 'cancel' or 'destructive'. - * - * ## Android - * - * On Android at most three buttons can be specified. Android has a concept - * of a neutral, negative and a positive button: - * - * - If you specify one button, it will be the 'positive' one (such as 'OK') - * - Two buttons mean 'negative', 'positive' (such as 'Cancel', 'OK') - * - Three buttons mean 'neutral', 'negative', 'positive' (such as 'Later', 'Cancel', 'OK') - * - * By default alerts on Android can be dismissed by tapping outside of the alert - * box. This event can be handled by providing an optional `options` parameter, - * with an `onDismiss` callback property `{ onDismiss: () => {} }`. - * - * Alternatively, the dismissing behavior can be disabled altogether by providing - * an optional `options` parameter with the `cancelable` property set to `false` - * i.e. `{ cancelable: false }` - * - * Example usage: - * ``` - * // Works on both iOS and Android - * Alert.alert( - * 'Alert Title', - * 'My Alert Msg', - * [ - * {text: 'Ask me later', onPress: () => console.log('Ask me later pressed')}, - * {text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'}, - * {text: 'OK', onPress: () => console.log('OK Pressed')}, - * ], - * { cancelable: false } - * ) - * ``` - */ -class Alert { - - static alert( - title: ?string, - message?: ?string, - buttons?: Buttons, - options?: Options, - type?: AlertType, - ): void { - if (Platform.OS === 'ios') { - if (typeof type !== 'undefined') { - console.warn('Alert.alert() with a 5th "type" parameter is deprecated and will be removed. Use AlertIOS.prompt() instead.'); - AlertIOS.alert(title, message, buttons, type); - return; - } - AlertIOS.alert(title, message, buttons); - } else if (Platform.OS === 'android') { - AlertAndroid.alert(title, message, buttons, options); - } - } -} - -/** - * Wrapper around the Android native module. - */ -class AlertAndroid { - - static alert( - title: ?string, - message?: ?string, - buttons?: Buttons, - options?: Options, - ): void { - var config = { - title: title || '', - message: message || '', - }; - - if (options) { - config = {...config, cancelable: options.cancelable}; - } - // At most three buttons (neutral, negative, positive). Ignore rest. - // The text 'OK' should be probably localized. iOS Alert does that in native. - var validButtons: Buttons = buttons ? buttons.slice(0, 3) : [{text: 'OK'}]; - var buttonPositive = validButtons.pop(); - var buttonNegative = validButtons.pop(); - var buttonNeutral = validButtons.pop(); - if (buttonNeutral) { - config = {...config, buttonNeutral: buttonNeutral.text || '' }; - } - if (buttonNegative) { - config = {...config, buttonNegative: buttonNegative.text || '' }; - } - if (buttonPositive) { - config = {...config, buttonPositive: buttonPositive.text || '' }; - } - NativeModules.DialogManagerAndroid.showAlert( - config, - (errorMessage) => console.warn(errorMessage), - (action, buttonKey) => { - if (action === NativeModules.DialogManagerAndroid.buttonClicked) { - if (buttonKey === NativeModules.DialogManagerAndroid.buttonNeutral) { - buttonNeutral.onPress && buttonNeutral.onPress(); - } else if (buttonKey === NativeModules.DialogManagerAndroid.buttonNegative) { - buttonNegative.onPress && buttonNegative.onPress(); - } else if (buttonKey === NativeModules.DialogManagerAndroid.buttonPositive) { - buttonPositive.onPress && buttonPositive.onPress(); - } - } else if (action === NativeModules.DialogManagerAndroid.dismissed) { - options && options.onDismiss && options.onDismiss(); - } - } - ); - } -} - -module.exports = Alert; diff --git a/docgen/Libraries/Alert/AlertIOS.js b/docgen/Libraries/Alert/AlertIOS.js deleted file mode 100644 index 4add7cfdab9..00000000000 --- a/docgen/Libraries/Alert/AlertIOS.js +++ /dev/null @@ -1,262 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule AlertIOS - * @flow - * @jsdoc - */ -'use strict'; - -var RCTAlertManager = require('NativeModules').AlertManager; - -/** - * An Alert button type - */ -export type AlertType = $Enum<{ - /** - * Default alert with no inputs - */ - 'default': string, - /** - * Plain text input alert - */ - 'plain-text': string, - /** - * Secure text input alert - */ - 'secure-text': string, - /** - * Login and password alert - */ - 'login-password': string, -}>; - -/** - * An Alert button style - */ -export type AlertButtonStyle = $Enum<{ - /** - * Default button style - */ - 'default': string, - /** - * Cancel button style - */ - 'cancel': string, - /** - * Destructive button style - */ - 'destructive': string, -}>; - -/** - * Array or buttons - * @typedef {Array} ButtonsArray - * @property {string=} text Button label - * @property {Function=} onPress Callback function when button pressed - * @property {AlertButtonStyle=} style Button style - */ -export type ButtonsArray = Array<{ - /** - * Button label - */ - text?: string, - /** - * Callback function when button pressed - */ - onPress?: ?Function, - /** - * Button style - */ - style?: AlertButtonStyle, -}>; - -/** - * @description - * `AlertIOS` provides functionality to create an iOS alert dialog with a - * message or create a prompt for user input. - * - * Creating an iOS alert: - * - * ``` - * AlertIOS.alert( - * 'Sync Complete', - * 'All your data are belong to us.' - * ); - * ``` - * - * Creating an iOS prompt: - * - * ``` - * AlertIOS.prompt( - * 'Enter a value', - * null, - * text => console.log("You entered "+text) - * ); - * ``` - * - * We recommend using the [`Alert.alert`](docs/alert.html) method for - * cross-platform support if you don't need to create iOS-only prompts. - * - */ -class AlertIOS { - /** - * Create and display a popup alert. - * @static - * @method alert - * @param title The dialog's title. - * - * An empty string hides the title. - * @param message An optional message that appears below - * the dialog's title. - * @param callbackOrButtons This optional argument should - * be either a single-argument function or an array of buttons. If passed - * a function, it will be called when the user taps 'OK'. - * - * If passed an array of button configurations, each button should include - * a `text` key, as well as optional `onPress` and `style` keys. `style` - * should be one of 'default', 'cancel' or 'destructive'. - * @param type Deprecated, do not use. - * - * @example Example with custom buttons - * - * AlertIOS.alert( - * 'Update available', - * 'Keep your app up to date to enjoy the latest features', - * [ - * {text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'}, - * {text: 'Install', onPress: () => console.log('Install Pressed')}, - * ], - * ); - */ - static alert( - title: ?string, - message?: ?string, - callbackOrButtons?: ?(() => void) | ButtonsArray, - type?: AlertType, - ): void { - if (typeof type !== 'undefined') { - console.warn('AlertIOS.alert() with a 4th "type" parameter is deprecated and will be removed. Use AlertIOS.prompt() instead.'); - this.prompt(title, message, callbackOrButtons, type); - return; - } - this.prompt(title, message, callbackOrButtons, 'default'); - } - - /** - * Create and display a prompt to enter some text. - * @static - * @method prompt - * @param title The dialog's title. - * @param message An optional message that appears above the text - * input. - * @param callbackOrButtons This optional argument should - * be either a single-argument function or an array of buttons. If passed - * a function, it will be called with the prompt's value when the user - * taps 'OK'. - * - * If passed an array of button configurations, each button should include - * a `text` key, as well as optional `onPress` and `style` keys (see - * example). `style` should be one of 'default', 'cancel' or 'destructive'. - * @param type This configures the text input. One of 'plain-text', - * 'secure-text' or 'login-password'. - * @param defaultValue The default text in text input. - * @param keyboardType The keyboard type of first text field(if exists). - * One of 'default', 'email-address', 'numeric', 'phone-pad', - * 'ascii-capable', 'numbers-and-punctuation', 'url', 'number-pad', - * 'name-phone-pad', 'decimal-pad', 'twitter' or 'web-search'. - * - * @example Example with custom buttons - * - * AlertIOS.prompt( - * 'Enter password', - * 'Enter your password to claim your $1.5B in lottery winnings', - * [ - * {text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'}, - * {text: 'OK', onPress: password => console.log('OK Pressed, password: ' + password)}, - * ], - * 'secure-text' - * ); - * - * @example Example with the default button and a custom callback - * - * AlertIOS.prompt( - * 'Update username', - * null, - * text => console.log("Your username is "+text), - * null, - * 'default' - * ); - */ - static prompt( - title: ?string, - message?: ?string, - callbackOrButtons?: ?((text: string) => void) | ButtonsArray, - type?: ?AlertType = 'plain-text', - defaultValue?: string, - keyboardType?: string - ): void { - if (typeof type === 'function') { - console.warn( - 'You passed a callback function as the "type" argument to AlertIOS.prompt(). React Native is ' + - 'assuming you want to use the deprecated AlertIOS.prompt(title, defaultValue, buttons, callback) ' + - 'signature. The current signature is AlertIOS.prompt(title, message, callbackOrButtons, type, defaultValue, ' + - 'keyboardType) and the old syntax will be removed in a future version.'); - - var callback = type; - var defaultValue = message; - RCTAlertManager.alertWithArgs({ - title: title, - type: 'plain-text', - defaultValue, - }, (id, value) => { - callback(value); - }); - return; - } - - var callbacks = []; - var buttons = []; - var cancelButtonKey; - var destructiveButtonKey; - if (typeof callbackOrButtons === 'function') { - callbacks = [callbackOrButtons]; - } - else if (callbackOrButtons instanceof Array) { - callbackOrButtons.forEach((btn, index) => { - callbacks[index] = btn.onPress; - if (btn.style === 'cancel') { - cancelButtonKey = String(index); - } else if (btn.style === 'destructive') { - destructiveButtonKey = String(index); - } - if (btn.text || index < (callbackOrButtons || []).length - 1) { - var btnDef = {}; - btnDef[index] = btn.text || ''; - buttons.push(btnDef); - } - }); - } - - RCTAlertManager.alertWithArgs({ - title: title, - message: message || undefined, - buttons, - type: type || undefined, - defaultValue, - cancelButtonKey, - destructiveButtonKey, - keyboardType, - }, (id, value) => { - var cb = callbacks[id]; - cb && cb(value); - }); - } -} - -module.exports = AlertIOS; diff --git a/docgen/Libraries/Alert/RCTAlertManager.android.js b/docgen/Libraries/Alert/RCTAlertManager.android.js deleted file mode 100644 index f8ad604e16d..00000000000 --- a/docgen/Libraries/Alert/RCTAlertManager.android.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule RCTAlertManager -*/ -'use strict'; - -var NativeModules = require('NativeModules'); - -function emptyCallback() {} - -module.exports = { - alertWithArgs: function(args, callback) { - // TODO(5998984): Polyfill it correctly with DialogManagerAndroid - NativeModules.DialogManagerAndroid.showAlert( - args, - emptyCallback, - callback || emptyCallback); - }, -}; diff --git a/docgen/Libraries/Alert/RCTAlertManager.ios.js b/docgen/Libraries/Alert/RCTAlertManager.ios.js deleted file mode 100644 index 409ecf5caf0..00000000000 --- a/docgen/Libraries/Alert/RCTAlertManager.ios.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule RCTAlertManager - * @flow - */ -'use strict'; - -var RCTAlertManager = require('NativeModules').AlertManager; - -module.exports = RCTAlertManager; diff --git a/docgen/Libraries/Animated/examples/demo.html b/docgen/Libraries/Animated/examples/demo.html deleted file mode 100644 index 4f95e114fa8..00000000000 --- a/docgen/Libraries/Animated/examples/demo.html +++ /dev/null @@ -1,712 +0,0 @@ - - - - - - Animated - - - - - - - - - - - -
- -

Animated

-

Animations have for a long time been a weak point of the React ecosystem. The Animated library aims at solving this problem. It embraces the declarative aspect of React and obtains performance by using raw DOM manipulation behind the scenes instead of the usual diff.

- -

Animated.Value

- -

The basic building block of this library is Animated.Value. This is a variable that's going to drive the animation. You use it like a normal value in style attribute. Only animated components such as Animated.div will understand it.

- - - -

setValue

- -

As you can see, the value is being used inside of render() as you would expect. However, you don't call setState() in order to update the value. Instead, you can call setValue() directly on the value itself. We are using a form of data binding.

- -

The Animated.div component when rendered tracks which animated values it received. This way, whenever that value changes, we don't need to re-render the entire component, we can directly update the specific style attribute that changed.

- - - -

Animated.timing

- -

Now that we understand how the system works, let's play with some animations! The hello world of animations is to move the element somewhere else. To do that, we're going to animate the value from the current value 0 to the value 400.

- -

On every frame (via requestAnimationFrame), the timing animation is going to figure out the new value based on the current time, update the animated value which in turn is going to update the corresponding DOM node.

- - - -

Interrupt Animations

- -

As a developer, the mental model is that most animations are fire and forget. When the user presses the button, you want it to shrink to 80% and when she releases, you want it to go back to 100%.

- -

There are multiple challenges to implement this correctly. You need to stop the current animation, grab the current value and restart an animation from there. As this is pretty tedious to do manually, Animated will do that automatically for you.

- - - -

Animated.spring

- -

Unfortunately, the timing animation doesn't feel good. The main reason is that no matter how far you are in the animation, it will trigger a new one with always the same duration.

- -

The commonly used solution for this problem is to use the equation of a real-world spring. Imagine that you attach a spring to the target value, stretch it to the current value and let it go. The spring movement is going to be the same as the update.

- -

It turns out that this model is useful in a very wide range of animations. I highly recommend you to always start with a spring animation instead of a timing animation. It will make your interface feels much better.

- - - -

interpolate

- -

It is very common to animate multiple attributes during the same animation. The usual way to implement it is to start a separate animation for each of the attribute. The downside is that you now have to manage a different state per attribute which is not ideal.

- -

With Animated, you can use a single state variable and render it in multiple attributes. When the value is updated, all the places will reflect the change.

- -

In the following example, we're going to model the animation with a variable where 1 means fully visible and 0 means fully hidden. We can pass it directly to the scale attribute as the ranges match. But for the rotation, we need to convert [0 ; 1] range to [260deg ; 0deg]. This is where interpolate() comes handy.

- - - -

stopAnimation

- -

The reason why we can get away with not calling render() and instead modify the DOM directly on updates is because the animated values are opaque. In render, you cannot know the current value, which prevents you from being able to modify the structure of the DOM.

- -

Animated can offload the animation to a different thread (CoreAnimation, CSS transitions, main thread...) and we don't have a good way to know the real value. If you try to query the value then modify it, you are going to be out of sync and the result will look terrible.

- -

There's however one exception: when you want to stop the current animation. You need to know where it stopped in order to continue from there. We cannot know the value synchronously so we give it via a callback in stopAnimation. It will not suffer from being out of sync since the animation is no longer running.

- - - - -

Gesture-based Animations

- -

Most animations libraries only deal with time-based animations. But, as we move to mobile, a lot of animations are also gesture driven. Even more problematic, they often switch between both modes: once the gesture is over, you start a time-based animation using the same interpolations.

- -

Animated has been designed with this use case in mind. The key aspect is that there are three distinct and separate concepts: inputs, value, output. The same value can be updated either from a time-based animation or a gesture-based one. Because we use this intermediate representation for the animation, we can keep the same rendering as output.

- -

HorizontalPan

- -

The code needed to drag elements around is very messy with the DOM APIs. On mousedown, you need to register a mousemove listener on window otherwise you may drop touches if you move too fast. removeEventListener takes the same arguments as addEventListener instead of an id like clearTimeout. It's also really easy to forget to remove a listener and have a leak. And finally, you need to store the current position and value at the beginning and update only compared to it.

- -

We introduce a little helper called HorizontalPan which handles all this annoying code for us. It takes an Animated.Value as first argument and returns the event handlers required for it to work. We just have to bind this value to the left attribute and we're good to go.

- - - -

Animated.decay

- -

One of the big breakthrough of the iPhone is the fact that when you release the finger while scrolling, it will not abruptly stop but instead keep going for some time.

- -

In order to implement this effect, we are using a second real-world simulation: an object moving on an icy surface. All it needs is two values: the current velocity and a deceleration coefficient. It is implemented by Animated.decay.

- - - -

Animation Chaining

- -

The target for an animation is usually a number but sometimes it is convenient to use another value as a target. This way, the first value will track the second. Using a spring animation, we can get a nice trailing effect.

- - - -

addListener

- -

As I said earlier, if you track a spring

- - - - -

Animated.sequence

- -

It is very common to animate

- - - - - - - - - - - - - -
- - diff --git a/docgen/Libraries/Animated/examples/pic1.jpg b/docgen/Libraries/Animated/examples/pic1.jpg deleted file mode 100644 index a9f2e824fe6903b452270e3c16a14ea6f908dee7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18446 zcmb@tb981+^CD`+mRkoj=aKYu&YO?frDs zuCCp?wYm%ad@g@(0}v%d#6Gq{qbm&$9s&=U>dl!u(gBk&T1d=r7i1VmAJZ_4HZ(;Ttfq{8J925$iwl zpS!@g;(~%Yvhp$_;!?r@psyMO!&(|xIRGO909MwH_VS_vgsN)lgb?drt-%6-0H^?5 zdIk=*{IarA|Fq%%nmjK4Z94!kNB6g^|EtLVGZWg-$id(%`|azeZD4Ef_|=t~Uo?!1 zqwQbX^ovH-xA=$l{7c(^Rq%@+^OrXHmoE56=3lz`9~nh?!7rKdFZzec|3T~jAM}5| z`y~PZF<}0S{{IC>BiFC`0{|id0Knfq{kQc0_SJuRAn0FJVEG!0g8%Yt@&EwNhcAB2 ze|h?;06il(XsK!2(WQTaM95TX$eWlDX6Haun6cF=_nb=D5)s_76JqT z0RasOjRFmgLWzxzP5J*BK6?R3kU&3xet-ao0YFGVz(_!!{Q#V=MnU{D&;HZOuK@-I z`Km9(S0)w^00ijoeEu)|lllLawF-a*`6>em80jkwoqLY{alBX4eZ{O_z}R|9#$E$@ z9xJrT|2s>dxOt+qXKa!8rFQCc)viEGtKfF#fLp}qei|*Ft-^S5H6O~YgYLj9;M%x8 z8BJ7wdRMElkPwPmj2V5pz+6`w_fg4tfYZp5zOU>#3XBj~Z1^lypJg1Q1Pd9z-9Qu0 zc4QbmW@k(uYw9-NyN4h_ob~MYGhCvHdp%cQcD|ODm!nzC*a8th9QzAU(Yl!9bi}>w z37A!Qh$GX@kak=n+kkT1)1>RJy)+xmdBB6;!eVAxZ%P#+cie9=5~HXo&Vc0XG1IX& zH`K^L#fS0_x#CV~*8y|bL#5T2+G%$Bu`R(Gy_M8| zRxbR<%dDPz?Z_L?&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6Ttd3m|(fY zG)4>WjNuJF#t|{O#N0MK{{Z08?WISkBxa$=Ir3=?1JfL)u!JR{a``qSgwh~PHe`mB zq8i<1*r@*i>l8Mc4T$MYt&w_y(>xCt7L&-={{ZmGLp{{IviA0A69EfRYwq^p*#DaW~*sxc79BP54SenS!*ud^7 z8z3hhiD*oZu(T8Rf(-11yo7f$c4@_*1oOn3{3w@M;N2Rt1t_xF2u@cuGYLjL){c{E z${LZ{nPDAQ*_CSsO;54TlO9(>i!4}4u)hBQK<3ZW*^S-9B@!B~kJ1;B{2LR>dNHJU z1Lz)6u5?K|ALb5aY;$vCR6vy;1&BKIS7)f~8Jh4eg$i*hVjVU(o(!9c8ha_REe4!p z)(G%Armq9QiHc?+2AUrD?CXV^+C**vu}Ms)fmAZR3RsSWHv%;CI~axi5gF4-wmYdw z`5gSzW+wU`Q)#DAzLK~g@WYrcMo(pR2b_tX!K}(D*z{y^Zxr zK8+2B5iKGqHzM$%P}>z^n2}(ULapG*tmvf0kzuWHz-CdkWX&1|>KJ98qT?u>$y6f< zNw_FAlR|%{i4bUGP-=}52?gYED@@+mTVW?pCBrx;g}`Z{DVA>pmJ&)~j1JBwE$kfa zv0=vENVPIqA7*z1%NIoKw}!=mxHUzQlr}*L>{?Vdcm4{ITVhl2&`p*h=J+sM=i-@sG&3Zz(sl5s)dryMdy tW5|bNGKuCSk{dF4@;ZlO!1>hBT&p~RJiZkLp@{Lrc^h span { - color: #333; - font-size: 13px; -} - -.example { - position: relative; - height: 60px; -} - -.code pre { - margin: 0; - font-size: 11px; - line-height: 1; -} - -.highlight { - background: rgb(228, 254, 253); -} diff --git a/docgen/Libraries/Animated/release/gulpfile.js b/docgen/Libraries/Animated/release/gulpfile.js deleted file mode 100644 index 3d2a52c4a40..00000000000 --- a/docgen/Libraries/Animated/release/gulpfile.js +++ /dev/null @@ -1,161 +0,0 @@ -/** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * @providesModule gulpfile - */ - -'use strict'; - -var babel = require('gulp-babel'); -var babelPluginDEV = require('fbjs-scripts/babel/dev-expression'); -var babelPluginModules = require('fbjs-scripts/babel/rewrite-modules'); -var del = require('del'); -var derequire = require('gulp-derequire'); -var flatten = require('gulp-flatten'); -var gulp = require('gulp'); -var gulpUtil = require('gulp-util'); -var header = require('gulp-header'); -var objectAssign = require('object-assign'); -var runSequence = require('run-sequence'); -var webpackStream = require('webpack-stream'); - -var DEVELOPMENT_HEADER = [ - '/**', - ' * Animated v<%= version %>', - ' */' -].join('\n') + '\n'; -var PRODUCTION_HEADER = [ - '/**', - ' * Animated v<%= version %>', - ' *', - ' * Copyright 2013-2015, Facebook, Inc.', - ' * All rights reserved.', - ' *', - ' * This source code is licensed under the BSD-style license found in the', - ' * LICENSE file in the root directory of this source tree. An additional grant', - ' * of patent rights can be found in the PATENTS file in the same directory.', - ' *', - ' */' -].join('\n') + '\n'; - -var babelOpts = { - nonStandard: true, - loose: [ - 'es6.classes' - ], - stage: 1, - plugins: [babelPluginDEV, babelPluginModules], - _moduleMap: objectAssign({}, require('fbjs/module-map'), { - 'React': 'react', - }) -}; - -var buildDist = function(opts) { - var webpackOpts = { - debug: opts.debug, - externals: { - 'react': 'React', - }, - module: { - loaders: [ - {test: /\.js$/, loader: 'babel'} - ], - }, - output: { - filename: opts.output, - library: 'Animated' - }, - plugins: [ - new webpackStream.webpack.DefinePlugin({ - 'process.env.NODE_ENV': JSON.stringify( - opts.debug ? 'development' : 'production' - ), - }), - new webpackStream.webpack.optimize.OccurenceOrderPlugin(), - new webpackStream.webpack.optimize.DedupePlugin() - ] - }; - if (!opts.debug) { - webpackOpts.plugins.push( - new webpackStream.webpack.optimize.UglifyJsPlugin({ - compress: { - hoist_vars: true, - screw_ie8: true, - warnings: false - } - }) - ); - } - return webpackStream(webpackOpts, null, function(err, stats) { - if (err) { - throw new gulpUtil.PluginError('webpack', err); - } - if (stats.compilation.errors.length) { - throw new gulpUtil.PluginError('webpack', stats.toString()); - } - }); -}; - -var paths = { - dist: 'dist', - entry: 'lib/AnimatedWeb.js', - lib: 'lib', - src: [ - '*src/**/*.js', - '!src/**/__tests__/**/*.js', - '!src/**/__mocks__/**/*.js' - ], -}; - -gulp.task('clean', function(cb) { - del([paths.dist, paths.lib], cb); -}); - -gulp.task('modules', function() { - return gulp - .src(paths.src, {cwd: '../'}) - .pipe(babel(babelOpts)) - .pipe(flatten()) - .pipe(gulp.dest(paths.lib)); -}); - -gulp.task('dist', ['modules'], function () { - var distOpts = { - debug: true, - output: 'animated.js' - }; - return gulp - .src(paths.entry) - .pipe(buildDist(distOpts)) - .pipe(derequire()) - .pipe(header(DEVELOPMENT_HEADER, { - version: process.env.npm_package_version - })) - .pipe(gulp.dest(paths.dist)); -}); - -gulp.task('dist:min', ['modules'], function () { - var distOpts = { - debug: false, - output: 'animated.min.js' - }; - return gulp - .src(paths.entry) - .pipe(buildDist(distOpts)) - .pipe(header(PRODUCTION_HEADER, { - version: process.env.npm_package_version - })) - .pipe(gulp.dest(paths.dist)); -}); - -gulp.task('watch', function() { - gulp.watch(paths.src, ['modules']); -}); - -gulp.task('default', function(cb) { - runSequence('clean', 'modules', ['dist', 'dist:min'], cb); -}); diff --git a/docgen/Libraries/Animated/release/package.json b/docgen/Libraries/Animated/release/package.json deleted file mode 100644 index 33654f7eae1..00000000000 --- a/docgen/Libraries/Animated/release/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "react-animated", - "description": "Animated provides powerful mechanisms for animating your React views", - "version": "0.1.0", - "keywords": [ - "react", - "animated", - "animation" - ], - "license": "BSD-3-Clause", - "main": "Animated.js", - "dependencies": { - "fbjs": "^0.2.1" - }, - "scripts": { - "build": "gulp" - }, - "devDependencies": { - "babel-core": "^5.8.25", - "babel-loader": "^5.3.2", - "del": "^1.2.0", - "fbjs-scripts": "^0.2.0", - "gulp": "^3.9.0", - "gulp-babel": "^5.1.0", - "gulp-derequire": "^2.1.0", - "gulp-flatten": "^0.1.0", - "gulp-header": "^1.2.2", - "gulp-util": "^3.0.6", - "object-assign": "^3.0.0", - "run-sequence": "^1.1.2", - "webpack": "1.11.0", - "webpack-stream": "^2.1.0" - } -} diff --git a/docgen/Libraries/Animated/src/Animated.js b/docgen/Libraries/Animated/src/Animated.js deleted file mode 100644 index 1eacd03c48c..00000000000 --- a/docgen/Libraries/Animated/src/Animated.js +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule Animated - * @flow - */ -'use strict'; - - -var AnimatedImplementation = require('AnimatedImplementation'); -var Image = require('Image'); -var Text = require('Text'); -var View = require('View'); - -let AnimatedScrollView; - -const Animated = { - View: AnimatedImplementation.createAnimatedComponent(View), - Text: AnimatedImplementation.createAnimatedComponent(Text), - Image: AnimatedImplementation.createAnimatedComponent(Image), - get ScrollView() { - // Make this lazy to avoid circular reference. - if (!AnimatedScrollView) { - AnimatedScrollView = AnimatedImplementation.createAnimatedComponent(require('ScrollView')); - } - return AnimatedScrollView; - }, -}; - -Object.assign((Animated: Object), AnimatedImplementation); - -module.exports = ((Animated: any): (typeof AnimatedImplementation) & typeof Animated); diff --git a/docgen/Libraries/Animated/src/AnimatedEvent.js b/docgen/Libraries/Animated/src/AnimatedEvent.js deleted file mode 100644 index 206516f5d96..00000000000 --- a/docgen/Libraries/Animated/src/AnimatedEvent.js +++ /dev/null @@ -1,196 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule AnimatedEvent - * @flow - * @format - */ -'use strict'; - -const AnimatedValue = require('./nodes/AnimatedValue'); -const NativeAnimatedHelper = require('./NativeAnimatedHelper'); -const ReactNative = require('ReactNative'); - -const invariant = require('fbjs/lib/invariant'); -const {shouldUseNativeDriver} = require('./NativeAnimatedHelper'); - -export type Mapping = {[key: string]: Mapping} | AnimatedValue; -export type EventConfig = { - listener?: ?Function, - useNativeDriver?: boolean, -}; - -function attachNativeEvent( - viewRef: any, - eventName: string, - argMapping: Array, -) { - // Find animated values in `argMapping` and create an array representing their - // key path inside the `nativeEvent` object. Ex.: ['contentOffset', 'x']. - const eventMappings = []; - - const traverse = (value, path) => { - if (value instanceof AnimatedValue) { - value.__makeNative(); - - eventMappings.push({ - nativeEventPath: path, - animatedValueTag: value.__getNativeTag(), - }); - } else if (typeof value === 'object') { - for (const key in value) { - traverse(value[key], path.concat(key)); - } - } - }; - - invariant( - argMapping[0] && argMapping[0].nativeEvent, - 'Native driven events only support animated values contained inside `nativeEvent`.', - ); - - // Assume that the event containing `nativeEvent` is always the first argument. - traverse(argMapping[0].nativeEvent, []); - - const viewTag = ReactNative.findNodeHandle(viewRef); - - eventMappings.forEach(mapping => { - NativeAnimatedHelper.API.addAnimatedEventToView( - viewTag, - eventName, - mapping, - ); - }); - - return { - detach() { - eventMappings.forEach(mapping => { - NativeAnimatedHelper.API.removeAnimatedEventFromView( - viewTag, - eventName, - mapping.animatedValueTag, - ); - }); - }, - }; -} - -class AnimatedEvent { - _argMapping: Array; - _listeners: Array = []; - _callListeners: Function; - _attachedEvent: ?{ - detach: () => void, - }; - __isNative: boolean; - - constructor(argMapping: Array, config?: EventConfig = {}) { - this._argMapping = argMapping; - if (config.listener) { - this.__addListener(config.listener); - } - this._callListeners = this._callListeners.bind(this); - this._attachedEvent = null; - this.__isNative = shouldUseNativeDriver(config); - - if (__DEV__) { - this._validateMapping(); - } - } - - __addListener(callback: Function): void { - this._listeners.push(callback); - } - - __removeListener(callback: Function): void { - this._listeners = this._listeners.filter(listener => listener !== callback); - } - - __attach(viewRef: any, eventName: string) { - invariant( - this.__isNative, - 'Only native driven events need to be attached.', - ); - - this._attachedEvent = attachNativeEvent( - viewRef, - eventName, - this._argMapping, - ); - } - - __detach(viewTag: any, eventName: string) { - invariant( - this.__isNative, - 'Only native driven events need to be detached.', - ); - - this._attachedEvent && this._attachedEvent.detach(); - } - - __getHandler() { - if (this.__isNative) { - return this._callListeners; - } - - return (...args: any) => { - const traverse = (recMapping, recEvt, key) => { - if (typeof recEvt === 'number' && recMapping instanceof AnimatedValue) { - recMapping.setValue(recEvt); - } else if (typeof recMapping === 'object') { - for (const mappingKey in recMapping) { - /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This - * comment suppresses an error when upgrading Flow's support for - * React. To see the error delete this comment and run Flow. */ - traverse(recMapping[mappingKey], recEvt[mappingKey], mappingKey); - } - } - }; - - if (!this.__isNative) { - this._argMapping.forEach((mapping, idx) => { - traverse(mapping, args[idx], 'arg' + idx); - }); - } - this._callListeners(...args); - }; - } - - _callListeners(...args) { - this._listeners.forEach(listener => listener(...args)); - } - - _validateMapping() { - const traverse = (recMapping, recEvt, key) => { - if (typeof recEvt === 'number') { - invariant( - recMapping instanceof AnimatedValue, - 'Bad mapping of type ' + - typeof recMapping + - ' for key ' + - key + - ', event value must map to AnimatedValue', - ); - return; - } - invariant( - typeof recMapping === 'object', - 'Bad mapping of type ' + typeof recMapping + ' for key ' + key, - ); - invariant( - typeof recEvt === 'object', - 'Bad event of type ' + typeof recEvt + ' for key ' + key, - ); - for (const mappingKey in recMapping) { - traverse(recMapping[mappingKey], recEvt[mappingKey], mappingKey); - } - }; - } -} - -module.exports = {AnimatedEvent, attachNativeEvent}; diff --git a/docgen/Libraries/Animated/src/AnimatedImplementation.js b/docgen/Libraries/Animated/src/AnimatedImplementation.js deleted file mode 100644 index 1c516dfd7f8..00000000000 --- a/docgen/Libraries/Animated/src/AnimatedImplementation.js +++ /dev/null @@ -1,840 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule AnimatedImplementation - * @flow - * @format - * @preventMunge - */ -'use strict'; - -const {AnimatedEvent, attachNativeEvent} = require('./AnimatedEvent'); -const AnimatedAddition = require('./nodes/AnimatedAddition'); -const AnimatedDiffClamp = require('./nodes/AnimatedDiffClamp'); -const AnimatedDivision = require('./nodes/AnimatedDivision'); -const AnimatedInterpolation = require('./nodes/AnimatedInterpolation'); -const AnimatedModulo = require('./nodes/AnimatedModulo'); -const AnimatedMultiplication = require('./nodes/AnimatedMultiplication'); -const AnimatedNode = require('./nodes/AnimatedNode'); -const AnimatedProps = require('./nodes/AnimatedProps'); -const AnimatedTracking = require('./nodes/AnimatedTracking'); -const AnimatedValue = require('./nodes/AnimatedValue'); -const AnimatedValueXY = require('./nodes/AnimatedValueXY'); -const DecayAnimation = require('./animations/DecayAnimation'); -const SpringAnimation = require('./animations/SpringAnimation'); -const TimingAnimation = require('./animations/TimingAnimation'); - -const createAnimatedComponent = require('./createAnimatedComponent'); - -import type { - AnimationConfig, - EndCallback, - EndResult, -} from './animations/Animation'; -import type {TimingAnimationConfig} from './animations/TimingAnimation'; -import type {DecayAnimationConfig} from './animations/DecayAnimation'; -import type {SpringAnimationConfig} from './animations/SpringAnimation'; -import type {Mapping, EventConfig} from './AnimatedEvent'; - -type CompositeAnimation = { - start: (callback?: ?EndCallback) => void, - stop: () => void, - reset: () => void, - _startNativeLoop: (iterations?: number) => void, - _isUsingNativeDriver: () => boolean, -}; - -const add = function( - a: AnimatedNode | number, - b: AnimatedNode | number, -): AnimatedAddition { - return new AnimatedAddition(a, b); -}; - -const divide = function( - a: AnimatedNode | number, - b: AnimatedNode | number, -): AnimatedDivision { - return new AnimatedDivision(a, b); -}; - -const multiply = function( - a: AnimatedNode | number, - b: AnimatedNode | number, -): AnimatedMultiplication { - return new AnimatedMultiplication(a, b); -}; - -const modulo = function(a: AnimatedNode, modulus: number): AnimatedModulo { - return new AnimatedModulo(a, modulus); -}; - -const diffClamp = function( - a: AnimatedNode, - min: number, - max: number, -): AnimatedDiffClamp { - return new AnimatedDiffClamp(a, min, max); -}; - -const _combineCallbacks = function( - callback: ?EndCallback, - config: AnimationConfig, -) { - if (callback && config.onComplete) { - return (...args) => { - config.onComplete && config.onComplete(...args); - callback && callback(...args); - }; - } else { - return callback || config.onComplete; - } -}; - -const maybeVectorAnim = function( - value: AnimatedValue | AnimatedValueXY, - config: Object, - anim: (value: AnimatedValue, config: Object) => CompositeAnimation, -): ?CompositeAnimation { - if (value instanceof AnimatedValueXY) { - const configX = {...config}; - const configY = {...config}; - for (const key in config) { - const {x, y} = config[key]; - if (x !== undefined && y !== undefined) { - configX[key] = x; - configY[key] = y; - } - } - const aX = anim((value: AnimatedValueXY).x, configX); - const aY = anim((value: AnimatedValueXY).y, configY); - // We use `stopTogether: false` here because otherwise tracking will break - // because the second animation will get stopped before it can update. - return parallel([aX, aY], {stopTogether: false}); - } - return null; -}; - -const spring = function( - value: AnimatedValue | AnimatedValueXY, - config: SpringAnimationConfig, -): CompositeAnimation { - const start = function( - animatedValue: AnimatedValue | AnimatedValueXY, - configuration: SpringAnimationConfig, - callback?: ?EndCallback, - ): void { - callback = _combineCallbacks(callback, configuration); - const singleValue: any = animatedValue; - const singleConfig: any = configuration; - singleValue.stopTracking(); - if (configuration.toValue instanceof AnimatedNode) { - singleValue.track( - new AnimatedTracking( - singleValue, - configuration.toValue, - SpringAnimation, - singleConfig, - callback, - ), - ); - } else { - singleValue.animate(new SpringAnimation(singleConfig), callback); - } - }; - return ( - maybeVectorAnim(value, config, spring) || { - start: function(callback?: ?EndCallback): void { - start(value, config, callback); - }, - - stop: function(): void { - value.stopAnimation(); - }, - - reset: function(): void { - value.resetAnimation(); - }, - - _startNativeLoop: function(iterations?: number): void { - const singleConfig = {...config, iterations}; - start(value, singleConfig); - }, - - _isUsingNativeDriver: function(): boolean { - return config.useNativeDriver || false; - }, - } - ); -}; - -const timing = function( - value: AnimatedValue | AnimatedValueXY, - config: TimingAnimationConfig, -): CompositeAnimation { - const start = function( - animatedValue: AnimatedValue | AnimatedValueXY, - configuration: TimingAnimationConfig, - callback?: ?EndCallback, - ): void { - callback = _combineCallbacks(callback, configuration); - const singleValue: any = animatedValue; - const singleConfig: any = configuration; - singleValue.stopTracking(); - if (configuration.toValue instanceof AnimatedNode) { - singleValue.track( - new AnimatedTracking( - singleValue, - configuration.toValue, - TimingAnimation, - singleConfig, - callback, - ), - ); - } else { - singleValue.animate(new TimingAnimation(singleConfig), callback); - } - }; - - return ( - maybeVectorAnim(value, config, timing) || { - start: function(callback?: ?EndCallback): void { - start(value, config, callback); - }, - - stop: function(): void { - value.stopAnimation(); - }, - - reset: function(): void { - value.resetAnimation(); - }, - - _startNativeLoop: function(iterations?: number): void { - const singleConfig = {...config, iterations}; - start(value, singleConfig); - }, - - _isUsingNativeDriver: function(): boolean { - return config.useNativeDriver || false; - }, - } - ); -}; - -const decay = function( - value: AnimatedValue | AnimatedValueXY, - config: DecayAnimationConfig, -): CompositeAnimation { - const start = function( - animatedValue: AnimatedValue | AnimatedValueXY, - configuration: DecayAnimationConfig, - callback?: ?EndCallback, - ): void { - callback = _combineCallbacks(callback, configuration); - const singleValue: any = animatedValue; - const singleConfig: any = configuration; - singleValue.stopTracking(); - singleValue.animate(new DecayAnimation(singleConfig), callback); - }; - - return ( - maybeVectorAnim(value, config, decay) || { - start: function(callback?: ?EndCallback): void { - start(value, config, callback); - }, - - stop: function(): void { - value.stopAnimation(); - }, - - reset: function(): void { - value.resetAnimation(); - }, - - _startNativeLoop: function(iterations?: number): void { - const singleConfig = {...config, iterations}; - start(value, singleConfig); - }, - - _isUsingNativeDriver: function(): boolean { - return config.useNativeDriver || false; - }, - } - ); -}; - -const sequence = function( - animations: Array, -): CompositeAnimation { - let current = 0; - return { - start: function(callback?: ?EndCallback) { - const onComplete = function(result) { - if (!result.finished) { - callback && callback(result); - return; - } - - current++; - - if (current === animations.length) { - callback && callback(result); - return; - } - - animations[current].start(onComplete); - }; - - if (animations.length === 0) { - callback && callback({finished: true}); - } else { - animations[current].start(onComplete); - } - }, - - stop: function() { - if (current < animations.length) { - animations[current].stop(); - } - }, - - reset: function() { - animations.forEach((animation, idx) => { - if (idx <= current) { - animation.reset(); - } - }); - current = 0; - }, - - _startNativeLoop: function() { - throw new Error( - 'Loops run using the native driver cannot contain Animated.sequence animations', - ); - }, - - _isUsingNativeDriver: function(): boolean { - return false; - }, - }; -}; - -type ParallelConfig = { - stopTogether?: boolean, // If one is stopped, stop all. default: true -}; -const parallel = function( - animations: Array, - config?: ?ParallelConfig, -): CompositeAnimation { - let doneCount = 0; - // Make sure we only call stop() at most once for each animation - const hasEnded = {}; - const stopTogether = !(config && config.stopTogether === false); - - const result = { - start: function(callback?: ?EndCallback) { - if (doneCount === animations.length) { - callback && callback({finished: true}); - return; - } - - animations.forEach((animation, idx) => { - const cb = function(endResult) { - hasEnded[idx] = true; - doneCount++; - if (doneCount === animations.length) { - doneCount = 0; - callback && callback(endResult); - return; - } - - if (!endResult.finished && stopTogether) { - result.stop(); - } - }; - - if (!animation) { - cb({finished: true}); - } else { - animation.start(cb); - } - }); - }, - - stop: function(): void { - animations.forEach((animation, idx) => { - !hasEnded[idx] && animation.stop(); - hasEnded[idx] = true; - }); - }, - - reset: function(): void { - animations.forEach((animation, idx) => { - animation.reset(); - hasEnded[idx] = false; - doneCount = 0; - }); - }, - - _startNativeLoop: function() { - throw new Error( - 'Loops run using the native driver cannot contain Animated.parallel animations', - ); - }, - - _isUsingNativeDriver: function(): boolean { - return false; - }, - }; - - return result; -}; - -const delay = function(time: number): CompositeAnimation { - // Would be nice to make a specialized implementation - return timing(new AnimatedValue(0), {toValue: 0, delay: time, duration: 0}); -}; - -const stagger = function( - time: number, - animations: Array, -): CompositeAnimation { - return parallel( - animations.map((animation, i) => { - return sequence([delay(time * i), animation]); - }), - ); -}; - -type LoopAnimationConfig = {iterations: number}; - -const loop = function( - animation: CompositeAnimation, - {iterations = -1}: LoopAnimationConfig = {}, -): CompositeAnimation { - let isFinished = false; - let iterationsSoFar = 0; - return { - start: function(callback?: ?EndCallback) { - const restart = function(result: EndResult = {finished: true}): void { - if ( - isFinished || - iterationsSoFar === iterations || - result.finished === false - ) { - callback && callback(result); - } else { - iterationsSoFar++; - animation.reset(); - animation.start(restart); - } - }; - if (!animation || iterations === 0) { - callback && callback({finished: true}); - } else { - if (animation._isUsingNativeDriver()) { - animation._startNativeLoop(iterations); - } else { - restart(); // Start looping recursively on the js thread - } - } - }, - - stop: function(): void { - isFinished = true; - animation.stop(); - }, - - reset: function(): void { - iterationsSoFar = 0; - isFinished = false; - animation.reset(); - }, - - _startNativeLoop: function() { - throw new Error( - 'Loops run using the native driver cannot contain Animated.loop animations', - ); - }, - - _isUsingNativeDriver: function(): boolean { - return animation._isUsingNativeDriver(); - }, - }; -}; - -function forkEvent( - event: ?AnimatedEvent | ?Function, - listener: Function, -): AnimatedEvent | Function { - if (!event) { - return listener; - } else if (event instanceof AnimatedEvent) { - event.__addListener(listener); - return event; - } else { - return (...args) => { - typeof event === 'function' && event(...args); - listener(...args); - }; - } -} - -function unforkEvent( - event: ?AnimatedEvent | ?Function, - listener: Function, -): void { - if (event && event instanceof AnimatedEvent) { - event.__removeListener(listener); - } -} - -const event = function(argMapping: Array, config?: EventConfig): any { - const animatedEvent = new AnimatedEvent(argMapping, config); - if (animatedEvent.__isNative) { - return animatedEvent; - } else { - return animatedEvent.__getHandler(); - } -}; - -/** - * The `Animated` library is designed to make animations fluid, powerful, and - * easy to build and maintain. `Animated` focuses on declarative relationships - * between inputs and outputs, with configurable transforms in between, and - * simple `start`/`stop` methods to control time-based animation execution. - * - * The simplest workflow for creating an animation is to create an - * `Animated.Value`, hook it up to one or more style attributes of an animated - * component, and then drive updates via animations using `Animated.timing()`: - * - * ```javascript - * Animated.timing( // Animate value over time - * this.state.fadeAnim, // The value to drive - * { - * toValue: 1, // Animate to final value of 1 - * } - * ).start(); // Start the animation - * ``` - * - * Refer to the [Animations](docs/animations.html#animated-api) guide to see - * additional examples of `Animated` in action. - * - * ## Overview - * - * There are two value types you can use with `Animated`: - * - * - [`Animated.Value()`](docs/animated.html#value) for single values - * - [`Animated.ValueXY()`](docs/animated.html#valuexy) for vectors - * - * `Animated.Value` can bind to style properties or other props, and can be - * interpolated as well. A single `Animated.Value` can drive any number of - * properties. - * - * ### Configuring animations - * - * `Animated` provides three types of animation types. Each animation type - * provides a particular animation curve that controls how your values animate - * from their initial value to the final value: - * - * - [`Animated.decay()`](docs/animated.html#decay) starts with an initial - * velocity and gradually slows to a stop. - * - [`Animated.spring()`](docs/animated.html#spring) provides a simple - * spring physics model. - * - [`Animated.timing()`](docs/animated.html#timing) animates a value over time - * using [easing functions](docs/easing.html). - * - * In most cases, you will be using `timing()`. By default, it uses a symmetric - * easeInOut curve that conveys the gradual acceleration of an object to full - * speed and concludes by gradually decelerating to a stop. - * - * ### Working with animations - * - * Animations are started by calling `start()` on your animation. `start()` - * takes a completion callback that will be called when the animation is done. - * If the animation finished running normally, the completion callback will be - * invoked with `{finished: true}`. If the animation is done because `stop()` - * was called on it before it could finish (e.g. because it was interrupted by a - * gesture or another animation), then it will receive `{finished: false}`. - * - * ### Using the native driver - * - * By using the native driver, we send everything about the animation to native - * before starting the animation, allowing native code to perform the animation - * on the UI thread without having to go through the bridge on every frame. - * Once the animation has started, the JS thread can be blocked without - * affecting the animation. - * - * You can use the native driver by specifying `useNativeDriver: true` in your - * animation configuration. See the - * [Animations](docs/animations.html#using-the-native-driver) guide to learn - * more. - * - * ### Animatable components - * - * Only animatable components can be animated. These special components do the - * magic of binding the animated values to the properties, and do targeted - * native updates to avoid the cost of the react render and reconciliation - * process on every frame. They also handle cleanup on unmount so they are safe - * by default. - * - * - [`createAnimatedComponent()`](docs/animated.html#createanimatedcomponent) - * can be used to make a component animatable. - * - * `Animated` exports the following animatable components using the above - * wrapper: - * - * - `Animated.Image` - * - `Animated.ScrollView` - * - `Animated.Text` - * - `Animated.View` - * - * ### Composing animations - * - * Animations can also be combined in complex ways using composition functions: - * - * - [`Animated.delay()`](docs/animated.html#delay) starts an animation after - * a given delay. - * - [`Animated.parallel()`](docs/animated.html#parallel) starts a number of - * animations at the same time. - * - [`Animated.sequence()`](docs/animated.html#sequence) starts the animations - * in order, waiting for each to complete before starting the next. - * - [`Animated.stagger()`](docs/animated.html#stagger) starts animations in - * order and in parallel, but with successive delays. - * - * Animations can also be chained together simply by setting the `toValue` of - * one animation to be another `Animated.Value`. See - * [Tracking dynamic values](docs/animations.html#tracking-dynamic-values) in - * the Animations guide. - * - * By default, if one animation is stopped or interrupted, then all other - * animations in the group are also stopped. - * - * ### Combining animated values - * - * You can combine two animated values via addition, multiplication, division, - * or modulo to make a new animated value: - * - * - [`Animated.add()`](docs/animated.html#add) - * - [`Animated.divide()`](docs/animated.html#divide) - * - [`Animated.modulo()`](docs/animated.html#modulo) - * - [`Animated.multiply()`](docs/animated.html#multiply) - * - * ### Interpolation - * - * The `interpolate()` function allows input ranges to map to different output - * ranges. By default, it will extrapolate the curve beyond the ranges given, - * but you can also have it clamp the output value. It uses lineal interpolation - * by default but also supports easing functions. - * - * - [`interpolate()`](docs/animated.html#interpolate) - * - * Read more about interpolation in the - * [Animation](docs/animations.html#interpolation) guide. - * - * ### Handling gestures and other events - * - * Gestures, like panning or scrolling, and other events can map directly to - * animated values using `Animated.event()`. This is done with a structured map - * syntax so that values can be extracted from complex event objects. The first - * level is an array to allow mapping across multiple args, and that array - * contains nested objects. - * - * - [`Animated.event()`](docs/animated.html#event) - * - * For example, when working with horizontal scrolling gestures, you would do - * the following in order to map `event.nativeEvent.contentOffset.x` to - * `scrollX` (an `Animated.Value`): - * - * ```javascript - * onScroll={Animated.event( - * // scrollX = e.nativeEvent.contentOffset.x - * [{ nativeEvent: { - * contentOffset: { - * x: scrollX - * } - * } - * }] - * )} - * ``` - * - */ -module.exports = { - /** - * Standard value class for driving animations. Typically initialized with - * `new Animated.Value(0);` - * - * See also [`AnimatedValue`](docs/animated.html#animatedvalue). - */ - Value: AnimatedValue, - /** - * 2D value class for driving 2D animations, such as pan gestures. - * - * See also [`AnimatedValueXY`](docs/animated.html#animatedvaluexy). - */ - ValueXY: AnimatedValueXY, - /** - * exported to use the Interpolation type in flow - * - * See also [`AnimatedInterpolation`](docs/animated.html#animatedinterpolation). - */ - Interpolation: AnimatedInterpolation, - /** - * Exported for ease of type checking. All animated values derive from this class. - */ - Node: AnimatedNode, - - /** - * Animates a value from an initial velocity to zero based on a decay - * coefficient. - * - * Config is an object that may have the following options: - * - * - `velocity`: Initial velocity. Required. - * - `deceleration`: Rate of decay. Default 0.997. - * - `useNativeDriver`: Uses the native driver when true. Default false. - */ - decay, - /** - * Animates a value along a timed easing curve. The - * [`Easing`](docs/easing.html) module has tons of predefined curves, or you - * can use your own function. - * - * Config is an object that may have the following options: - * - * - `duration`: Length of animation (milliseconds). Default 500. - * - `easing`: Easing function to define curve. - * Default is `Easing.inOut(Easing.ease)`. - * - `delay`: Start the animation after delay (milliseconds). Default 0. - * - `useNativeDriver`: Uses the native driver when true. Default false. - */ - timing, - /** - * Spring animation based on Rebound and - * [Origami](https://facebook.github.io/origami/). Tracks velocity state to - * create fluid motions as the `toValue` updates, and can be chained together. - * - * Config is an object that may have the following options. Note that you can - * only define bounciness/speed or tension/friction but not both: - * - * - `friction`: Controls "bounciness"/overshoot. Default 7. - * - `tension`: Controls speed. Default 40. - * - `speed`: Controls speed of the animation. Default 12. - * - `bounciness`: Controls bounciness. Default 8. - * - `useNativeDriver`: Uses the native driver when true. Default false. - */ - spring, - - /** - * Creates a new Animated value composed from two Animated values added - * together. - */ - add, - - /** - * Creates a new Animated value composed by dividing the first Animated value - * by the second Animated value. - */ - divide, - - /** - * Creates a new Animated value composed from two Animated values multiplied - * together. - */ - multiply, - - /** - * Creates a new Animated value that is the (non-negative) modulo of the - * provided Animated value - */ - modulo, - - /** - * Create a new Animated value that is limited between 2 values. It uses the - * difference between the last value so even if the value is far from the bounds - * it will start changing when the value starts getting closer again. - * (`value = clamp(value + diff, min, max)`). - * - * This is useful with scroll events, for example, to show the navbar when - * scrolling up and to hide it when scrolling down. - */ - diffClamp, - - /** - * Starts an animation after the given delay. - */ - delay, - /** - * Starts an array of animations in order, waiting for each to complete - * before starting the next. If the current running animation is stopped, no - * following animations will be started. - */ - sequence, - /** - * Starts an array of animations all at the same time. By default, if one - * of the animations is stopped, they will all be stopped. You can override - * this with the `stopTogether` flag. - */ - parallel, - /** - * Array of animations may run in parallel (overlap), but are started in - * sequence with successive delays. Nice for doing trailing effects. - */ - stagger, - /** - * Loops a given animation continuously, so that each time it reaches the - * end, it resets and begins again from the start. Can specify number of - * times to loop using the key 'iterations' in the config. Will loop without - * blocking the UI thread if the child animation is set to 'useNativeDriver'. - */ - loop, - - /** - * Takes an array of mappings and extracts values from each arg accordingly, - * then calls `setValue` on the mapped outputs. e.g. - * - *```javascript - * onScroll={Animated.event( - * [{nativeEvent: {contentOffset: {x: this._scrollX}}}], - * {listener}, // Optional async listener - * )} - * ... - * onPanResponderMove: Animated.event([ - * null, // raw event arg ignored - * {dx: this._panX}, // gestureState arg - * ]), - *``` - * - * Config is an object that may have the following options: - * - * - `listener`: Optional async listener. - * - `useNativeDriver`: Uses the native driver when true. Default false. - */ - event, - - /** - * Make any React component Animatable. Used to create `Animated.View`, etc. - */ - createAnimatedComponent, - - /** - * Imperative API to attach an animated value to an event on a view. Prefer using - * `Animated.event` with `useNativeDrive: true` if possible. - */ - attachNativeEvent, - - /** - * Advanced imperative API for snooping on animated events that are passed in through props. Use - * values directly where possible. - */ - forkEvent, - unforkEvent, - - __PropsOnlyForTests: AnimatedProps, -}; diff --git a/docgen/Libraries/Animated/src/AnimatedWeb.js b/docgen/Libraries/Animated/src/AnimatedWeb.js deleted file mode 100644 index b88acb940bd..00000000000 --- a/docgen/Libraries/Animated/src/AnimatedWeb.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @flow - * @providesModule AnimatedWeb - */ -'use strict'; - -var AnimatedImplementation = require('AnimatedImplementation'); - -module.exports = { - ...AnimatedImplementation, - div: AnimatedImplementation.createAnimatedComponent('div'), - span: AnimatedImplementation.createAnimatedComponent('span'), - img: AnimatedImplementation.createAnimatedComponent('img'), -}; diff --git a/docgen/Libraries/Animated/src/Easing.js b/docgen/Libraries/Animated/src/Easing.js deleted file mode 100644 index 03c40917597..00000000000 --- a/docgen/Libraries/Animated/src/Easing.js +++ /dev/null @@ -1,267 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule Easing - * @flow - */ -'use strict'; - -let ease; - -/** - * The `Easing` module implements common easing functions. This module is used - * by [Animate.timing()](docs/animate.html#timing) to convey physically - * believable motion in animations. - * - * You can find a visualization of some common easing functions at - * http://easings.net/ - * - * ### Predefined animations - * - * The `Easing` module provides several predefined animations through the - * following methods: - * - * - [`back`](docs/easing.html#back) provides a simple animation where the - * object goes slightly back before moving forward - * - [`bounce`](docs/easing.html#bounce) provides a bouncing animation - * - [`ease`](docs/easing.html#ease) provides a simple inertial animation - * - [`elastic`](docs/easing.html#elastic) provides a simple spring interaction - * - * ### Standard functions - * - * Three standard easing functions are provided: - * - * - [`linear`](docs/easing.html#linear) - * - [`quad`](docs/easing.html#quad) - * - [`cubic`](docs/easing.html#cubic) - * - * The [`poly`](docs/easing.html#poly) function can be used to implement - * quartic, quintic, and other higher power functions. - * - * ### Additional functions - * - * Additional mathematical functions are provided by the following methods: - * - * - [`bezier`](docs/easing.html#bezier) provides a cubic bezier curve - * - [`circle`](docs/easing.html#circle) provides a circular function - * - [`sin`](docs/easing.html#sin) provides a sinusoidal function - * - [`exp`](docs/easing.html#exp) provides an exponential function - * - * The following helpers are used to modify other easing functions. - * - * - [`in`](docs/easing.html#in) runs an easing function forwards - * - [`inOut`](docs/easing.html#inout) makes any easing function symmetrical - * - [`out`](docs/easing.html#out) runs an easing function backwards - */ -class Easing { - /** - * A stepping function, returns 1 for any positive value of `n`. - */ - static step0(n) { - return n > 0 ? 1 : 0; - } - - /** - * A stepping function, returns 1 if `n` is greater than or equal to 1. - */ - static step1(n) { - return n >= 1 ? 1 : 0; - } - - /** - * A linear function, `f(t) = t`. Position correlates to elapsed time one to - * one. - * - * http://cubic-bezier.com/#0,0,1,1 - */ - static linear(t) { - return t; - } - - /** - * A simple inertial interaction, similar to an object slowly accelerating to - * speed. - * - * http://cubic-bezier.com/#.42,0,1,1 - */ - static ease(t: number): number { - if (!ease) { - ease = Easing.bezier(0.42, 0, 1, 1); - } - return ease(t); - } - - /** - * A quadratic function, `f(t) = t * t`. Position equals the square of elapsed - * time. - * - * http://easings.net/#easeInQuad - */ - static quad(t) { - return t * t; - } - - /** - * A cubic function, `f(t) = t * t * t`. Position equals the cube of elapsed - * time. - * - * http://easings.net/#easeInCubic - */ - static cubic(t) { - return t * t * t; - } - - /** - * A power function. Position is equal to the Nth power of elapsed time. - * - * n = 4: http://easings.net/#easeInQuart - * n = 5: http://easings.net/#easeInQuint - */ - static poly(n) { - return (t) => Math.pow(t, n); - } - - /** - * A sinusoidal function. - * - * http://easings.net/#easeInSine - */ - static sin(t) { - return 1 - Math.cos(t * Math.PI / 2); - } - - /** - * A circular function. - * - * http://easings.net/#easeInCirc - */ - static circle(t) { - return 1 - Math.sqrt(1 - t * t); - } - - /** - * An exponential function. - * - * http://easings.net/#easeInExpo - */ - static exp(t) { - return Math.pow(2, 10 * (t - 1)); - } - - /** - * A simple elastic interaction, similar to a spring oscillating back and - * forth. - * - * Default bounciness is 1, which overshoots a little bit once. 0 bounciness - * doesn't overshoot at all, and bounciness of N > 1 will overshoot about N - * times. - * - * http://easings.net/#easeInElastic - * - * Wolfram Plots: - * - * - http://tiny.cc/elastic_b_1 (bounciness = 1, default) - * - http://tiny.cc/elastic_b_3 (bounciness = 3) - */ - static elastic(bounciness: number = 1): (t: number) => number { - const p = bounciness * Math.PI; - return (t) => 1 - Math.pow(Math.cos(t * Math.PI / 2), 3) * Math.cos(t * p); - } - - /** - * Use with `Animated.parallel()` to create a simple effect where the object - * animates back slightly as the animation starts. - * - * Wolfram Plot: - * - * - http://tiny.cc/back_default (s = 1.70158, default) - */ - static back(s: number): (t: number) => number { - if (s === undefined) { - s = 1.70158; - } - return (t) => t * t * ((s + 1) * t - s); - } - - /** - * Provides a simple bouncing effect. - * - * http://easings.net/#easeInBounce - */ - static bounce(t: number): number { - if (t < 1 / 2.75) { - return 7.5625 * t * t; - } - - if (t < 2 / 2.75) { - t -= 1.5 / 2.75; - return 7.5625 * t * t + 0.75; - } - - if (t < 2.5 / 2.75) { - t -= 2.25 / 2.75; - return 7.5625 * t * t + 0.9375; - } - - t -= 2.625 / 2.75; - return 7.5625 * t * t + 0.984375; - } - - /** - * Provides a cubic bezier curve, equivalent to CSS Transitions' - * `transition-timing-function`. - * - * A useful tool to visualize cubic bezier curves can be found at - * http://cubic-bezier.com/ - */ - static bezier( - x1: number, - y1: number, - x2: number, - y2: number - ): (t: number) => number { - const _bezier = require('bezier'); - return _bezier(x1, y1, x2, y2); - } - - /** - * Runs an easing function forwards. - */ - static in( - easing: (t: number) => number, - ): (t: number) => number { - return easing; - } - - /** - * Runs an easing function backwards. - */ - static out( - easing: (t: number) => number, - ): (t: number) => number { - return (t) => 1 - easing(1 - t); - } - - /** - * Makes any easing function symmetrical. The easing function will run - * forwards for half of the duration, then backwards for the rest of the - * duration. - */ - static inOut( - easing: (t: number) => number, - ): (t: number) => number { - return (t) => { - if (t < 0.5) { - return easing(t * 2) / 2; - } - return 1 - easing((1 - t) * 2) / 2; - }; - } -} - -module.exports = Easing; diff --git a/docgen/Libraries/Animated/src/NativeAnimatedHelper.js b/docgen/Libraries/Animated/src/NativeAnimatedHelper.js deleted file mode 100644 index cc25a4b9ceb..00000000000 --- a/docgen/Libraries/Animated/src/NativeAnimatedHelper.js +++ /dev/null @@ -1,253 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule NativeAnimatedHelper - * @flow - * @format - */ -'use strict'; - -const NativeAnimatedModule = require('NativeModules').NativeAnimatedModule; -const NativeEventEmitter = require('NativeEventEmitter'); - -const invariant = require('fbjs/lib/invariant'); - -import type {AnimationConfig} from './animations/Animation'; -import type {EventConfig} from './AnimatedEvent'; - -let __nativeAnimatedNodeTagCount = 1; /* used for animated nodes */ -let __nativeAnimationIdCount = 1; /* used for started animations */ - -type EndResult = {finished: boolean}; -type EndCallback = (result: EndResult) => void; -type EventMapping = { - nativeEventPath: Array, - animatedValueTag: ?number, -}; - -let nativeEventEmitter; - -/** - * Simple wrappers around NativeAnimatedModule to provide flow and autocmplete support for - * the native module methods - */ -const API = { - createAnimatedNode: function(tag: ?number, config: Object): void { - assertNativeAnimatedModule(); - NativeAnimatedModule.createAnimatedNode(tag, config); - }, - startListeningToAnimatedNodeValue: function(tag: ?number) { - assertNativeAnimatedModule(); - NativeAnimatedModule.startListeningToAnimatedNodeValue(tag); - }, - stopListeningToAnimatedNodeValue: function(tag: ?number) { - assertNativeAnimatedModule(); - NativeAnimatedModule.stopListeningToAnimatedNodeValue(tag); - }, - connectAnimatedNodes: function(parentTag: ?number, childTag: ?number): void { - assertNativeAnimatedModule(); - NativeAnimatedModule.connectAnimatedNodes(parentTag, childTag); - }, - disconnectAnimatedNodes: function( - parentTag: ?number, - childTag: ?number, - ): void { - assertNativeAnimatedModule(); - NativeAnimatedModule.disconnectAnimatedNodes(parentTag, childTag); - }, - startAnimatingNode: function( - animationId: ?number, - nodeTag: ?number, - config: Object, - endCallback: EndCallback, - ): void { - assertNativeAnimatedModule(); - NativeAnimatedModule.startAnimatingNode( - animationId, - nodeTag, - config, - endCallback, - ); - }, - stopAnimation: function(animationId: ?number) { - assertNativeAnimatedModule(); - NativeAnimatedModule.stopAnimation(animationId); - }, - setAnimatedNodeValue: function(nodeTag: ?number, value: ?number): void { - assertNativeAnimatedModule(); - NativeAnimatedModule.setAnimatedNodeValue(nodeTag, value); - }, - setAnimatedNodeOffset: function(nodeTag: ?number, offset: ?number): void { - assertNativeAnimatedModule(); - NativeAnimatedModule.setAnimatedNodeOffset(nodeTag, offset); - }, - flattenAnimatedNodeOffset: function(nodeTag: ?number): void { - assertNativeAnimatedModule(); - NativeAnimatedModule.flattenAnimatedNodeOffset(nodeTag); - }, - extractAnimatedNodeOffset: function(nodeTag: ?number): void { - assertNativeAnimatedModule(); - NativeAnimatedModule.extractAnimatedNodeOffset(nodeTag); - }, - connectAnimatedNodeToView: function( - nodeTag: ?number, - viewTag: ?number, - ): void { - assertNativeAnimatedModule(); - NativeAnimatedModule.connectAnimatedNodeToView(nodeTag, viewTag); - }, - disconnectAnimatedNodeFromView: function( - nodeTag: ?number, - viewTag: ?number, - ): void { - assertNativeAnimatedModule(); - NativeAnimatedModule.disconnectAnimatedNodeFromView(nodeTag, viewTag); - }, - dropAnimatedNode: function(tag: ?number): void { - assertNativeAnimatedModule(); - NativeAnimatedModule.dropAnimatedNode(tag); - }, - addAnimatedEventToView: function( - viewTag: ?number, - eventName: string, - eventMapping: EventMapping, - ) { - assertNativeAnimatedModule(); - NativeAnimatedModule.addAnimatedEventToView( - viewTag, - eventName, - eventMapping, - ); - }, - removeAnimatedEventFromView( - viewTag: ?number, - eventName: string, - animatedNodeTag: ?number, - ) { - assertNativeAnimatedModule(); - NativeAnimatedModule.removeAnimatedEventFromView( - viewTag, - eventName, - animatedNodeTag, - ); - }, -}; - -/** - * Styles allowed by the native animated implementation. - * - * In general native animated implementation should support any numeric property that doesn't need - * to be updated through the shadow view hierarchy (all non-layout properties). - */ -const STYLES_WHITELIST = { - opacity: true, - transform: true, - /* legacy android transform properties */ - scaleX: true, - scaleY: true, - translateX: true, - translateY: true, -}; - -const TRANSFORM_WHITELIST = { - translateX: true, - translateY: true, - scale: true, - scaleX: true, - scaleY: true, - rotate: true, - rotateX: true, - rotateY: true, - perspective: true, -}; - -function validateTransform(configs: Array): void { - configs.forEach(config => { - if (!TRANSFORM_WHITELIST.hasOwnProperty(config.property)) { - throw new Error( - `Property '${config.property}' is not supported by native animated module`, - ); - } - }); -} - -function validateStyles(styles: Object): void { - for (var key in styles) { - if (!STYLES_WHITELIST.hasOwnProperty(key)) { - throw new Error( - `Style property '${key}' is not supported by native animated module`, - ); - } - } -} - -function validateInterpolation(config: Object): void { - var SUPPORTED_INTERPOLATION_PARAMS = { - inputRange: true, - outputRange: true, - extrapolate: true, - extrapolateRight: true, - extrapolateLeft: true, - }; - for (var key in config) { - if (!SUPPORTED_INTERPOLATION_PARAMS.hasOwnProperty(key)) { - throw new Error( - `Interpolation property '${key}' is not supported by native animated module`, - ); - } - } -} - -function generateNewNodeTag(): number { - return __nativeAnimatedNodeTagCount++; -} - -function generateNewAnimationId(): number { - return __nativeAnimationIdCount++; -} - -function assertNativeAnimatedModule(): void { - invariant(NativeAnimatedModule, 'Native animated module is not available'); -} - -let _warnedMissingNativeAnimated = false; - -function shouldUseNativeDriver(config: AnimationConfig | EventConfig): boolean { - if (config.useNativeDriver && !NativeAnimatedModule) { - if (!_warnedMissingNativeAnimated) { - console.warn( - 'Animated: `useNativeDriver` is not supported because the native ' + - 'animated module is missing. Falling back to JS-based animation. To ' + - 'resolve this, add `RCTAnimation` module to this app, or remove ' + - '`useNativeDriver`. ' + - 'More info: https://github.com/facebook/react-native/issues/11094#issuecomment-263240420', - ); - _warnedMissingNativeAnimated = true; - } - return false; - } - - return config.useNativeDriver || false; -} - -module.exports = { - API, - validateStyles, - validateTransform, - validateInterpolation, - generateNewNodeTag, - generateNewAnimationId, - assertNativeAnimatedModule, - shouldUseNativeDriver, - get nativeEventEmitter() { - if (!nativeEventEmitter) { - nativeEventEmitter = new NativeEventEmitter(NativeAnimatedModule); - } - return nativeEventEmitter; - }, -}; diff --git a/docgen/Libraries/Animated/src/SpringConfig.js b/docgen/Libraries/Animated/src/SpringConfig.js deleted file mode 100644 index d10abced287..00000000000 --- a/docgen/Libraries/Animated/src/SpringConfig.js +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule SpringConfig - * @flow - */ - -'use strict'; - -type SpringConfigType = { - tension: number, - friction: number, -}; - -function tensionFromOrigamiValue(oValue) { - return (oValue - 30) * 3.62 + 194; -} - -function frictionFromOrigamiValue(oValue) { - return (oValue - 8) * 3 + 25; -} - -function fromOrigamiTensionAndFriction( - tension: number, - friction: number, -): SpringConfigType { - return { - tension: tensionFromOrigamiValue(tension), - friction: frictionFromOrigamiValue(friction) - }; -} - -function fromBouncinessAndSpeed( - bounciness: number, - speed: number, -): SpringConfigType { - function normalize(value, startValue, endValue) { - return (value - startValue) / (endValue - startValue); - } - - function projectNormal(n, start, end) { - return start + (n * (end - start)); - } - - function linearInterpolation(t, start, end) { - return t * end + (1 - t) * start; - } - - function quadraticOutInterpolation(t, start, end) { - return linearInterpolation(2 * t - t * t, start, end); - } - - function b3Friction1(x) { - return (0.0007 * Math.pow(x, 3)) - - (0.031 * Math.pow(x, 2)) + 0.64 * x + 1.28; - } - - function b3Friction2(x) { - return (0.000044 * Math.pow(x, 3)) - - (0.006 * Math.pow(x, 2)) + 0.36 * x + 2; - } - - function b3Friction3(x) { - return (0.00000045 * Math.pow(x, 3)) - - (0.000332 * Math.pow(x, 2)) + 0.1078 * x + 5.84; - } - - function b3Nobounce(tension) { - if (tension <= 18) { - return b3Friction1(tension); - } else if (tension > 18 && tension <= 44) { - return b3Friction2(tension); - } else { - return b3Friction3(tension); - } - } - - var b = normalize(bounciness / 1.7, 0, 20); - b = projectNormal(b, 0, 0.8); - var s = normalize(speed / 1.7, 0, 20); - var bouncyTension = projectNormal(s, 0.5, 200); - var bouncyFriction = quadraticOutInterpolation( - b, - b3Nobounce(bouncyTension), - 0.01 - ); - - return { - tension: tensionFromOrigamiValue(bouncyTension), - friction: frictionFromOrigamiValue(bouncyFriction) - }; -} - -module.exports = { - fromOrigamiTensionAndFriction, - fromBouncinessAndSpeed, -}; diff --git a/docgen/Libraries/Animated/src/__tests__/Animated-test.js b/docgen/Libraries/Animated/src/__tests__/Animated-test.js deleted file mode 100644 index d839bc3e7ef..00000000000 --- a/docgen/Libraries/Animated/src/__tests__/Animated-test.js +++ /dev/null @@ -1,780 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ -'use strict'; - -var Animated = require('Animated'); -describe('Animated tests', () => { - beforeEach(() => { - jest.resetModules(); - }); - - describe('Animated', () => { - - it('works end to end', () => { - var anim = new Animated.Value(0); - - var callback = jest.fn(); - - var node = new Animated.__PropsOnlyForTests({ - style: { - backgroundColor: 'red', - opacity: anim, - transform: [ - {translateX: anim.interpolate({ - inputRange: [0, 1], - outputRange: [100, 200], - })}, - {scale: anim}, - ], - shadowOffset: { - width: anim, - height: anim, - }, - } - }, callback); - - expect(anim.__getChildren().length).toBe(3); - - expect(node.__getValue()).toEqual({ - style: { - backgroundColor: 'red', - opacity: 0, - transform: [ - {translateX: 100}, - {scale: 0}, - ], - shadowOffset: { - width: 0, - height: 0, - }, - }, - }); - - anim.setValue(0.5); - - expect(callback).toBeCalled(); - - expect(node.__getValue()).toEqual({ - style: { - backgroundColor: 'red', - opacity: 0.5, - transform: [ - {translateX: 150}, - {scale: 0.5}, - ], - shadowOffset: { - width: 0.5, - height: 0.5, - }, - }, - }); - - node.__detach(); - expect(anim.__getChildren().length).toBe(0); - - anim.setValue(1); - expect(callback.mock.calls.length).toBe(1); - }); - - it('does not detach on updates', () => { - var anim = new Animated.Value(0); - anim.__detach = jest.fn(); - - var c = new Animated.View(); - c.props = { - style: { - opacity: anim, - }, - }; - c.componentWillMount(); - - expect(anim.__detach).not.toBeCalled(); - c._component = {}; - c.componentWillReceiveProps({ - style: { - opacity: anim, - }, - }); - expect(anim.__detach).not.toBeCalled(); - - c.componentWillUnmount(); - expect(anim.__detach).toBeCalled(); - }); - - - it('stops animation when detached', () => { - var anim = new Animated.Value(0); - var callback = jest.fn(); - - var c = new Animated.View(); - c.props = { - style: { - opacity: anim, - }, - }; - c.componentWillMount(); - - Animated.timing(anim, {toValue: 10, duration: 1000}).start(callback); - c._component = {}; - c.componentWillUnmount(); - - expect(callback).toBeCalledWith({finished: false}); - expect(callback).toBeCalledWith({finished: false}); - }); - - it('triggers callback when spring is at rest', () => { - var anim = new Animated.Value(0); - var callback = jest.fn(); - Animated.spring(anim, {toValue: 0, velocity: 0}).start(callback); - expect(callback).toBeCalled(); - }); - - it('send toValue when a spring stops', () => { - var anim = new Animated.Value(0); - var listener = jest.fn(); - anim.addListener(listener); - Animated.spring(anim, {toValue: 15}).start(); - jest.runAllTimers(); - var lastValue = listener.mock.calls[listener.mock.calls.length - 2][0].value; - expect(lastValue).not.toBe(15); - expect(lastValue).toBeCloseTo(15); - expect(anim.__getValue()).toBe(15); - }); - - it('convert to JSON', () => { - expect(JSON.stringify(new Animated.Value(10))).toBe('10'); - }); - }); - - - describe('Animated Sequence', () => { - - it('works with an empty sequence', () => { - var cb = jest.fn(); - Animated.sequence([]).start(cb); - expect(cb).toBeCalledWith({finished: true}); - }); - - it('sequences well', () => { - var anim1 = {start: jest.fn()}; - var anim2 = {start: jest.fn()}; - var cb = jest.fn(); - - var seq = Animated.sequence([anim1, anim2]); - - expect(anim1.start).not.toBeCalled(); - expect(anim2.start).not.toBeCalled(); - - seq.start(cb); - - expect(anim1.start).toBeCalled(); - expect(anim2.start).not.toBeCalled(); - expect(cb).not.toBeCalled(); - - anim1.start.mock.calls[0][0]({finished: true}); - - expect(anim2.start).toBeCalled(); - expect(cb).not.toBeCalled(); - - anim2.start.mock.calls[0][0]({finished: true}); - expect(cb).toBeCalledWith({finished: true}); - }); - - it('supports interrupting sequence', () => { - var anim1 = {start: jest.fn()}; - var anim2 = {start: jest.fn()}; - var cb = jest.fn(); - - Animated.sequence([anim1, anim2]).start(cb); - - anim1.start.mock.calls[0][0]({finished: false}); - - expect(anim1.start).toBeCalled(); - expect(anim2.start).not.toBeCalled(); - expect(cb).toBeCalledWith({finished: false}); - }); - - it('supports stopping sequence', () => { - var anim1 = {start: jest.fn(), stop: jest.fn()}; - var anim2 = {start: jest.fn(), stop: jest.fn()}; - var cb = jest.fn(); - - var seq = Animated.sequence([anim1, anim2]); - seq.start(cb); - seq.stop(); - - expect(anim1.stop).toBeCalled(); - expect(anim2.stop).not.toBeCalled(); - expect(cb).not.toBeCalled(); - - anim1.start.mock.calls[0][0]({finished: false}); - - expect(cb).toBeCalledWith({finished: false}); - }); - }); - - describe('Animated Loop', () => { - - it('loops indefinitely if config not specified', () => { - var animation = {start: jest.fn(), reset: jest.fn(), _isUsingNativeDriver: () => false}; - var cb = jest.fn(); - - var loop = Animated.loop(animation); - - expect(animation.start).not.toBeCalled(); - - loop.start(cb); - - expect(animation.start).toBeCalled(); - expect(animation.reset).toHaveBeenCalledTimes(1); - expect(cb).not.toBeCalled(); - - animation.start.mock.calls[0][0]({finished: true}); // End of loop 1 - expect(animation.reset).toHaveBeenCalledTimes(2); - expect(cb).not.toBeCalled(); - - animation.start.mock.calls[0][0]({finished: true}); // End of loop 2 - expect(animation.reset).toHaveBeenCalledTimes(3); - expect(cb).not.toBeCalled(); - - animation.start.mock.calls[0][0]({finished: true}); // End of loop 3 - expect(animation.reset).toHaveBeenCalledTimes(4); - expect(cb).not.toBeCalled(); - }); - - it('loops indefinitely if iterations is -1', () => { - var animation = {start: jest.fn(), reset: jest.fn(), _isUsingNativeDriver: () => false}; - var cb = jest.fn(); - - var loop = Animated.loop(animation, { iterations: -1 }); - - expect(animation.start).not.toBeCalled(); - - loop.start(cb); - - expect(animation.start).toBeCalled(); - expect(animation.reset).toHaveBeenCalledTimes(1); - expect(cb).not.toBeCalled(); - - animation.start.mock.calls[0][0]({finished: true}); // End of loop 1 - expect(animation.reset).toHaveBeenCalledTimes(2); - expect(cb).not.toBeCalled(); - - animation.start.mock.calls[0][0]({finished: true}); // End of loop 2 - expect(animation.reset).toHaveBeenCalledTimes(3); - expect(cb).not.toBeCalled(); - - animation.start.mock.calls[0][0]({finished: true}); // End of loop 3 - expect(animation.reset).toHaveBeenCalledTimes(4); - expect(cb).not.toBeCalled(); - }); - - it('loops indefinitely if iterations not specified', () => { - var animation = {start: jest.fn(), reset: jest.fn(), _isUsingNativeDriver: () => false}; - var cb = jest.fn(); - - var loop = Animated.loop(animation, { anotherKey: 'value' }); - - expect(animation.start).not.toBeCalled(); - - loop.start(cb); - - expect(animation.start).toBeCalled(); - expect(animation.reset).toHaveBeenCalledTimes(1); - expect(cb).not.toBeCalled(); - - animation.start.mock.calls[0][0]({finished: true}); // End of loop 1 - expect(animation.reset).toHaveBeenCalledTimes(2); - expect(cb).not.toBeCalled(); - - animation.start.mock.calls[0][0]({finished: true}); // End of loop 2 - expect(animation.reset).toHaveBeenCalledTimes(3); - expect(cb).not.toBeCalled(); - - animation.start.mock.calls[0][0]({finished: true}); // End of loop 3 - expect(animation.reset).toHaveBeenCalledTimes(4); - expect(cb).not.toBeCalled(); - }); - - it('loops three times if iterations is 3', () => { - var animation = {start: jest.fn(), reset: jest.fn(), _isUsingNativeDriver: () => false}; - var cb = jest.fn(); - - var loop = Animated.loop(animation, { iterations: 3 }); - - expect(animation.start).not.toBeCalled(); - - loop.start(cb); - - expect(animation.start).toBeCalled(); - expect(animation.reset).toHaveBeenCalledTimes(1); - expect(cb).not.toBeCalled(); - - animation.start.mock.calls[0][0]({finished: true}); // End of loop 1 - expect(animation.reset).toHaveBeenCalledTimes(2); - expect(cb).not.toBeCalled(); - - animation.start.mock.calls[0][0]({finished: true}); // End of loop 2 - expect(animation.reset).toHaveBeenCalledTimes(3); - expect(cb).not.toBeCalled(); - - animation.start.mock.calls[0][0]({finished: true}); // End of loop 3 - expect(animation.reset).toHaveBeenCalledTimes(3); - expect(cb).toBeCalledWith({finished: true}); - }); - - it('does not loop if iterations is 1', () => { - var animation = {start: jest.fn(), reset: jest.fn(), _isUsingNativeDriver: () => false}; - var cb = jest.fn(); - - var loop = Animated.loop(animation, { iterations: 1 }); - - expect(animation.start).not.toBeCalled(); - - loop.start(cb); - - expect(animation.start).toBeCalled(); - expect(cb).not.toBeCalled(); - - animation.start.mock.calls[0][0]({finished: true}); // End of loop 1 - expect(cb).toBeCalledWith({finished: true}); - }); - - it('does not animate if iterations is 0', () => { - var animation = {start: jest.fn(), reset: jest.fn(), _isUsingNativeDriver: () => false}; - var cb = jest.fn(); - - var loop = Animated.loop(animation, { iterations: 0 }); - - expect(animation.start).not.toBeCalled(); - - loop.start(cb); - - expect(animation.start).not.toBeCalled(); - expect(cb).toBeCalledWith({ finished: true }); - }); - - it('supports interrupting an indefinite loop', () => { - var animation = {start: jest.fn(), reset: jest.fn(), _isUsingNativeDriver: () => false}; - var cb = jest.fn(); - - Animated.loop(animation).start(cb); - expect(animation.start).toBeCalled(); - expect(animation.reset).toHaveBeenCalledTimes(1); - expect(cb).not.toBeCalled(); - - animation.start.mock.calls[0][0]({finished: true}); // End of loop 1 - expect(animation.reset).toHaveBeenCalledTimes(2); - expect(cb).not.toBeCalled(); - - animation.start.mock.calls[0][0]({finished: false}); // Interrupt loop - expect(animation.reset).toHaveBeenCalledTimes(2); - expect(cb).toBeCalledWith({finished: false}); - }); - - it('supports stopping loop', () => { - var animation = {start: jest.fn(), stop: jest.fn(), reset: jest.fn(), _isUsingNativeDriver: () => false}; - var cb = jest.fn(); - - var loop = Animated.loop(animation); - loop.start(cb); - loop.stop(); - - expect(animation.start).toBeCalled(); - expect(animation.reset).toHaveBeenCalledTimes(1); - expect(animation.stop).toBeCalled(); - - animation.start.mock.calls[0][0]({finished: false}); // Interrupt loop - expect(animation.reset).toHaveBeenCalledTimes(1); - expect(cb).toBeCalledWith({finished: false}); - }); - }); - - describe('Animated Parallel', () => { - - it('works with an empty parallel', () => { - var cb = jest.fn(); - Animated.parallel([]).start(cb); - expect(cb).toBeCalledWith({finished: true}); - }); - - it('works with an empty element in array', () => { - var anim1 = {start: jest.fn()}; - var cb = jest.fn(); - Animated.parallel([null, anim1]).start(cb); - - expect(anim1.start).toBeCalled(); - anim1.start.mock.calls[0][0]({finished: true}); - - expect(cb).toBeCalledWith({finished: true}); - }); - - it('parellelizes well', () => { - var anim1 = {start: jest.fn()}; - var anim2 = {start: jest.fn()}; - var cb = jest.fn(); - - var par = Animated.parallel([anim1, anim2]); - - expect(anim1.start).not.toBeCalled(); - expect(anim2.start).not.toBeCalled(); - - par.start(cb); - - expect(anim1.start).toBeCalled(); - expect(anim2.start).toBeCalled(); - expect(cb).not.toBeCalled(); - - anim1.start.mock.calls[0][0]({finished: true}); - expect(cb).not.toBeCalled(); - - anim2.start.mock.calls[0][0]({finished: true}); - expect(cb).toBeCalledWith({finished: true}); - }); - - it('supports stopping parallel', () => { - var anim1 = {start: jest.fn(), stop: jest.fn()}; - var anim2 = {start: jest.fn(), stop: jest.fn()}; - var cb = jest.fn(); - - var seq = Animated.parallel([anim1, anim2]); - seq.start(cb); - seq.stop(); - - expect(anim1.stop).toBeCalled(); - expect(anim2.stop).toBeCalled(); - expect(cb).not.toBeCalled(); - - anim1.start.mock.calls[0][0]({finished: false}); - expect(cb).not.toBeCalled(); - - anim2.start.mock.calls[0][0]({finished: false}); - expect(cb).toBeCalledWith({finished: false}); - }); - - - it('does not call stop more than once when stopping', () => { - var anim1 = {start: jest.fn(), stop: jest.fn()}; - var anim2 = {start: jest.fn(), stop: jest.fn()}; - var anim3 = {start: jest.fn(), stop: jest.fn()}; - var cb = jest.fn(); - - var seq = Animated.parallel([anim1, anim2, anim3]); - seq.start(cb); - - anim1.start.mock.calls[0][0]({finished: false}); - - expect(anim1.stop.mock.calls.length).toBe(0); - expect(anim2.stop.mock.calls.length).toBe(1); - expect(anim3.stop.mock.calls.length).toBe(1); - - anim2.start.mock.calls[0][0]({finished: false}); - - expect(anim1.stop.mock.calls.length).toBe(0); - expect(anim2.stop.mock.calls.length).toBe(1); - expect(anim3.stop.mock.calls.length).toBe(1); - - anim3.start.mock.calls[0][0]({finished: false}); - - expect(anim1.stop.mock.calls.length).toBe(0); - expect(anim2.stop.mock.calls.length).toBe(1); - expect(anim3.stop.mock.calls.length).toBe(1); - }); - }); - - describe('Animated delays', () => { - it('should call anim after delay in sequence', () => { - var anim = {start: jest.fn(), stop: jest.fn()}; - var cb = jest.fn(); - Animated.sequence([ - Animated.delay(1000), - anim, - ]).start(cb); - jest.runAllTimers(); - expect(anim.start.mock.calls.length).toBe(1); - expect(cb).not.toBeCalled(); - anim.start.mock.calls[0][0]({finished: true}); - expect(cb).toBeCalledWith({finished: true}); - }); - it('should run stagger to end', () => { - var cb = jest.fn(); - Animated.stagger(1000, [ - Animated.delay(1000), - Animated.delay(1000), - Animated.delay(1000), - ]).start(cb); - jest.runAllTimers(); - expect(cb).toBeCalledWith({finished: true}); - }); - }); - - describe('Animated Events', () => { - it('should map events', () => { - var value = new Animated.Value(0); - var handler = Animated.event( - [null, {state: {foo: value}}], - ); - handler({bar: 'ignoreBar'}, {state: {baz: 'ignoreBaz', foo: 42}}); - expect(value.__getValue()).toBe(42); - }); - it('should call listeners', () => { - var value = new Animated.Value(0); - var listener = jest.fn(); - var handler = Animated.event( - [{foo: value}], - {listener}, - ); - handler({foo: 42}); - expect(value.__getValue()).toBe(42); - expect(listener.mock.calls.length).toBe(1); - expect(listener).toBeCalledWith({foo: 42}); - }); - it('should call forked event listeners', () => { - var value = new Animated.Value(0); - var listener = jest.fn(); - var handler = Animated.event( - [{foo: value}], - {listener}, - ); - var listener2 = jest.fn(); - var forkedHandler = Animated.forkEvent(handler, listener2); - forkedHandler({foo: 42}); - expect(value.__getValue()).toBe(42); - expect(listener.mock.calls.length).toBe(1); - expect(listener).toBeCalledWith({foo: 42}); - expect(listener2.mock.calls.length).toBe(1); - expect(listener2).toBeCalledWith({foo: 42}); - }); - }); - - describe('Animated Interactions', () => { - /*eslint-disable no-shadow*/ - var Animated; - /*eslint-enable*/ - var InteractionManager; - - beforeEach(() => { - jest.mock('InteractionManager'); - Animated = require('Animated'); - InteractionManager = require('InteractionManager'); - }); - - afterEach(()=> { - jest.unmock('InteractionManager'); - }); - - it('registers an interaction by default', () => { - InteractionManager.createInteractionHandle.mockReturnValue(777); - - var value = new Animated.Value(0); - var callback = jest.fn(); - Animated.timing(value, { - toValue: 100, - duration: 100, - }).start(callback); - jest.runAllTimers(); - - expect(InteractionManager.createInteractionHandle).toBeCalled(); - expect(InteractionManager.clearInteractionHandle).toBeCalledWith(777); - expect(callback).toBeCalledWith({finished: true}); - }); - - it('does not register an interaction when specified', () => { - var value = new Animated.Value(0); - var callback = jest.fn(); - Animated.timing(value, { - toValue: 100, - duration: 100, - isInteraction: false, - }).start(callback); - jest.runAllTimers(); - - expect(InteractionManager.createInteractionHandle).not.toBeCalled(); - expect(InteractionManager.clearInteractionHandle).not.toBeCalled(); - expect(callback).toBeCalledWith({finished: true}); - }); - }); - - describe('Animated Tracking', () => { - it('should track values', () => { - var value1 = new Animated.Value(0); - var value2 = new Animated.Value(0); - Animated.timing(value2, { - toValue: value1, - duration: 0, - }).start(); - value1.setValue(42); - expect(value2.__getValue()).toBe(42); - value1.setValue(7); - expect(value2.__getValue()).toBe(7); - }); - - it('should track interpolated values', () => { - var value1 = new Animated.Value(0); - var value2 = new Animated.Value(0); - Animated.timing(value2, { - toValue: value1.interpolate({ - inputRange: [0, 2], - outputRange: [0, 1] - }), - duration: 0, - }).start(); - value1.setValue(42); - expect(value2.__getValue()).toBe(42 / 2); - }); - - it('should stop tracking when animated', () => { - var value1 = new Animated.Value(0); - var value2 = new Animated.Value(0); - Animated.timing(value2, { - toValue: value1, - duration: 0, - }).start(); - value1.setValue(42); - expect(value2.__getValue()).toBe(42); - Animated.timing(value2, { - toValue: 7, - duration: 0, - }).start(); - value1.setValue(1492); - expect(value2.__getValue()).toBe(7); - }); - }); - - describe('Animated Vectors', () => { - it('should animate vectors', () => { - var vec = new Animated.ValueXY(); - - var callback = jest.fn(); - - var node = new Animated.__PropsOnlyForTests({ - style: { - opacity: vec.x.interpolate({ - inputRange: [0, 42], - outputRange: [0.2, 0.8], - }), - transform: vec.getTranslateTransform(), - ...vec.getLayout(), - } - }, callback); - - expect(node.__getValue()).toEqual({ - style: { - opacity: 0.2, - transform: [ - {translateX: 0}, - {translateY: 0}, - ], - left: 0, - top: 0, - }, - }); - - vec.setValue({x: 42, y: 1492}); - - expect(callback.mock.calls.length).toBe(2); // once each for x, y - - expect(node.__getValue()).toEqual({ - style: { - opacity: 0.8, - transform: [ - {translateX: 42}, - {translateY: 1492}, - ], - left: 42, - top: 1492, - }, - }); - - node.__detach(); - - vec.setValue({x: 1, y: 1}); - expect(callback.mock.calls.length).toBe(2); - }); - - it('should track vectors', () => { - var value1 = new Animated.ValueXY(); - var value2 = new Animated.ValueXY(); - Animated.timing(value2, { - toValue: value1, - duration: 0, - }).start(); - value1.setValue({x: 42, y: 1492}); - expect(value2.__getValue()).toEqual({x: 42, y: 1492}); - - // Make sure tracking keeps working (see stopTogether in ParallelConfig used - // by maybeVectorAnim). - value1.setValue({x: 3, y: 4}); - expect(value2.__getValue()).toEqual({x: 3, y: 4}); - }); - - it('should track with springs', () => { - var value1 = new Animated.ValueXY(); - var value2 = new Animated.ValueXY(); - Animated.spring(value2, { - toValue: value1, - tension: 3000, // faster spring for faster test - friction: 60, - }).start(); - value1.setValue({x: 1, y: 1}); - jest.runAllTimers(); - expect(Math.round(value2.__getValue().x)).toEqual(1); - expect(Math.round(value2.__getValue().y)).toEqual(1); - value1.setValue({x: 2, y: 2}); - jest.runAllTimers(); - expect(Math.round(value2.__getValue().x)).toEqual(2); - expect(Math.round(value2.__getValue().y)).toEqual(2); - }); - }); - - describe('Animated Listeners', () => { - it('should get updates', () => { - var value1 = new Animated.Value(0); - var listener = jest.fn(); - var id = value1.addListener(listener); - value1.setValue(42); - expect(listener.mock.calls.length).toBe(1); - expect(listener).toBeCalledWith({value: 42}); - expect(value1.__getValue()).toBe(42); - value1.setValue(7); - expect(listener.mock.calls.length).toBe(2); - expect(listener).toBeCalledWith({value: 7}); - expect(value1.__getValue()).toBe(7); - value1.removeListener(id); - value1.setValue(1492); - expect(listener.mock.calls.length).toBe(2); - expect(value1.__getValue()).toBe(1492); - }); - - it('should removeAll', () => { - var value1 = new Animated.Value(0); - var listener = jest.fn(); - [1,2,3,4].forEach(() => value1.addListener(listener)); - value1.setValue(42); - expect(listener.mock.calls.length).toBe(4); - expect(listener).toBeCalledWith({value: 42}); - value1.removeAllListeners(); - value1.setValue(7); - expect(listener.mock.calls.length).toBe(4); - }); - }); - - describe('Animated Diff Clamp', () => { - it('should get the proper value', () => { - const inputValues = [0, 20, 40, 30, 0, -40, -10, -20, 0]; - const expectedValues = [0, 20, 20, 10, 0, 0, 20, 10, 20]; - const value = new Animated.Value(0); - const diffClampValue = Animated.diffClamp(value, 0, 20); - for (let i = 0; i < inputValues.length; i++) { - value.setValue(inputValues[i]); - expect(diffClampValue.__getValue()).toBe(expectedValues[i]); - } - }); - }); -}); diff --git a/docgen/Libraries/Animated/src/__tests__/AnimatedNative-test.js b/docgen/Libraries/Animated/src/__tests__/AnimatedNative-test.js deleted file mode 100644 index 28a32c89ec4..00000000000 --- a/docgen/Libraries/Animated/src/__tests__/AnimatedNative-test.js +++ /dev/null @@ -1,672 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ -'use strict'; - -jest - .setMock('Text', {}) - .setMock('View', {}) - .setMock('Image', {}) - .setMock('React', {Component: class {}}) - .setMock('NativeModules', { - NativeAnimatedModule: {}, - }) - .mock('NativeEventEmitter') - // findNodeHandle is imported from ReactNative so mock that whole module. - .setMock('ReactNative', {findNodeHandle: () => 1}); - -const Animated = require('Animated'); -const NativeAnimatedHelper = require('NativeAnimatedHelper'); - -function createAndMountComponent(ComponentClass, props) { - const component = new ComponentClass(); - component.props = props; - component.componentWillMount(); - // Simulate that refs were set. - component._component = {}; - component.componentDidMount(); - return component; -} - -describe('Native Animated', () => { - - const nativeAnimatedModule = require('NativeModules').NativeAnimatedModule; - - beforeEach(() => { - nativeAnimatedModule.addAnimatedEventToView = jest.fn(); - nativeAnimatedModule.connectAnimatedNodes = jest.fn(); - nativeAnimatedModule.connectAnimatedNodeToView = jest.fn(); - nativeAnimatedModule.createAnimatedNode = jest.fn(); - nativeAnimatedModule.disconnectAnimatedNodeFromView = jest.fn(); - nativeAnimatedModule.disconnectAnimatedNodes = jest.fn(); - nativeAnimatedModule.dropAnimatedNode = jest.fn(); - nativeAnimatedModule.extractAnimatedNodeOffset = jest.fn(); - nativeAnimatedModule.flattenAnimatedNodeOffset = jest.fn(); - nativeAnimatedModule.removeAnimatedEventFromView = jest.fn(); - nativeAnimatedModule.setAnimatedNodeOffset = jest.fn(); - nativeAnimatedModule.setAnimatedNodeValue = jest.fn(); - nativeAnimatedModule.startAnimatingNode = jest.fn(); - nativeAnimatedModule.startListeningToAnimatedNodeValue = jest.fn(); - nativeAnimatedModule.stopAnimation = jest.fn(); - nativeAnimatedModule.stopListeningToAnimatedNodeValue = jest.fn(); - }); - - describe('Animated Value', () => { - it('proxies `setValue` correctly', () => { - const anim = new Animated.Value(0); - Animated.timing(anim, {toValue: 10, duration: 1000, useNativeDriver: true}).start(); - - const c = createAndMountComponent(Animated.View, { - style: { - opacity: anim, - }, - }); - - // We expect `setValue` not to propagate down to `setNativeProps`, otherwise it may try to access `setNativeProps` - // via component refs table that we override here. - c.refs = { - node: { - setNativeProps: jest.genMockFunction(), - }, - }; - - anim.setValue(0.5); - - expect(nativeAnimatedModule.setAnimatedNodeValue).toBeCalledWith(jasmine.any(Number), 0.5); - expect(c.refs.node.setNativeProps).not.toHaveBeenCalled(); - }); - - it('should set offset', () => { - const anim = new Animated.Value(0); - anim.setOffset(10); - anim.__makeNative(); - createAndMountComponent(Animated.View, { - style: { - opacity: anim, - }, - }); - - expect(nativeAnimatedModule.createAnimatedNode).toBeCalledWith( - jasmine.any(Number), - {type: 'value', value: 0, offset: 10}, - ); - anim.setOffset(20); - expect(nativeAnimatedModule.setAnimatedNodeOffset) - .toBeCalledWith(jasmine.any(Number), 20); - }); - - it('should flatten offset', () => { - const anim = new Animated.Value(0); - anim.__makeNative(); - createAndMountComponent(Animated.View, { - style: { - opacity: anim, - }, - }); - - expect(nativeAnimatedModule.createAnimatedNode).toBeCalledWith( - jasmine.any(Number), - {type: 'value', value: 0, offset: 0}, - ); - anim.flattenOffset(); - expect(nativeAnimatedModule.flattenAnimatedNodeOffset) - .toBeCalledWith(jasmine.any(Number)); - }); - - it('should extract offset', () => { - const anim = new Animated.Value(0); - anim.__makeNative(); - createAndMountComponent(Animated.View, { - style: { - opacity: anim, - }, - }); - - expect(nativeAnimatedModule.createAnimatedNode).toBeCalledWith( - jasmine.any(Number), - {type: 'value', value: 0, offset: 0}, - ); - anim.extractOffset(); - expect(nativeAnimatedModule.extractAnimatedNodeOffset) - .toBeCalledWith(jasmine.any(Number)); - }); - }); - - describe('Animated Listeners', () => { - it('should get updates', () => { - const value1 = new Animated.Value(0); - value1.__makeNative(); - const listener = jest.fn(); - const id = value1.addListener(listener); - expect(nativeAnimatedModule.startListeningToAnimatedNodeValue) - .toHaveBeenCalledWith(value1.__getNativeTag()); - - NativeAnimatedHelper.nativeEventEmitter.emit( - 'onAnimatedValueUpdate', - {value: 42, tag: value1.__getNativeTag()}, - ); - expect(listener).toHaveBeenCalledTimes(1); - expect(listener).toBeCalledWith({value: 42}); - expect(value1.__getValue()).toBe(42); - - NativeAnimatedHelper.nativeEventEmitter.emit( - 'onAnimatedValueUpdate', - {value: 7, tag: value1.__getNativeTag()}, - ); - expect(listener).toHaveBeenCalledTimes(2); - expect(listener).toBeCalledWith({value: 7}); - expect(value1.__getValue()).toBe(7); - - value1.removeListener(id); - expect(nativeAnimatedModule.stopListeningToAnimatedNodeValue) - .toHaveBeenCalledWith(value1.__getNativeTag()); - - NativeAnimatedHelper.nativeEventEmitter.emit( - 'onAnimatedValueUpdate', - {value: 1492, tag: value1.__getNativeTag()}, - ); - expect(listener).toHaveBeenCalledTimes(2); - expect(value1.__getValue()).toBe(7); - }); - - it('should removeAll', () => { - const value1 = new Animated.Value(0); - value1.__makeNative(); - const listener = jest.fn(); - [1,2,3,4].forEach(() => value1.addListener(listener)); - expect(nativeAnimatedModule.startListeningToAnimatedNodeValue) - .toHaveBeenCalledWith(value1.__getNativeTag()); - - NativeAnimatedHelper.nativeEventEmitter.emit( - 'onAnimatedValueUpdate', - {value: 42, tag: value1.__getNativeTag()}, - ); - expect(listener).toHaveBeenCalledTimes(4); - expect(listener).toBeCalledWith({value: 42}); - - value1.removeAllListeners(); - expect(nativeAnimatedModule.stopListeningToAnimatedNodeValue) - .toHaveBeenCalledWith(value1.__getNativeTag()); - - NativeAnimatedHelper.nativeEventEmitter.emit( - 'onAnimatedValueUpdate', - {value: 7, tag: value1.__getNativeTag()}, - ); - expect(listener).toHaveBeenCalledTimes(4); - }); - }); - - describe('Animated Events', () => { - it('should map events', () => { - const value = new Animated.Value(0); - value.__makeNative(); - const event = Animated.event( - [{nativeEvent: {state: {foo: value}}}], - {useNativeDriver: true}, - ); - const c = createAndMountComponent(Animated.View, {onTouchMove: event}); - expect(nativeAnimatedModule.addAnimatedEventToView).toBeCalledWith( - jasmine.any(Number), - 'onTouchMove', - {nativeEventPath: ['state', 'foo'], animatedValueTag: value.__getNativeTag()}, - ); - - c.componentWillUnmount(); - expect(nativeAnimatedModule.removeAnimatedEventFromView).toBeCalledWith( - jasmine.any(Number), - 'onTouchMove', - value.__getNativeTag(), - ); - }); - - it('should throw on invalid event path', () => { - const value = new Animated.Value(0); - value.__makeNative(); - const event = Animated.event( - [{notNativeEvent: {foo: value}}], - {useNativeDriver: true}, - ); - expect(() => createAndMountComponent(Animated.View, {onTouchMove: event})) - .toThrowError(/nativeEvent/); - expect(nativeAnimatedModule.addAnimatedEventToView).not.toBeCalled(); - }); - - it('should call listeners', () => { - const value = new Animated.Value(0); - value.__makeNative(); - const listener = jest.fn(); - const event = Animated.event( - [{nativeEvent: {foo: value}}], - {useNativeDriver: true, listener}, - ); - const handler = event.__getHandler(); - handler({foo: 42}); - expect(listener).toHaveBeenCalledTimes(1); - expect(listener).toBeCalledWith({foo: 42}); - }); - }); - - describe('Animated Graph', () => { - it('creates and detaches nodes', () => { - const anim = new Animated.Value(0); - const c = createAndMountComponent(Animated.View, { - style: { - opacity: anim, - }, - }); - - Animated.timing(anim, {toValue: 10, duration: 1000, useNativeDriver: true}).start(); - - c.componentWillUnmount(); - - expect(nativeAnimatedModule.createAnimatedNode).toHaveBeenCalledTimes(3); - expect(nativeAnimatedModule.connectAnimatedNodes).toHaveBeenCalledTimes(2); - - expect(nativeAnimatedModule.startAnimatingNode).toBeCalledWith( - jasmine.any(Number), - jasmine.any(Number), - {type: 'frames', frames: jasmine.any(Array), toValue: jasmine.any(Number), iterations: 1}, - jasmine.any(Function) - ); - - expect(nativeAnimatedModule.disconnectAnimatedNodes).toHaveBeenCalledTimes(2); - expect(nativeAnimatedModule.dropAnimatedNode).toHaveBeenCalledTimes(3); - }); - - it('sends a valid description for value, style and props nodes', () => { - const anim = new Animated.Value(0); - createAndMountComponent(Animated.View, { - style: { - opacity: anim, - }, - }); - - Animated.timing(anim, {toValue: 10, duration: 1000, useNativeDriver: true}).start(); - - expect(nativeAnimatedModule.createAnimatedNode) - .toBeCalledWith(jasmine.any(Number), {type: 'value', value: 0, offset: 0}); - expect(nativeAnimatedModule.createAnimatedNode) - .toBeCalledWith(jasmine.any(Number), {type: 'style', style: {opacity: jasmine.any(Number)}}); - expect(nativeAnimatedModule.createAnimatedNode) - .toBeCalledWith(jasmine.any(Number), {type: 'props', props: {style: jasmine.any(Number)}}); - }); - - it('sends a valid graph description for Animated.add nodes', () => { - const first = new Animated.Value(1); - const second = new Animated.Value(2); - first.__makeNative(); - second.__makeNative(); - - createAndMountComponent(Animated.View, { - style: { - opacity: Animated.add(first, second), - }, - }); - - expect(nativeAnimatedModule.createAnimatedNode).toBeCalledWith( - jasmine.any(Number), - {type: 'addition', input: jasmine.any(Array)}, - ); - const additionCalls = nativeAnimatedModule.createAnimatedNode.mock.calls.filter( - (call) => call[1].type === 'addition' - ); - expect(additionCalls.length).toBe(1); - const additionCall = additionCalls[0]; - const additionNodeTag = additionCall[0]; - const additionConnectionCalls = nativeAnimatedModule.connectAnimatedNodes.mock.calls.filter( - (call) => call[1] === additionNodeTag - ); - expect(additionConnectionCalls.length).toBe(2); - expect(nativeAnimatedModule.createAnimatedNode) - .toBeCalledWith(additionCall[1].input[0], {type: 'value', value: 1, offset: 0}); - expect(nativeAnimatedModule.createAnimatedNode) - .toBeCalledWith(additionCall[1].input[1], {type: 'value', value: 2, offset: 0}); - }); - - it('sends a valid graph description for Animated.multiply nodes', () => { - const first = new Animated.Value(2); - const second = new Animated.Value(1); - first.__makeNative(); - second.__makeNative(); - - createAndMountComponent(Animated.View, { - style: { - opacity: Animated.multiply(first, second), - }, - }); - - expect(nativeAnimatedModule.createAnimatedNode).toBeCalledWith( - jasmine.any(Number), - {type: 'multiplication', input: jasmine.any(Array)}, - ); - const multiplicationCalls = nativeAnimatedModule.createAnimatedNode.mock.calls.filter( - (call) => call[1].type === 'multiplication' - ); - expect(multiplicationCalls.length).toBe(1); - const multiplicationCall = multiplicationCalls[0]; - const multiplicationNodeTag = multiplicationCall[0]; - const multiplicationConnectionCalls = nativeAnimatedModule.connectAnimatedNodes.mock.calls.filter( - (call) => call[1] === multiplicationNodeTag - ); - expect(multiplicationConnectionCalls.length).toBe(2); - expect(nativeAnimatedModule.createAnimatedNode) - .toBeCalledWith(multiplicationCall[1].input[0], {type: 'value', value: 2, offset: 0}); - expect(nativeAnimatedModule.createAnimatedNode) - .toBeCalledWith(multiplicationCall[1].input[1], {type: 'value', value: 1, offset: 0}); - }); - - it('sends a valid graph description for Animated.divide nodes', () => { - const first = new Animated.Value(4); - const second = new Animated.Value(2); - first.__makeNative(); - second.__makeNative(); - - createAndMountComponent(Animated.View, { - style: { - opacity: Animated.divide(first, second), - }, - }); - - expect(nativeAnimatedModule.createAnimatedNode) - .toBeCalledWith(jasmine.any(Number), {type: 'division', input: jasmine.any(Array)}); - const divisionCalls = nativeAnimatedModule.createAnimatedNode.mock.calls.filter( - (call) => call[1].type === 'division' - ); - expect(divisionCalls.length).toBe(1); - const divisionCall = divisionCalls[0]; - const divisionNodeTag = divisionCall[0]; - const divisionConnectionCalls = nativeAnimatedModule.connectAnimatedNodes.mock.calls.filter( - (call) => call[1] === divisionNodeTag - ); - expect(divisionConnectionCalls.length).toBe(2); - expect(nativeAnimatedModule.createAnimatedNode) - .toBeCalledWith(divisionCall[1].input[0], {type: 'value', value: 4, offset: 0}); - expect(nativeAnimatedModule.createAnimatedNode) - .toBeCalledWith(divisionCall[1].input[1], {type: 'value', value: 2, offset: 0}); - }); - - it('sends a valid graph description for Animated.modulo nodes', () => { - const value = new Animated.Value(4); - value.__makeNative(); - - createAndMountComponent(Animated.View, { - style: { - opacity: Animated.modulo(value, 4), - }, - }); - - expect(nativeAnimatedModule.createAnimatedNode).toBeCalledWith( - jasmine.any(Number), - {type: 'modulus', modulus: 4, input: jasmine.any(Number)}, - ); - const moduloCalls = nativeAnimatedModule.createAnimatedNode.mock.calls.filter( - (call) => call[1].type === 'modulus' - ); - expect(moduloCalls.length).toBe(1); - const moduloCall = moduloCalls[0]; - const moduloNodeTag = moduloCall[0]; - const moduloConnectionCalls = nativeAnimatedModule.connectAnimatedNodes.mock.calls.filter( - (call) => call[1] === moduloNodeTag - ); - expect(moduloConnectionCalls.length).toBe(1); - expect(nativeAnimatedModule.createAnimatedNode) - .toBeCalledWith(moduloCall[1].input, {type: 'value', value: 4, offset: 0}); - }); - - it('sends a valid graph description for interpolate() nodes', () => { - const value = new Animated.Value(10); - value.__makeNative(); - - createAndMountComponent(Animated.View, { - style: { - opacity: value.interpolate({ - inputRange: [10, 20], - outputRange: [0, 1], - }), - }, - }); - - expect(nativeAnimatedModule.createAnimatedNode).toBeCalledWith( - jasmine.any(Number), - {type: 'value', value: 10, offset: 0} - ); - expect(nativeAnimatedModule.createAnimatedNode) - .toBeCalledWith(jasmine.any(Number), { - type: 'interpolation', - inputRange: [10, 20], - outputRange: [0, 1], - extrapolateLeft: 'extend', - extrapolateRight: 'extend', - }); - const interpolationNodeTag = nativeAnimatedModule.createAnimatedNode.mock.calls.find( - (call) => call[1].type === 'interpolation' - )[0]; - const valueNodeTag = nativeAnimatedModule.createAnimatedNode.mock.calls.find( - (call) => call[1].type === 'value' - )[0]; - expect(nativeAnimatedModule.connectAnimatedNodes).toBeCalledWith(valueNodeTag, interpolationNodeTag); - }); - - it('sends a valid graph description for transform nodes', () => { - const value = new Animated.Value(0); - value.__makeNative(); - - createAndMountComponent(Animated.View, { - style: { - transform: [{translateX: value}, {scale: 2}], - }, - }); - - expect(nativeAnimatedModule.createAnimatedNode).toBeCalledWith( - jasmine.any(Number), - { - type: 'transform', - transforms: [{ - nodeTag: jasmine.any(Number), - property: 'translateX', - type: 'animated', - }, { - value: 2, - property: 'scale', - type: 'static', - }], - }, - ); - }); - - it('sends a valid graph description for Animated.diffClamp nodes', () => { - const value = new Animated.Value(2); - value.__makeNative(); - - createAndMountComponent(Animated.View, { - style: { - opacity: Animated.diffClamp(value, 0, 20), - }, - }); - - expect(nativeAnimatedModule.createAnimatedNode).toBeCalledWith( - jasmine.any(Number), - {type: 'diffclamp', input: jasmine.any(Number), max: 20, min: 0}, - ); - const diffClampCalls = nativeAnimatedModule.createAnimatedNode.mock.calls.filter( - (call) => call[1].type === 'diffclamp' - ); - expect(diffClampCalls.length).toBe(1); - const diffClampCall = diffClampCalls[0]; - const diffClampNodeTag = diffClampCall[0]; - const diffClampConnectionCalls = nativeAnimatedModule.connectAnimatedNodes.mock.calls.filter( - (call) => call[1] === diffClampNodeTag - ); - expect(diffClampConnectionCalls.length).toBe(1); - expect(nativeAnimatedModule.createAnimatedNode) - .toBeCalledWith(diffClampCall[1].input, {type: 'value', value: 2, offset: 0}); - }); - - it('doesn\'t call into native API if useNativeDriver is set to false', () => { - const anim = new Animated.Value(0); - - const c = createAndMountComponent(Animated.View, { - style: { - opacity: anim, - }, - }); - - Animated.timing(anim, {toValue: 10, duration: 1000, useNativeDriver: false}).start(); - - c.componentWillUnmount(); - - expect(nativeAnimatedModule.createAnimatedNode).not.toBeCalled(); - }); - - it('fails when trying to run non-native animation on native node', () => { - const anim = new Animated.Value(0); - - createAndMountComponent(Animated.View, { - style: { - opacity: anim, - }, - }); - - Animated.timing(anim, {toValue: 10, duration: 50, useNativeDriver: true}).start(); - jest.runAllTimers(); - - Animated.timing(anim, {toValue: 4, duration: 500, useNativeDriver: false}).start(); - expect(jest.runAllTimers).toThrow(); - }); - - it('fails for unsupported styles', () => { - const anim = new Animated.Value(0); - - createAndMountComponent(Animated.View, { - style: { - left: anim, - }, - }); - - const animation = Animated.timing(anim, {toValue: 10, duration: 50, useNativeDriver: true}); - expect(animation.start).toThrowError(/left/); - }); - - it('works for any `static` props and styles', () => { - // Passing "unsupported" props should work just fine as long as they are not animated - const value = new Animated.Value(0); - value.__makeNative(); - - createAndMountComponent(Animated.View, { - style: { - left: 10, - top: 20, - opacity: value, - }, - removeClippedSubviews: true, - }); - - expect(nativeAnimatedModule.createAnimatedNode) - .toBeCalledWith(jasmine.any(Number), { type: 'style', style: { opacity: jasmine.any(Number) }}); - expect(nativeAnimatedModule.createAnimatedNode) - .toBeCalledWith(jasmine.any(Number), { type: 'props', props: { style: jasmine.any(Number) }}); - }); - }); - - describe('Animations', () => { - it('sends a valid timing animation description', () => { - const anim = new Animated.Value(0); - Animated.timing(anim, {toValue: 10, duration: 1000, useNativeDriver: true}).start(); - - expect(nativeAnimatedModule.startAnimatingNode).toBeCalledWith( - jasmine.any(Number), - jasmine.any(Number), - {type: 'frames', frames: jasmine.any(Array), toValue: jasmine.any(Number), iterations: 1}, - jasmine.any(Function) - ); - }); - - it('sends a valid spring animation description', () => { - const anim = new Animated.Value(0); - Animated.spring(anim, {toValue: 10, friction: 5, tension: 164, useNativeDriver: true}).start(); - expect(nativeAnimatedModule.startAnimatingNode).toBeCalledWith( - jasmine.any(Number), - jasmine.any(Number), - { - type: 'spring', - friction: 16, - initialVelocity: 0, - overshootClamping: false, - restDisplacementThreshold: 0.001, - restSpeedThreshold: 0.001, - tension: 679.08, - toValue: 10, - iterations: 1, - }, - jasmine.any(Function) - ); - - Animated.spring(anim, {toValue: 10, bounciness: 8, speed: 10, useNativeDriver: true}).start(); - expect(nativeAnimatedModule.startAnimatingNode).toBeCalledWith( - jasmine.any(Number), - jasmine.any(Number), - { - type: 'spring', - friction: 23.05223140901191, - initialVelocity: 0, - overshootClamping: false, - restDisplacementThreshold: 0.001, - restSpeedThreshold: 0.001, - tension: 299.61882352941177, - toValue: 10, - iterations: 1, - }, - jasmine.any(Function) - ); - }); - - it('sends a valid decay animation description', () => { - const anim = new Animated.Value(0); - Animated.decay(anim, {velocity: 10, deceleration: 0.1, useNativeDriver: true}).start(); - - expect(nativeAnimatedModule.startAnimatingNode).toBeCalledWith( - jasmine.any(Number), - jasmine.any(Number), - {type: 'decay', deceleration: 0.1, velocity: 10, iterations: 1}, - jasmine.any(Function) - ); - }); - - it('works with Animated.loop', () => { - const anim = new Animated.Value(0); - Animated.loop( - Animated.decay(anim, {velocity: 10, deceleration: 0.1, useNativeDriver: true}), - { iterations: 10 }, - ).start(); - - expect(nativeAnimatedModule.startAnimatingNode).toBeCalledWith( - jasmine.any(Number), - jasmine.any(Number), - {type: 'decay', deceleration: 0.1, velocity: 10, iterations: 10}, - jasmine.any(Function) - ); - }); - - it('sends stopAnimation command to native', () => { - const value = new Animated.Value(0); - const animation = Animated.timing(value, {toValue: 10, duration: 50, useNativeDriver: true}); - - animation.start(); - expect(nativeAnimatedModule.startAnimatingNode).toBeCalledWith( - jasmine.any(Number), - jasmine.any(Number), - {type: 'frames', frames: jasmine.any(Array), toValue: jasmine.any(Number), iterations: 1}, - jasmine.any(Function) - ); - const animationId = nativeAnimatedModule.startAnimatingNode.mock.calls[0][0]; - - animation.stop(); - expect(nativeAnimatedModule.stopAnimation).toBeCalledWith(animationId); - }); - }); -}); diff --git a/docgen/Libraries/Animated/src/__tests__/Easing-test.js b/docgen/Libraries/Animated/src/__tests__/Easing-test.js deleted file mode 100644 index aedc168e9ee..00000000000 --- a/docgen/Libraries/Animated/src/__tests__/Easing-test.js +++ /dev/null @@ -1,125 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ -'use strict'; - -var Easing = require('Easing'); -describe('Easing', () => { - it('should work with linear', () => { - var easing = Easing.linear; - - expect(easing(0)).toBe(0); - expect(easing(0.5)).toBe(0.5); - expect(easing(0.8)).toBe(0.8); - expect(easing(1)).toBe(1); - }); - - it('should work with ease in linear', () => { - var easing = Easing.in(Easing.linear); - expect(easing(0)).toBe(0); - expect(easing(0.5)).toBe(0.5); - expect(easing(0.8)).toBe(0.8); - expect(easing(1)).toBe(1); - }); - - it('should work with easy out linear', () => { - var easing = Easing.out(Easing.linear); - expect(easing(0)).toBe(0); - expect(easing(0.5)).toBe(0.5); - expect(easing(0.6)).toBe(0.6); - expect(easing(1)).toBe(1); - }); - - it('should work with ease in quad', () => { - function easeInQuad(t) { - return t * t; - } - var easing = Easing.in(Easing.quad); - for (var t = -0.5; t < 1.5; t += 0.1) { - expect(easing(t)).toBe(easeInQuad(t)); - } - }); - - it('should work with ease out quad', () => { - function easeOutQuad(t) { - return -t * (t - 2); - } - var easing = Easing.out(Easing.quad); - for (var t = 0; t <= 1; t += 0.1) { - expect(easing(1)).toBe(easeOutQuad(1)); - } - }); - - it('should work with ease in-out quad', () => { - function easeInOutQuad(t) { - t = t * 2; - if (t < 1) { - return 0.5 * t * t; - } - return -((t - 1) * (t - 3) - 1) / 2; - } - var easing = Easing.inOut(Easing.quad); - for (var t = -0.5; t < 1.5; t += 0.1) { - expect(easing(t)).toBeCloseTo(easeInOutQuad(t), 4); - } - }); - - it('should satisfy boundary conditions with elastic', () => { - for (var b = 0; b < 4; b += 0.3) { - var easing = Easing.elastic(b); - expect(easing(0)).toBe(0); - expect(easing(1)).toBe(1); - } - }); - - function sampleEasingFunction(easing) { - var DURATION = 300; - var tickCount = Math.round(DURATION * 60 / 1000); - var samples = []; - for (var i = 0; i <= tickCount; i++) { - samples.push(easing(i / tickCount)); - } - return samples; - } - - var Samples = { - in_quad: [0,0.0030864197530864196,0.012345679012345678,0.027777777777777776,0.04938271604938271,0.0771604938271605,0.1111111111111111,0.15123456790123457,0.19753086419753085,0.25,0.308641975308642,0.37345679012345684,0.4444444444444444,0.5216049382716049,0.6049382716049383,0.6944444444444445,0.7901234567901234,0.8919753086419753,1], - out_quad: [0,0.10802469135802469,0.20987654320987653,0.3055555555555555,0.3950617283950617,0.47839506172839513,0.5555555555555556,0.6265432098765432,0.691358024691358,0.75,0.8024691358024691,0.8487654320987654,0.888888888888889,0.9228395061728394,0.9506172839506174,0.9722222222222221,0.9876543209876543,0.9969135802469136,1], - inOut_quad: [0,0.006172839506172839,0.024691358024691357,0.05555555555555555,0.09876543209876543,0.154320987654321,0.2222222222222222,0.30246913580246915,0.3950617283950617,0.5,0.6049382716049383,0.697530864197531,0.7777777777777777,0.845679012345679,0.9012345679012346,0.9444444444444444,0.9753086419753086,0.9938271604938271,1], - in_cubic: [0,0.00017146776406035664,0.0013717421124828531,0.004629629629629629,0.010973936899862825,0.021433470507544586,0.037037037037037035,0.05881344307270234,0.0877914951989026,0.125,0.1714677640603567,0.22822359396433475,0.2962962962962963,0.37671467764060357,0.4705075445816187,0.5787037037037038,0.7023319615912208,0.8424211248285322,1], - out_cubic: [0,0.15757887517146785,0.2976680384087792,0.42129629629629617,0.5294924554183813,0.6232853223593964,0.7037037037037036,0.7717764060356652,0.8285322359396433,0.875,0.9122085048010974,0.9411865569272977,0.9629629629629629,0.9785665294924554,0.9890260631001372,0.9953703703703703,0.9986282578875172,0.9998285322359396,1], - inOut_cubic: [0,0.0006858710562414266,0.0054869684499314125,0.018518518518518517,0.0438957475994513,0.08573388203017834,0.14814814814814814,0.23525377229080935,0.3511659807956104,0.5,0.6488340192043895,0.7647462277091908,0.8518518518518519,0.9142661179698217,0.9561042524005487,0.9814814814814815,0.9945130315500685,0.9993141289437586,1], - in_sin: [0,0.003805301908254455,0.01519224698779198,0.03407417371093169,0.06030737921409157,0.09369221296335006,0.1339745962155613,0.1808479557110082,0.233955556881022,0.2928932188134524,0.35721239031346064,0.42642356364895384,0.4999999999999999,0.5773817382593005,0.6579798566743311,0.7411809548974793,0.8263518223330696,0.9128442572523416,0.9999999999999999], - out_sin: [0,0.08715574274765817,0.17364817766693033,0.25881904510252074,0.3420201433256687,0.42261826174069944,0.49999999999999994,0.573576436351046,0.6427876096865393,0.7071067811865475,0.766044443118978,0.8191520442889918,0.8660254037844386,0.9063077870366499,0.9396926207859083,0.9659258262890683,0.984807753012208,0.9961946980917455,1], - inOut_sin: [0,0.00759612349389599,0.030153689607045786,0.06698729810778065,0.116977778440511,0.17860619515673032,0.24999999999999994,0.32898992833716556,0.4131759111665348,0.49999999999999994,0.5868240888334652,0.6710100716628343,0.7499999999999999,0.8213938048432696,0.883022221559489,0.9330127018922194,0.9698463103929542,0.9924038765061041,1], - in_exp: [0,0.0014352875901128893,0.002109491677524035,0.0031003926796253885,0.004556754060844206,0.006697218616039631,0.009843133202303688,0.014466792379488908,0.021262343752724643,0.03125,0.045929202883612456,0.06750373368076916,0.09921256574801243,0.1458161299470146,0.2143109957132682,0.31498026247371835,0.46293735614364506,0.6803950000871883,1], - out_exp: [0,0.31960499991281155,0.5370626438563548,0.6850197375262816,0.7856890042867318,0.8541838700529854,0.9007874342519875,0.9324962663192309,0.9540707971163875,0.96875,0.9787376562472754,0.9855332076205111,0.9901568667976963,0.9933027813839603,0.9954432459391558,0.9968996073203746,0.9978905083224759,0.9985647124098871,1], - inOut_exp: [0,0.0010547458387620175,0.002278377030422103,0.004921566601151844,0.010631171876362321,0.022964601441806228,0.049606282874006216,0.1071554978566341,0.23146867807182253,0.5,0.7685313219281775,0.892844502143366,0.9503937171259937,0.9770353985581938,0.9893688281236377,0.9950784333988482,0.9977216229695779,0.998945254161238,1], - in_circle: [0,0.0015444024660317135,0.006192010000093506,0.013986702816730645,0.025003956956430873,0.03935464078941209,0.057190958417936644,0.07871533601238889,0.10419358352238339,0.1339745962155614,0.1685205807169019,0.20845517506805522,0.2546440075000701,0.3083389112228482,0.37146063894529113,0.4472292016074334,0.5418771527091488,0.6713289009389102,1], - out_circle: [0,0.3286710990610898,0.45812284729085123,0.5527707983925666,0.6285393610547089,0.6916610887771518,0.7453559924999298,0.7915448249319448,0.8314794192830981,0.8660254037844386,0.8958064164776166,0.9212846639876111,0.9428090415820634,0.9606453592105879,0.9749960430435691,0.9860132971832694,0.9938079899999065,0.9984555975339683,1], - inOut_circle: [0,0.003096005000046753,0.012501978478215436,0.028595479208968322,0.052096791761191696,0.08426029035845095,0.12732200375003505,0.18573031947264557,0.2709385763545744,0.5,0.7290614236454256,0.8142696805273546,0.8726779962499649,0.915739709641549,0.9479032082388084,0.9714045207910317,0.9874980215217846,0.9969039949999532,1], - in_back_: [0,-0.004788556241426612,-0.017301289437585736,-0.0347587962962963,-0.05438167352537723,-0.07339051783264748,-0.08900592592592595,-0.09844849451303156,-0.0989388203017833,-0.08769750000000004,-0.06194513031550073,-0.018902307956104283,0.044210370370370254,0.13017230795610413,0.2417629080932785,0.3817615740740742,0.5529477091906719,0.7581007167352535,0.9999999999999998], - out_back_: [2.220446049250313e-16,0.24189928326474652,0.44705229080932807,0.6182384259259258,0.7582370919067215,0.8698276920438959,0.9557896296296297,1.0189023079561044,1.0619451303155008,1.0876975,1.0989388203017834,1.0984484945130315,1.089005925925926,1.0733905178326475,1.0543816735253773,1.0347587962962963,1.0173012894375857,1.0047885562414267,1], - }; - - Object.keys(Samples).forEach(function(type) { - it('should ease ' + type, function() { - var [modeName, easingName, isFunction] = type.split('_'); - var easing = Easing[easingName]; - if (isFunction !== undefined) { - easing = easing(); - } - var computed = sampleEasingFunction(Easing[modeName](easing)); - var samples = Samples[type]; - - computed.forEach((value, key) => { - expect(value).toBeCloseTo(samples[key], 2); - }); - }); - }); -}); diff --git a/docgen/Libraries/Animated/src/__tests__/Interpolation-test.js b/docgen/Libraries/Animated/src/__tests__/Interpolation-test.js deleted file mode 100644 index 8ff46339c96..00000000000 --- a/docgen/Libraries/Animated/src/__tests__/Interpolation-test.js +++ /dev/null @@ -1,314 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ -'use strict'; - -var AnimatedInterpolation = require('../nodes/AnimatedInterpolation'); -var Easing = require('Easing'); - -describe('Interpolation', () => { - it('should work with defaults', () => { - var interpolation = AnimatedInterpolation.__createInterpolation({ - inputRange: [0, 1], - outputRange: [0, 1], - }); - - expect(interpolation(0)).toBe(0); - expect(interpolation(0.5)).toBe(0.5); - expect(interpolation(0.8)).toBe(0.8); - expect(interpolation(1)).toBe(1); - }); - - it('should work with output range', () => { - var interpolation = AnimatedInterpolation.__createInterpolation({ - inputRange: [0, 1], - outputRange: [100, 200], - }); - - expect(interpolation(0)).toBe(100); - expect(interpolation(0.5)).toBe(150); - expect(interpolation(0.8)).toBe(180); - expect(interpolation(1)).toBe(200); - }); - - it('should work with input range', () => { - var interpolation = AnimatedInterpolation.__createInterpolation({ - inputRange: [100, 200], - outputRange: [0, 1], - }); - - expect(interpolation(100)).toBe(0); - expect(interpolation(150)).toBe(0.5); - expect(interpolation(180)).toBe(0.8); - expect(interpolation(200)).toBe(1); - }); - - it('should throw for non monotonic input ranges', () => { - expect(() => - AnimatedInterpolation.__createInterpolation({ - inputRange: [0, 2, 1], - outputRange: [0, 1, 2], - }), - ).toThrow(); - - expect(() => - AnimatedInterpolation.__createInterpolation({ - inputRange: [0, 1, 2], - outputRange: [0, 3, 1], - }), - ).not.toThrow(); - }); - - it('should work with empty input range', () => { - var interpolation = AnimatedInterpolation.__createInterpolation({ - inputRange: [0, 10, 10], - outputRange: [1, 2, 3], - extrapolate: 'extend', - }); - - expect(interpolation(0)).toBe(1); - expect(interpolation(5)).toBe(1.5); - expect(interpolation(10)).toBe(2); - expect(interpolation(10.1)).toBe(3); - expect(interpolation(15)).toBe(3); - }); - - it('should work with empty output range', () => { - var interpolation = AnimatedInterpolation.__createInterpolation({ - inputRange: [1, 2, 3], - outputRange: [0, 10, 10], - extrapolate: 'extend', - }); - - expect(interpolation(0)).toBe(-10); - expect(interpolation(1.5)).toBe(5); - expect(interpolation(2)).toBe(10); - expect(interpolation(2.5)).toBe(10); - expect(interpolation(3)).toBe(10); - expect(interpolation(4)).toBe(10); - }); - - it('should work with easing', () => { - var interpolation = AnimatedInterpolation.__createInterpolation({ - inputRange: [0, 1], - outputRange: [0, 1], - easing: Easing.quad, - }); - - expect(interpolation(0)).toBe(0); - expect(interpolation(0.5)).toBe(0.25); - expect(interpolation(0.9)).toBe(0.81); - expect(interpolation(1)).toBe(1); - }); - - it('should work with extrapolate', () => { - var interpolation = AnimatedInterpolation.__createInterpolation({ - inputRange: [0, 1], - outputRange: [0, 1], - extrapolate: 'extend', - easing: Easing.quad, - }); - - expect(interpolation(-2)).toBe(4); - expect(interpolation(2)).toBe(4); - - interpolation = AnimatedInterpolation.__createInterpolation({ - inputRange: [0, 1], - outputRange: [0, 1], - extrapolate: 'clamp', - easing: Easing.quad, - }); - - expect(interpolation(-2)).toBe(0); - expect(interpolation(2)).toBe(1); - - interpolation = AnimatedInterpolation.__createInterpolation({ - inputRange: [0, 1], - outputRange: [0, 1], - extrapolate: 'identity', - easing: Easing.quad, - }); - - expect(interpolation(-2)).toBe(-2); - expect(interpolation(2)).toBe(2); - }); - - it('should work with keyframes with extrapolate', () => { - var interpolation = AnimatedInterpolation.__createInterpolation({ - inputRange: [0, 10, 100, 1000], - outputRange: [0, 5, 50, 500], - extrapolate: true, - }); - - expect(interpolation(-5)).toBe(-2.5); - expect(interpolation(0)).toBe(0); - expect(interpolation(5)).toBe(2.5); - expect(interpolation(10)).toBe(5); - expect(interpolation(50)).toBe(25); - expect(interpolation(100)).toBe(50); - expect(interpolation(500)).toBe(250); - expect(interpolation(1000)).toBe(500); - expect(interpolation(2000)).toBe(1000); - }); - - it('should work with keyframes without extrapolate', () => { - var interpolation = AnimatedInterpolation.__createInterpolation({ - inputRange: [0, 1, 2], - outputRange: [0.2, 1, 0.2], - extrapolate: 'clamp', - }); - - expect(interpolation(5)).toBeCloseTo(0.2); - }); - - it('should throw for an infinite input range', () => { - expect(() => - AnimatedInterpolation.__createInterpolation({ - inputRange: [-Infinity, Infinity], - outputRange: [0, 1], - }), - ).toThrow(); - - expect(() => - AnimatedInterpolation.__createInterpolation({ - inputRange: [-Infinity, 0, Infinity], - outputRange: [1, 2, 3], - }), - ).not.toThrow(); - }); - - it('should work with negative infinite', () => { - var interpolation = AnimatedInterpolation.__createInterpolation({ - inputRange: [-Infinity, 0], - outputRange: [-Infinity, 0], - easing: Easing.quad, - extrapolate: 'identity', - }); - - expect(interpolation(-Infinity)).toBe(-Infinity); - expect(interpolation(-100)).toBeCloseTo(-10000); - expect(interpolation(-10)).toBeCloseTo(-100); - expect(interpolation(0)).toBeCloseTo(0); - expect(interpolation(1)).toBeCloseTo(1); - expect(interpolation(100)).toBeCloseTo(100); - }); - - it('should work with positive infinite', () => { - var interpolation = AnimatedInterpolation.__createInterpolation({ - inputRange: [5, Infinity], - outputRange: [5, Infinity], - easing: Easing.quad, - extrapolate: 'identity', - }); - - expect(interpolation(-100)).toBeCloseTo(-100); - expect(interpolation(-10)).toBeCloseTo(-10); - expect(interpolation(0)).toBeCloseTo(0); - expect(interpolation(5)).toBeCloseTo(5); - expect(interpolation(6)).toBeCloseTo(5 + 1); - expect(interpolation(10)).toBeCloseTo(5 + 25); - expect(interpolation(100)).toBeCloseTo(5 + 95 * 95); - expect(interpolation(Infinity)).toBe(Infinity); - }); - - it('should work with output ranges as string', () => { - var interpolation = AnimatedInterpolation.__createInterpolation({ - inputRange: [0, 1], - outputRange: ['rgba(0, 100, 200, 0)', 'rgba(50, 150, 250, 0.4)'], - }); - - expect(interpolation(0)).toBe('rgba(0, 100, 200, 0)'); - expect(interpolation(0.5)).toBe('rgba(25, 125, 225, 0.2)'); - expect(interpolation(1)).toBe('rgba(50, 150, 250, 0.4)'); - }); - - it('should work with output ranges as short hex string', () => { - var interpolation = AnimatedInterpolation.__createInterpolation({ - inputRange: [0, 1], - outputRange: ['#024', '#9BF'], - }); - - expect(interpolation(0)).toBe('rgba(0, 34, 68, 1)'); - expect(interpolation(0.5)).toBe('rgba(77, 111, 162, 1)'); - expect(interpolation(1)).toBe('rgba(153, 187, 255, 1)'); - }); - - it('should work with output ranges as long hex string', () => { - var interpolation = AnimatedInterpolation.__createInterpolation({ - inputRange: [0, 1], - outputRange: ['#FF9500', '#87FC70'], - }); - - expect(interpolation(0)).toBe('rgba(255, 149, 0, 1)'); - expect(interpolation(0.5)).toBe('rgba(195, 201, 56, 1)'); - expect(interpolation(1)).toBe('rgba(135, 252, 112, 1)'); - }); - - it('should work with output ranges with mixed hex and rgba strings', () => { - var interpolation = AnimatedInterpolation.__createInterpolation({ - inputRange: [0, 1], - outputRange: ['rgba(100, 120, 140, .4)', '#87FC70'], - }); - - expect(interpolation(0)).toBe('rgba(100, 120, 140, 0.4)'); - expect(interpolation(0.5)).toBe('rgba(118, 186, 126, 0.7)'); - expect(interpolation(1)).toBe('rgba(135, 252, 112, 1)'); - }); - - it('should work with negative and decimal values in string ranges', () => { - var interpolation = AnimatedInterpolation.__createInterpolation({ - inputRange: [0, 1], - outputRange: ['-100.5deg', '100deg'], - }); - - expect(interpolation(0)).toBe('-100.5deg'); - expect(interpolation(0.5)).toBe('-0.25deg'); - expect(interpolation(1)).toBe('100deg'); - }); - - it('should crash when chaining an interpolation that returns a string', () => { - var interpolation = AnimatedInterpolation.__createInterpolation({ - inputRange: [0, 1], - outputRange: [0, 1], - }); - expect(() => { - interpolation('45rad'); - }).toThrow(); - }); - - it('should support a mix of color patterns', () => { - var interpolation = AnimatedInterpolation.__createInterpolation({ - inputRange: [0, 1, 2], - outputRange: ['rgba(0, 100, 200, 0)', 'rgb(50, 150, 250)', 'red'], - }); - - expect(interpolation(0)).toBe('rgba(0, 100, 200, 0)'); - expect(interpolation(0.5)).toBe('rgba(25, 125, 225, 0.5)'); - expect(interpolation(1.5)).toBe('rgba(153, 75, 125, 1)'); - expect(interpolation(2)).toBe('rgba(255, 0, 0, 1)'); - }); - - it('should crash when defining output range with different pattern', () => { - expect(() => - AnimatedInterpolation.__createInterpolation({ - inputRange: [0, 1], - outputRange: ['20deg', '30rad'], - }), - ).toThrow(); - }); - - it('should round the alpha channel of a color to the nearest thousandth', () => { - var interpolation = AnimatedInterpolation.__createInterpolation({ - inputRange: [0, 1], - outputRange: ['rgba(0, 0, 0, 0)', 'rgba(0, 0, 0, 1)'], - }); - - expect(interpolation(1e-12)).toBe('rgba(0, 0, 0, 0)'); - expect(interpolation(2 / 3)).toBe('rgba(0, 0, 0, 0.667)'); - }); -}); diff --git a/docgen/Libraries/Animated/src/__tests__/bezier-test.js b/docgen/Libraries/Animated/src/__tests__/bezier-test.js deleted file mode 100644 index 59cf7895ceb..00000000000 --- a/docgen/Libraries/Animated/src/__tests__/bezier-test.js +++ /dev/null @@ -1,105 +0,0 @@ -/** - * BezierEasing - use bezier curve for transition easing function - * https://github.com/gre/bezier-easing - * - * @copyright 2014-2015 Gaëtan Renaudeau. MIT License. - * @noflow - */ - -/* eslint-disable */ - -'use strict'; - -var bezier = require('bezier'); - -var identity = function (x) { return x; }; - -function assertClose (a, b, precision = 3) { - expect(a).toBeCloseTo(b, precision); -} - -function makeAssertCloseWithPrecision (precision) { - return function (a, b) { - assertClose(a, b, precision); - }; -} - -function allEquals (be1, be2, samples, assertion) { - if (!assertion) assertion = assertClose; - for (var i=0; i<=samples; ++i) { - var x = i / samples; - assertion(be1(x), be2(x)); - } -} - -function repeat (n) { - return function (f) { - for (var i=0; i void; - -export type AnimationConfig = { - isInteraction?: boolean, - useNativeDriver?: boolean, - onComplete?: ?EndCallback, - iterations?: number, -}; - -// Important note: start() and stop() will only be called at most once. -// Once an animation has been stopped or finished its course, it will -// not be reused. -class Animation { - __active: boolean; - __isInteraction: boolean; - __nativeId: number; - __onEnd: ?EndCallback; - __iterations: number; - start( - fromValue: number, - onUpdate: (value: number) => void, - onEnd: ?EndCallback, - previousAnimation: ?Animation, - animatedValue: AnimatedValue, - ): void {} - stop(): void { - if (this.__nativeId) { - NativeAnimatedHelper.API.stopAnimation(this.__nativeId); - } - } - __getNativeAnimationConfig(): any { - // Subclasses that have corresponding animation implementation done in native - // should override this method - throw new Error('This animation type cannot be offloaded to native'); - } - // Helper function for subclasses to make sure onEnd is only called once. - __debouncedOnEnd(result: EndResult): void { - const onEnd = this.__onEnd; - this.__onEnd = null; - onEnd && onEnd(result); - } - __startNativeAnimation(animatedValue: AnimatedValue): void { - animatedValue.__makeNative(); - this.__nativeId = NativeAnimatedHelper.generateNewAnimationId(); - NativeAnimatedHelper.API.startAnimatingNode( - this.__nativeId, - animatedValue.__getNativeTag(), - this.__getNativeAnimationConfig(), - this.__debouncedOnEnd.bind(this), - ); - } -} - -module.exports = Animation; diff --git a/docgen/Libraries/Animated/src/animations/DecayAnimation.js b/docgen/Libraries/Animated/src/animations/DecayAnimation.js deleted file mode 100644 index 652bd9c9d3b..00000000000 --- a/docgen/Libraries/Animated/src/animations/DecayAnimation.js +++ /dev/null @@ -1,112 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule DecayAnimation - * @flow - * @format - */ -'use strict'; - -const Animation = require('./Animation'); - -const {shouldUseNativeDriver} = require('../NativeAnimatedHelper'); - -import type {AnimationConfig, EndCallback} from './Animation'; -import type AnimatedValue from '../nodes/AnimatedValue'; - -export type DecayAnimationConfig = AnimationConfig & { - velocity: number | {x: number, y: number}, - deceleration?: number, -}; - -export type DecayAnimationConfigSingle = AnimationConfig & { - velocity: number, - deceleration?: number, -}; - -class DecayAnimation extends Animation { - _startTime: number; - _lastValue: number; - _fromValue: number; - _deceleration: number; - _velocity: number; - _onUpdate: (value: number) => void; - _animationFrame: any; - _useNativeDriver: boolean; - - constructor(config: DecayAnimationConfigSingle) { - super(); - this._deceleration = - config.deceleration !== undefined ? config.deceleration : 0.998; - this._velocity = config.velocity; - this._useNativeDriver = shouldUseNativeDriver(config); - this.__isInteraction = - config.isInteraction !== undefined ? config.isInteraction : true; - this.__iterations = config.iterations !== undefined ? config.iterations : 1; - } - - __getNativeAnimationConfig() { - return { - type: 'decay', - deceleration: this._deceleration, - velocity: this._velocity, - iterations: this.__iterations, - }; - } - - start( - fromValue: number, - onUpdate: (value: number) => void, - onEnd: ?EndCallback, - previousAnimation: ?Animation, - animatedValue: AnimatedValue, - ): void { - this.__active = true; - this._lastValue = fromValue; - this._fromValue = fromValue; - this._onUpdate = onUpdate; - this.__onEnd = onEnd; - this._startTime = Date.now(); - if (this._useNativeDriver) { - this.__startNativeAnimation(animatedValue); - } else { - this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this)); - } - } - - onUpdate(): void { - const now = Date.now(); - - const value = - this._fromValue + - this._velocity / - (1 - this._deceleration) * - (1 - Math.exp(-(1 - this._deceleration) * (now - this._startTime))); - - this._onUpdate(value); - - if (Math.abs(this._lastValue - value) < 0.1) { - this.__debouncedOnEnd({finished: true}); - return; - } - - this._lastValue = value; - if (this.__active) { - this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this)); - } - } - - stop(): void { - super.stop(); - this.__active = false; - global.cancelAnimationFrame(this._animationFrame); - this.__debouncedOnEnd({finished: false}); - } -} - -module.exports = DecayAnimation; diff --git a/docgen/Libraries/Animated/src/animations/SpringAnimation.js b/docgen/Libraries/Animated/src/animations/SpringAnimation.js deleted file mode 100644 index 13f8c745b6e..00000000000 --- a/docgen/Libraries/Animated/src/animations/SpringAnimation.js +++ /dev/null @@ -1,291 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule SpringAnimation - * @flow - * @format - */ -'use strict'; - -const AnimatedValue = require('../nodes/AnimatedValue'); -const AnimatedValueXY = require('../nodes/AnimatedValueXY'); -const Animation = require('./Animation'); -const SpringConfig = require('../SpringConfig'); - -const invariant = require('fbjs/lib/invariant'); -const {shouldUseNativeDriver} = require('../NativeAnimatedHelper'); - -import type {AnimationConfig, EndCallback} from './Animation'; - -export type SpringAnimationConfig = AnimationConfig & { - toValue: number | AnimatedValue | {x: number, y: number} | AnimatedValueXY, - overshootClamping?: boolean, - restDisplacementThreshold?: number, - restSpeedThreshold?: number, - velocity?: number | {x: number, y: number}, - bounciness?: number, - speed?: number, - tension?: number, - friction?: number, - delay?: number, -}; - -export type SpringAnimationConfigSingle = AnimationConfig & { - toValue: number | AnimatedValue, - overshootClamping?: boolean, - restDisplacementThreshold?: number, - restSpeedThreshold?: number, - velocity?: number, - bounciness?: number, - speed?: number, - tension?: number, - friction?: number, - delay?: number, -}; - -function withDefault(value: ?T, defaultValue: T): T { - if (value === undefined || value === null) { - return defaultValue; - } - return value; -} - -class SpringAnimation extends Animation { - _overshootClamping: boolean; - _restDisplacementThreshold: number; - _restSpeedThreshold: number; - _initialVelocity: ?number; - _lastVelocity: number; - _startPosition: number; - _lastPosition: number; - _fromValue: number; - _toValue: any; - _tension: number; - _friction: number; - _delay: number; - _timeout: any; - _lastTime: number; - _onUpdate: (value: number) => void; - _animationFrame: any; - _useNativeDriver: boolean; - - constructor(config: SpringAnimationConfigSingle) { - super(); - - this._overshootClamping = withDefault(config.overshootClamping, false); - this._restDisplacementThreshold = withDefault( - config.restDisplacementThreshold, - 0.001, - ); - this._restSpeedThreshold = withDefault(config.restSpeedThreshold, 0.001); - this._initialVelocity = config.velocity; - this._lastVelocity = withDefault(config.velocity, 0); - this._toValue = config.toValue; - this._delay = withDefault(config.delay, 0); - this._useNativeDriver = shouldUseNativeDriver(config); - this.__isInteraction = - config.isInteraction !== undefined ? config.isInteraction : true; - this.__iterations = config.iterations !== undefined ? config.iterations : 1; - - let springConfig; - if (config.bounciness !== undefined || config.speed !== undefined) { - invariant( - config.tension === undefined && config.friction === undefined, - 'You can only define bounciness/speed or tension/friction but not both', - ); - springConfig = SpringConfig.fromBouncinessAndSpeed( - withDefault(config.bounciness, 8), - withDefault(config.speed, 12), - ); - } else { - springConfig = SpringConfig.fromOrigamiTensionAndFriction( - withDefault(config.tension, 40), - withDefault(config.friction, 7), - ); - } - this._tension = springConfig.tension; - this._friction = springConfig.friction; - } - - __getNativeAnimationConfig() { - return { - type: 'spring', - overshootClamping: this._overshootClamping, - restDisplacementThreshold: this._restDisplacementThreshold, - restSpeedThreshold: this._restSpeedThreshold, - tension: this._tension, - friction: this._friction, - initialVelocity: withDefault(this._initialVelocity, this._lastVelocity), - toValue: this._toValue, - iterations: this.__iterations, - }; - } - - start( - fromValue: number, - onUpdate: (value: number) => void, - onEnd: ?EndCallback, - previousAnimation: ?Animation, - animatedValue: AnimatedValue, - ): void { - this.__active = true; - this._startPosition = fromValue; - this._lastPosition = this._startPosition; - - this._onUpdate = onUpdate; - this.__onEnd = onEnd; - this._lastTime = Date.now(); - - if (previousAnimation instanceof SpringAnimation) { - const internalState = previousAnimation.getInternalState(); - this._lastPosition = internalState.lastPosition; - this._lastVelocity = internalState.lastVelocity; - this._lastTime = internalState.lastTime; - } - if (this._initialVelocity !== undefined && this._initialVelocity !== null) { - this._lastVelocity = this._initialVelocity; - } - - const start = () => { - if (this._useNativeDriver) { - this.__startNativeAnimation(animatedValue); - } else { - this.onUpdate(); - } - }; - - // If this._delay is more than 0, we start after the timeout. - if (this._delay) { - this._timeout = setTimeout(start, this._delay); - } else { - start(); - } - } - - getInternalState(): Object { - return { - lastPosition: this._lastPosition, - lastVelocity: this._lastVelocity, - lastTime: this._lastTime, - }; - } - - onUpdate(): void { - let position = this._lastPosition; - let velocity = this._lastVelocity; - - let tempPosition = this._lastPosition; - let tempVelocity = this._lastVelocity; - - // If for some reason we lost a lot of frames (e.g. process large payload or - // stopped in the debugger), we only advance by 4 frames worth of - // computation and will continue on the next frame. It's better to have it - // running at faster speed than jumping to the end. - const MAX_STEPS = 64; - let now = Date.now(); - if (now > this._lastTime + MAX_STEPS) { - now = this._lastTime + MAX_STEPS; - } - - // We are using a fixed time step and a maximum number of iterations. - // The following post provides a lot of thoughts into how to build this - // loop: http://gafferongames.com/game-physics/fix-your-timestep/ - const TIMESTEP_MSEC = 1; - const numSteps = Math.floor((now - this._lastTime) / TIMESTEP_MSEC); - - for (let i = 0; i < numSteps; ++i) { - // Velocity is based on seconds instead of milliseconds - const step = TIMESTEP_MSEC / 1000; - - // This is using RK4. A good blog post to understand how it works: - // http://gafferongames.com/game-physics/integration-basics/ - const aVelocity = velocity; - const aAcceleration = - this._tension * (this._toValue - tempPosition) - - this._friction * tempVelocity; - tempPosition = position + aVelocity * step / 2; - tempVelocity = velocity + aAcceleration * step / 2; - - const bVelocity = tempVelocity; - const bAcceleration = - this._tension * (this._toValue - tempPosition) - - this._friction * tempVelocity; - tempPosition = position + bVelocity * step / 2; - tempVelocity = velocity + bAcceleration * step / 2; - - const cVelocity = tempVelocity; - const cAcceleration = - this._tension * (this._toValue - tempPosition) - - this._friction * tempVelocity; - tempPosition = position + cVelocity * step / 2; - tempVelocity = velocity + cAcceleration * step / 2; - - const dVelocity = tempVelocity; - const dAcceleration = - this._tension * (this._toValue - tempPosition) - - this._friction * tempVelocity; - tempPosition = position + cVelocity * step / 2; - tempVelocity = velocity + cAcceleration * step / 2; - - const dxdt = (aVelocity + 2 * (bVelocity + cVelocity) + dVelocity) / 6; - const dvdt = - (aAcceleration + 2 * (bAcceleration + cAcceleration) + dAcceleration) / - 6; - - position += dxdt * step; - velocity += dvdt * step; - } - - this._lastTime = now; - this._lastPosition = position; - this._lastVelocity = velocity; - - this._onUpdate(position); - if (!this.__active) { - // a listener might have stopped us in _onUpdate - return; - } - - // Conditions for stopping the spring animation - let isOvershooting = false; - if (this._overshootClamping && this._tension !== 0) { - if (this._startPosition < this._toValue) { - isOvershooting = position > this._toValue; - } else { - isOvershooting = position < this._toValue; - } - } - const isVelocity = Math.abs(velocity) <= this._restSpeedThreshold; - let isDisplacement = true; - if (this._tension !== 0) { - isDisplacement = - Math.abs(this._toValue - position) <= this._restDisplacementThreshold; - } - - if (isOvershooting || (isVelocity && isDisplacement)) { - if (this._tension !== 0) { - // Ensure that we end up with a round value - this._onUpdate(this._toValue); - } - - this.__debouncedOnEnd({finished: true}); - return; - } - this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this)); - } - - stop(): void { - super.stop(); - this.__active = false; - clearTimeout(this._timeout); - global.cancelAnimationFrame(this._animationFrame); - this.__debouncedOnEnd({finished: false}); - } -} - -module.exports = SpringAnimation; diff --git a/docgen/Libraries/Animated/src/animations/TimingAnimation.js b/docgen/Libraries/Animated/src/animations/TimingAnimation.js deleted file mode 100644 index a3db014fe11..00000000000 --- a/docgen/Libraries/Animated/src/animations/TimingAnimation.js +++ /dev/null @@ -1,155 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule TimingAnimation - * @flow - * @format - */ -'use strict'; - -const AnimatedValue = require('../nodes/AnimatedValue'); -const AnimatedValueXY = require('../nodes/AnimatedValueXY'); -const Animation = require('./Animation'); - -const {shouldUseNativeDriver} = require('../NativeAnimatedHelper'); - -import type {AnimationConfig, EndCallback} from './Animation'; - -export type TimingAnimationConfig = AnimationConfig & { - toValue: number | AnimatedValue | {x: number, y: number} | AnimatedValueXY, - easing?: (value: number) => number, - duration?: number, - delay?: number, -}; - -export type TimingAnimationConfigSingle = AnimationConfig & { - toValue: number | AnimatedValue, - easing?: (value: number) => number, - duration?: number, - delay?: number, -}; - -let _easeInOut; -function easeInOut() { - if (!_easeInOut) { - const Easing = require('Easing'); - _easeInOut = Easing.inOut(Easing.ease); - } - return _easeInOut; -} - -class TimingAnimation extends Animation { - _startTime: number; - _fromValue: number; - _toValue: any; - _duration: number; - _delay: number; - _easing: (value: number) => number; - _onUpdate: (value: number) => void; - _animationFrame: any; - _timeout: any; - _useNativeDriver: boolean; - - constructor(config: TimingAnimationConfigSingle) { - super(); - this._toValue = config.toValue; - this._easing = config.easing !== undefined ? config.easing : easeInOut(); - this._duration = config.duration !== undefined ? config.duration : 500; - this._delay = config.delay !== undefined ? config.delay : 0; - this.__iterations = config.iterations !== undefined ? config.iterations : 1; - this.__isInteraction = - config.isInteraction !== undefined ? config.isInteraction : true; - this._useNativeDriver = shouldUseNativeDriver(config); - } - - __getNativeAnimationConfig(): any { - const frameDuration = 1000.0 / 60.0; - const frames = []; - for (let dt = 0.0; dt < this._duration; dt += frameDuration) { - frames.push(this._easing(dt / this._duration)); - } - frames.push(this._easing(1)); - return { - type: 'frames', - frames, - toValue: this._toValue, - iterations: this.__iterations, - }; - } - - start( - fromValue: number, - onUpdate: (value: number) => void, - onEnd: ?EndCallback, - previousAnimation: ?Animation, - animatedValue: AnimatedValue, - ): void { - this.__active = true; - this._fromValue = fromValue; - this._onUpdate = onUpdate; - this.__onEnd = onEnd; - - const start = () => { - // Animations that sometimes have 0 duration and sometimes do not - // still need to use the native driver when duration is 0 so as to - // not cause intermixed JS and native animations. - if (this._duration === 0 && !this._useNativeDriver) { - this._onUpdate(this._toValue); - this.__debouncedOnEnd({finished: true}); - } else { - this._startTime = Date.now(); - if (this._useNativeDriver) { - this.__startNativeAnimation(animatedValue); - } else { - this._animationFrame = requestAnimationFrame( - this.onUpdate.bind(this), - ); - } - } - }; - if (this._delay) { - this._timeout = setTimeout(start, this._delay); - } else { - start(); - } - } - - onUpdate(): void { - const now = Date.now(); - if (now >= this._startTime + this._duration) { - if (this._duration === 0) { - this._onUpdate(this._toValue); - } else { - this._onUpdate( - this._fromValue + this._easing(1) * (this._toValue - this._fromValue), - ); - } - this.__debouncedOnEnd({finished: true}); - return; - } - - this._onUpdate( - this._fromValue + - this._easing((now - this._startTime) / this._duration) * - (this._toValue - this._fromValue), - ); - if (this.__active) { - this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this)); - } - } - - stop(): void { - super.stop(); - this.__active = false; - clearTimeout(this._timeout); - global.cancelAnimationFrame(this._animationFrame); - this.__debouncedOnEnd({finished: false}); - } -} - -module.exports = TimingAnimation; diff --git a/docgen/Libraries/Animated/src/bezier.js b/docgen/Libraries/Animated/src/bezier.js deleted file mode 100644 index 2bd59493006..00000000000 --- a/docgen/Libraries/Animated/src/bezier.js +++ /dev/null @@ -1,108 +0,0 @@ -/** - * BezierEasing - use bezier curve for transition easing function - * https://github.com/gre/bezier-easing - * - * @copyright 2014-2015 Gaëtan Renaudeau. MIT License. - * @providesModule bezier - * @noflow - */ -'use strict'; - - // These values are established by empiricism with tests (tradeoff: performance VS precision) - var NEWTON_ITERATIONS = 4; - var NEWTON_MIN_SLOPE = 0.001; - var SUBDIVISION_PRECISION = 0.0000001; - var SUBDIVISION_MAX_ITERATIONS = 10; - - var kSplineTableSize = 11; - var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0); - - var float32ArraySupported = typeof Float32Array === 'function'; - - function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; } - function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; } - function C (aA1) { return 3.0 * aA1; } - - // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2. - function calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; } - - // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2. - function getSlope (aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); } - - function binarySubdivide (aX, aA, aB, mX1, mX2) { - var currentX, currentT, i = 0; - do { - currentT = aA + (aB - aA) / 2.0; - currentX = calcBezier(currentT, mX1, mX2) - aX; - if (currentX > 0.0) { - aB = currentT; - } else { - aA = currentT; - } - } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS); - return currentT; - } - - function newtonRaphsonIterate (aX, aGuessT, mX1, mX2) { - for (var i = 0; i < NEWTON_ITERATIONS; ++i) { - var currentSlope = getSlope(aGuessT, mX1, mX2); - if (currentSlope === 0.0) { - return aGuessT; - } - var currentX = calcBezier(aGuessT, mX1, mX2) - aX; - aGuessT -= currentX / currentSlope; - } - return aGuessT; - } - - module.exports = function bezier (mX1, mY1, mX2, mY2) { - if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) { // eslint-disable-line yoda - throw new Error('bezier x values must be in [0, 1] range'); - } - - // Precompute samples table - var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize); - if (mX1 !== mY1 || mX2 !== mY2) { - for (var i = 0; i < kSplineTableSize; ++i) { - sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2); - } - } - - function getTForX (aX) { - var intervalStart = 0.0; - var currentSample = 1; - var lastSample = kSplineTableSize - 1; - - for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) { - intervalStart += kSampleStepSize; - } - --currentSample; - - // Interpolate to provide an initial guess for t - var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]); - var guessForT = intervalStart + dist * kSampleStepSize; - - var initialSlope = getSlope(guessForT, mX1, mX2); - if (initialSlope >= NEWTON_MIN_SLOPE) { - return newtonRaphsonIterate(aX, guessForT, mX1, mX2); - } else if (initialSlope === 0.0) { - return guessForT; - } else { - return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2); - } - } - - return function BezierEasing (x) { - if (mX1 === mY1 && mX2 === mY2) { - return x; // linear - } - // Because JavaScript number are imprecise, we should guarantee the extremes are right. - if (x === 0) { - return 0; - } - if (x === 1) { - return 1; - } - return calcBezier(getTForX(x), mY1, mY2); - }; - }; diff --git a/docgen/Libraries/Animated/src/createAnimatedComponent.js b/docgen/Libraries/Animated/src/createAnimatedComponent.js deleted file mode 100644 index f5e5200babe..00000000000 --- a/docgen/Libraries/Animated/src/createAnimatedComponent.js +++ /dev/null @@ -1,193 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule createAnimatedComponent - * @flow - * @format - */ -'use strict'; - -const {AnimatedEvent} = require('./AnimatedEvent'); -const AnimatedProps = require('./nodes/AnimatedProps'); -const React = require('React'); -const ViewStylePropTypes = require('ViewStylePropTypes'); - -function createAnimatedComponent(Component: any): any { - class AnimatedComponent extends React.Component { - _component: any; - _prevComponent: any; - _propsAnimated: AnimatedProps; - _eventDetachers: Array = []; - _setComponentRef: Function; - - static __skipSetNativeProps_FOR_TESTS_ONLY = false; - - constructor(props: Object) { - super(props); - this._setComponentRef = this._setComponentRef.bind(this); - } - - componentWillUnmount() { - this._propsAnimated && this._propsAnimated.__detach(); - this._detachNativeEvents(); - } - - setNativeProps(props) { - this._component.setNativeProps(props); - } - - componentWillMount() { - this._attachProps(this.props); - } - - componentDidMount() { - this._propsAnimated.setNativeView(this._component); - this._attachNativeEvents(); - } - - _attachNativeEvents() { - // Make sure to get the scrollable node for components that implement - // `ScrollResponder.Mixin`. - const scrollableNode = this._component.getScrollableNode - ? this._component.getScrollableNode() - : this._component; - - for (const key in this.props) { - const prop = this.props[key]; - if (prop instanceof AnimatedEvent && prop.__isNative) { - prop.__attach(scrollableNode, key); - this._eventDetachers.push(() => prop.__detach(scrollableNode, key)); - } - } - } - - _detachNativeEvents() { - this._eventDetachers.forEach(remove => remove()); - this._eventDetachers = []; - } - - _attachProps(nextProps) { - const oldPropsAnimated = this._propsAnimated; - - // The system is best designed when setNativeProps is implemented. It is - // able to avoid re-rendering and directly set the attributes that - // changed. However, setNativeProps can only be implemented on leaf - // native components. If you want to animate a composite component, you - // need to re-render it. In this case, we have a fallback that uses - // forceUpdate. - const callback = () => { - if ( - !AnimatedComponent.__skipSetNativeProps_FOR_TESTS_ONLY && - this._component.setNativeProps - ) { - if (!this._propsAnimated.__isNative) { - this._component.setNativeProps( - this._propsAnimated.__getAnimatedValue(), - ); - } else { - throw new Error( - 'Attempting to run JS driven animation on animated ' + - 'node that has been moved to "native" earlier by starting an ' + - 'animation with `useNativeDriver: true`', - ); - } - } else { - this.forceUpdate(); - } - }; - - this._propsAnimated = new AnimatedProps(nextProps, callback); - - // When you call detach, it removes the element from the parent list - // of children. If it goes to 0, then the parent also detaches itself - // and so on. - // An optimization is to attach the new elements and THEN detach the old - // ones instead of detaching and THEN attaching. - // This way the intermediate state isn't to go to 0 and trigger - // this expensive recursive detaching to then re-attach everything on - // the very next operation. - oldPropsAnimated && oldPropsAnimated.__detach(); - } - - componentWillReceiveProps(newProps) { - this._attachProps(newProps); - } - - componentDidUpdate(prevProps) { - if (this._component !== this._prevComponent) { - this._propsAnimated.setNativeView(this._component); - } - if (this._component !== this._prevComponent || prevProps !== this.props) { - this._detachNativeEvents(); - this._attachNativeEvents(); - } - } - - render() { - const props = this._propsAnimated.__getValue(); - return ( - - ); - } - - _setComponentRef(c) { - this._prevComponent = this._component; - this._component = c; - } - - // A third party library can use getNode() - // to get the node reference of the decorated component - getNode() { - return this._component; - } - } - - // ReactNative `View.propTypes` have been deprecated in favor of - // `ViewPropTypes`. In their place a temporary getter has been added with a - // deprecated warning message. Avoid triggering that warning here by using - // temporary workaround, __propTypesSecretDontUseThesePlease. - // TODO (bvaughn) Revert this particular change any time after April 1 - const propTypes = - Component.__propTypesSecretDontUseThesePlease || Component.propTypes; - - AnimatedComponent.propTypes = { - style: function(props, propName, componentName) { - if (!propTypes) { - return; - } - - for (const key in ViewStylePropTypes) { - if (!propTypes[key] && props[key] !== undefined) { - console.warn( - 'You are setting the style `{ ' + - key + - ': ... }` as a prop. You ' + - 'should nest it in a style object. ' + - 'E.g. `{ style: { ' + - key + - ': ... } }`', - ); - } - } - }, - }; - - return AnimatedComponent; -} - -module.exports = createAnimatedComponent; diff --git a/docgen/Libraries/Animated/src/nodes/AnimatedAddition.js b/docgen/Libraries/Animated/src/nodes/AnimatedAddition.js deleted file mode 100644 index 53d338836ec..00000000000 --- a/docgen/Libraries/Animated/src/nodes/AnimatedAddition.js +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule AnimatedAddition - * @flow - * @format - */ -'use strict'; - -const AnimatedInterpolation = require('./AnimatedInterpolation'); -const AnimatedNode = require('./AnimatedNode'); -const AnimatedValue = require('./AnimatedValue'); -const AnimatedWithChildren = require('./AnimatedWithChildren'); - -import type {InterpolationConfigType} from './AnimatedInterpolation'; - -class AnimatedAddition extends AnimatedWithChildren { - _a: AnimatedNode; - _b: AnimatedNode; - - constructor(a: AnimatedNode | number, b: AnimatedNode | number) { - super(); - this._a = typeof a === 'number' ? new AnimatedValue(a) : a; - this._b = typeof b === 'number' ? new AnimatedValue(b) : b; - } - - __makeNative() { - this._a.__makeNative(); - this._b.__makeNative(); - super.__makeNative(); - } - - __getValue(): number { - return this._a.__getValue() + this._b.__getValue(); - } - - interpolate(config: InterpolationConfigType): AnimatedInterpolation { - return new AnimatedInterpolation(this, config); - } - - __attach(): void { - this._a.__addChild(this); - this._b.__addChild(this); - } - - __detach(): void { - this._a.__removeChild(this); - this._b.__removeChild(this); - super.__detach(); - } - - __getNativeConfig(): any { - return { - type: 'addition', - input: [this._a.__getNativeTag(), this._b.__getNativeTag()], - }; - } -} - -module.exports = AnimatedAddition; diff --git a/docgen/Libraries/Animated/src/nodes/AnimatedDiffClamp.js b/docgen/Libraries/Animated/src/nodes/AnimatedDiffClamp.js deleted file mode 100644 index eac26a10271..00000000000 --- a/docgen/Libraries/Animated/src/nodes/AnimatedDiffClamp.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule AnimatedDiffClamp - * @flow - * @format - */ -'use strict'; - -const AnimatedInterpolation = require('./AnimatedInterpolation'); -const AnimatedNode = require('./AnimatedNode'); -const AnimatedWithChildren = require('./AnimatedWithChildren'); - -import type {InterpolationConfigType} from './AnimatedInterpolation'; - -class AnimatedDiffClamp extends AnimatedWithChildren { - _a: AnimatedNode; - _min: number; - _max: number; - _value: number; - _lastValue: number; - - constructor(a: AnimatedNode, min: number, max: number) { - super(); - - this._a = a; - this._min = min; - this._max = max; - this._value = this._lastValue = this._a.__getValue(); - } - - __makeNative() { - this._a.__makeNative(); - super.__makeNative(); - } - - interpolate(config: InterpolationConfigType): AnimatedInterpolation { - return new AnimatedInterpolation(this, config); - } - - __getValue(): number { - const value = this._a.__getValue(); - const diff = value - this._lastValue; - this._lastValue = value; - this._value = Math.min(Math.max(this._value + diff, this._min), this._max); - return this._value; - } - - __attach(): void { - this._a.__addChild(this); - } - - __detach(): void { - this._a.__removeChild(this); - super.__detach(); - } - - __getNativeConfig(): any { - return { - type: 'diffclamp', - input: this._a.__getNativeTag(), - min: this._min, - max: this._max, - }; - } -} - -module.exports = AnimatedDiffClamp; diff --git a/docgen/Libraries/Animated/src/nodes/AnimatedDivision.js b/docgen/Libraries/Animated/src/nodes/AnimatedDivision.js deleted file mode 100644 index 8d658f458a5..00000000000 --- a/docgen/Libraries/Animated/src/nodes/AnimatedDivision.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule AnimatedDivision - * @flow - * @format - */ -'use strict'; - -const AnimatedInterpolation = require('./AnimatedInterpolation'); -const AnimatedNode = require('./AnimatedNode'); -const AnimatedValue = require('./AnimatedValue'); -const AnimatedWithChildren = require('./AnimatedWithChildren'); - -import type {InterpolationConfigType} from './AnimatedInterpolation'; - -class AnimatedDivision extends AnimatedWithChildren { - _a: AnimatedNode; - _b: AnimatedNode; - - constructor(a: AnimatedNode | number, b: AnimatedNode | number) { - super(); - this._a = typeof a === 'number' ? new AnimatedValue(a) : a; - this._b = typeof b === 'number' ? new AnimatedValue(b) : b; - } - - __makeNative() { - this._a.__makeNative(); - this._b.__makeNative(); - super.__makeNative(); - } - - __getValue(): number { - const a = this._a.__getValue(); - const b = this._b.__getValue(); - if (b === 0) { - console.error('Detected division by zero in AnimatedDivision'); - } - return a / b; - } - - interpolate(config: InterpolationConfigType): AnimatedInterpolation { - return new AnimatedInterpolation(this, config); - } - - __attach(): void { - this._a.__addChild(this); - this._b.__addChild(this); - } - - __detach(): void { - this._a.__removeChild(this); - this._b.__removeChild(this); - super.__detach(); - } - - __getNativeConfig(): any { - return { - type: 'division', - input: [this._a.__getNativeTag(), this._b.__getNativeTag()], - }; - } -} - -module.exports = AnimatedDivision; diff --git a/docgen/Libraries/Animated/src/nodes/AnimatedInterpolation.js b/docgen/Libraries/Animated/src/nodes/AnimatedInterpolation.js deleted file mode 100644 index cfe9e701e4d..00000000000 --- a/docgen/Libraries/Animated/src/nodes/AnimatedInterpolation.js +++ /dev/null @@ -1,388 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule AnimatedInterpolation - * @flow - * @format - */ -/* eslint no-bitwise: 0 */ -'use strict'; - -const AnimatedNode = require('./AnimatedNode'); -const AnimatedWithChildren = require('./AnimatedWithChildren'); -const NativeAnimatedHelper = require('../NativeAnimatedHelper'); - -const invariant = require('fbjs/lib/invariant'); -const normalizeColor = require('normalizeColor'); - -type ExtrapolateType = 'extend' | 'identity' | 'clamp'; - -export type InterpolationConfigType = { - inputRange: Array, - /* $FlowFixMe(>=0.38.0 site=react_native_fb,react_native_oss) - Flow error - * detected during the deployment of v0.38.0. To see the error, remove this - * comment and run flow - */ - outputRange: Array | Array, - easing?: (input: number) => number, - extrapolate?: ExtrapolateType, - extrapolateLeft?: ExtrapolateType, - extrapolateRight?: ExtrapolateType, -}; - -const linear = t => t; - -/** - * Very handy helper to map input ranges to output ranges with an easing - * function and custom behavior outside of the ranges. - */ -function createInterpolation( - config: InterpolationConfigType, -): (input: number) => number | string { - if (config.outputRange && typeof config.outputRange[0] === 'string') { - return createInterpolationFromStringOutputRange(config); - } - - const outputRange: Array = (config.outputRange: any); - checkInfiniteRange('outputRange', outputRange); - - const inputRange = config.inputRange; - checkInfiniteRange('inputRange', inputRange); - checkValidInputRange(inputRange); - - invariant( - inputRange.length === outputRange.length, - 'inputRange (' + - inputRange.length + - ') and outputRange (' + - outputRange.length + - ') must have the same length', - ); - - const easing = config.easing || linear; - - let extrapolateLeft: ExtrapolateType = 'extend'; - if (config.extrapolateLeft !== undefined) { - extrapolateLeft = config.extrapolateLeft; - } else if (config.extrapolate !== undefined) { - extrapolateLeft = config.extrapolate; - } - - let extrapolateRight: ExtrapolateType = 'extend'; - if (config.extrapolateRight !== undefined) { - extrapolateRight = config.extrapolateRight; - } else if (config.extrapolate !== undefined) { - extrapolateRight = config.extrapolate; - } - - return input => { - invariant( - typeof input === 'number', - 'Cannot interpolation an input which is not a number', - ); - - const range = findRange(input, inputRange); - return interpolate( - input, - inputRange[range], - inputRange[range + 1], - outputRange[range], - outputRange[range + 1], - easing, - extrapolateLeft, - extrapolateRight, - ); - }; -} - -function interpolate( - input: number, - inputMin: number, - inputMax: number, - outputMin: number, - outputMax: number, - easing: (input: number) => number, - extrapolateLeft: ExtrapolateType, - extrapolateRight: ExtrapolateType, -) { - let result = input; - - // Extrapolate - if (result < inputMin) { - if (extrapolateLeft === 'identity') { - return result; - } else if (extrapolateLeft === 'clamp') { - result = inputMin; - } else if (extrapolateLeft === 'extend') { - // noop - } - } - - if (result > inputMax) { - if (extrapolateRight === 'identity') { - return result; - } else if (extrapolateRight === 'clamp') { - result = inputMax; - } else if (extrapolateRight === 'extend') { - // noop - } - } - - if (outputMin === outputMax) { - return outputMin; - } - - if (inputMin === inputMax) { - if (input <= inputMin) { - return outputMin; - } - return outputMax; - } - - // Input Range - if (inputMin === -Infinity) { - result = -result; - } else if (inputMax === Infinity) { - result = result - inputMin; - } else { - result = (result - inputMin) / (inputMax - inputMin); - } - - // Easing - result = easing(result); - - // Output Range - if (outputMin === -Infinity) { - result = -result; - } else if (outputMax === Infinity) { - result = result + outputMin; - } else { - result = result * (outputMax - outputMin) + outputMin; - } - - return result; -} - -function colorToRgba(input: string): string { - let int32Color = normalizeColor(input); - if (int32Color === null) { - return input; - } - - int32Color = int32Color || 0; - - const r = (int32Color & 0xff000000) >>> 24; - const g = (int32Color & 0x00ff0000) >>> 16; - const b = (int32Color & 0x0000ff00) >>> 8; - const a = (int32Color & 0x000000ff) / 255; - - return `rgba(${r}, ${g}, ${b}, ${a})`; -} - -const stringShapeRegex = /[0-9\.-]+/g; - -/** - * Supports string shapes by extracting numbers so new values can be computed, - * and recombines those values into new strings of the same shape. Supports - * things like: - * - * rgba(123, 42, 99, 0.36) // colors - * -45deg // values with units - */ -function createInterpolationFromStringOutputRange( - config: InterpolationConfigType, -): (input: number) => string { - let outputRange: Array = (config.outputRange: any); - invariant(outputRange.length >= 2, 'Bad output range'); - outputRange = outputRange.map(colorToRgba); - checkPattern(outputRange); - - // ['rgba(0, 100, 200, 0)', 'rgba(50, 150, 250, 0.5)'] - // -> - // [ - // [0, 50], - // [100, 150], - // [200, 250], - // [0, 0.5], - // ] - /* $FlowFixMe(>=0.18.0): `outputRange[0].match()` can return `null`. Need to - * guard against this possibility. - */ - const outputRanges = outputRange[0].match(stringShapeRegex).map(() => []); - outputRange.forEach(value => { - /* $FlowFixMe(>=0.18.0): `value.match()` can return `null`. Need to guard - * against this possibility. - */ - value.match(stringShapeRegex).forEach((number, i) => { - outputRanges[i].push(+number); - }); - }); - - /* $FlowFixMe(>=0.18.0): `outputRange[0].match()` can return `null`. Need to - * guard against this possibility. - */ - const interpolations = outputRange[0] - .match(stringShapeRegex) - .map((value, i) => { - return createInterpolation({ - ...config, - outputRange: outputRanges[i], - }); - }); - - // rgba requires that the r,g,b are integers.... so we want to round them, but we *dont* want to - // round the opacity (4th column). - const shouldRound = isRgbOrRgba(outputRange[0]); - - return input => { - let i = 0; - // 'rgba(0, 100, 200, 0)' - // -> - // 'rgba(${interpolations[0](input)}, ${interpolations[1](input)}, ...' - return outputRange[0].replace(stringShapeRegex, () => { - const val = +interpolations[i++](input); - const rounded = - shouldRound && i < 4 ? Math.round(val) : Math.round(val * 1000) / 1000; - return String(rounded); - }); - }; -} - -function isRgbOrRgba(range) { - return typeof range === 'string' && range.startsWith('rgb'); -} - -function checkPattern(arr: Array) { - const pattern = arr[0].replace(stringShapeRegex, ''); - for (let i = 1; i < arr.length; ++i) { - invariant( - pattern === arr[i].replace(stringShapeRegex, ''), - 'invalid pattern ' + arr[0] + ' and ' + arr[i], - ); - } -} - -function findRange(input: number, inputRange: Array) { - let i; - for (i = 1; i < inputRange.length - 1; ++i) { - if (inputRange[i] >= input) { - break; - } - } - return i - 1; -} - -function checkValidInputRange(arr: Array) { - invariant(arr.length >= 2, 'inputRange must have at least 2 elements'); - for (let i = 1; i < arr.length; ++i) { - invariant( - arr[i] >= arr[i - 1], - /* $FlowFixMe(>=0.13.0) - In the addition expression below this comment, - * one or both of the operands may be something that doesn't cleanly - * convert to a string, like undefined, null, and object, etc. If you really - * mean this implicit string conversion, you can do something like - * String(myThing) - */ - 'inputRange must be monotonically increasing ' + arr, - ); - } -} - -function checkInfiniteRange(name: string, arr: Array) { - invariant(arr.length >= 2, name + ' must have at least 2 elements'); - invariant( - arr.length !== 2 || arr[0] !== -Infinity || arr[1] !== Infinity, - /* $FlowFixMe(>=0.13.0) - In the addition expression below this comment, - * one or both of the operands may be something that doesn't cleanly convert - * to a string, like undefined, null, and object, etc. If you really mean - * this implicit string conversion, you can do something like - * String(myThing) - */ - name + 'cannot be ]-infinity;+infinity[ ' + arr, - ); -} - -class AnimatedInterpolation extends AnimatedWithChildren { - // Export for testing. - static __createInterpolation = createInterpolation; - - _parent: AnimatedNode; - _config: InterpolationConfigType; - _interpolation: (input: number) => number | string; - - constructor(parent: AnimatedNode, config: InterpolationConfigType) { - super(); - this._parent = parent; - this._config = config; - this._interpolation = createInterpolation(config); - } - - __makeNative() { - this._parent.__makeNative(); - super.__makeNative(); - } - - __getValue(): number | string { - const parentValue: number = this._parent.__getValue(); - invariant( - typeof parentValue === 'number', - 'Cannot interpolate an input which is not a number.', - ); - return this._interpolation(parentValue); - } - - interpolate(config: InterpolationConfigType): AnimatedInterpolation { - return new AnimatedInterpolation(this, config); - } - - __attach(): void { - this._parent.__addChild(this); - } - - __detach(): void { - this._parent.__removeChild(this); - super.__detach(); - } - - __transformDataType(range: Array) { - // Change the string array type to number array - // So we can reuse the same logic in iOS and Android platform - return range.map(function(value) { - if (typeof value !== 'string') { - return value; - } - if (/deg$/.test(value)) { - const degrees = parseFloat(value) || 0; - const radians = degrees * Math.PI / 180.0; - return radians; - } else { - // Assume radians - return parseFloat(value) || 0; - } - }); - } - - __getNativeConfig(): any { - if (__DEV__) { - NativeAnimatedHelper.validateInterpolation(this._config); - } - - return { - inputRange: this._config.inputRange, - // Only the `outputRange` can contain strings so we don't need to tranform `inputRange` here - outputRange: this.__transformDataType(this._config.outputRange), - extrapolateLeft: - this._config.extrapolateLeft || this._config.extrapolate || 'extend', - extrapolateRight: - this._config.extrapolateRight || this._config.extrapolate || 'extend', - type: 'interpolation', - }; - } -} - -module.exports = AnimatedInterpolation; diff --git a/docgen/Libraries/Animated/src/nodes/AnimatedModulo.js b/docgen/Libraries/Animated/src/nodes/AnimatedModulo.js deleted file mode 100644 index 3ff75e73721..00000000000 --- a/docgen/Libraries/Animated/src/nodes/AnimatedModulo.js +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule AnimatedModulo - * @flow - * @format - */ -'use strict'; - -const AnimatedInterpolation = require('./AnimatedInterpolation'); -const AnimatedNode = require('./AnimatedNode'); -const AnimatedWithChildren = require('./AnimatedWithChildren'); - -import type {InterpolationConfigType} from './AnimatedInterpolation'; - -class AnimatedModulo extends AnimatedWithChildren { - _a: AnimatedNode; - _modulus: number; - - constructor(a: AnimatedNode, modulus: number) { - super(); - this._a = a; - this._modulus = modulus; - } - - __makeNative() { - this._a.__makeNative(); - super.__makeNative(); - } - - __getValue(): number { - return ( - (this._a.__getValue() % this._modulus + this._modulus) % this._modulus - ); - } - - interpolate(config: InterpolationConfigType): AnimatedInterpolation { - return new AnimatedInterpolation(this, config); - } - - __attach(): void { - this._a.__addChild(this); - } - - __detach(): void { - this._a.__removeChild(this); - super.__detach(); - } - - __getNativeConfig(): any { - return { - type: 'modulus', - input: this._a.__getNativeTag(), - modulus: this._modulus, - }; - } -} - -module.exports = AnimatedModulo; diff --git a/docgen/Libraries/Animated/src/nodes/AnimatedMultiplication.js b/docgen/Libraries/Animated/src/nodes/AnimatedMultiplication.js deleted file mode 100644 index d30ce2594a1..00000000000 --- a/docgen/Libraries/Animated/src/nodes/AnimatedMultiplication.js +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule AnimatedMultiplication - * @flow - * @format - */ -'use strict'; - -const AnimatedInterpolation = require('./AnimatedInterpolation'); -const AnimatedNode = require('./AnimatedNode'); -const AnimatedValue = require('./AnimatedValue'); -const AnimatedWithChildren = require('./AnimatedWithChildren'); - -import type {InterpolationConfigType} from './AnimatedInterpolation'; - -class AnimatedMultiplication extends AnimatedWithChildren { - _a: AnimatedNode; - _b: AnimatedNode; - - constructor(a: AnimatedNode | number, b: AnimatedNode | number) { - super(); - this._a = typeof a === 'number' ? new AnimatedValue(a) : a; - this._b = typeof b === 'number' ? new AnimatedValue(b) : b; - } - - __makeNative() { - this._a.__makeNative(); - this._b.__makeNative(); - super.__makeNative(); - } - - __getValue(): number { - return this._a.__getValue() * this._b.__getValue(); - } - - interpolate(config: InterpolationConfigType): AnimatedInterpolation { - return new AnimatedInterpolation(this, config); - } - - __attach(): void { - this._a.__addChild(this); - this._b.__addChild(this); - } - - __detach(): void { - this._a.__removeChild(this); - this._b.__removeChild(this); - super.__detach(); - } - - __getNativeConfig(): any { - return { - type: 'multiplication', - input: [this._a.__getNativeTag(), this._b.__getNativeTag()], - }; - } -} - -module.exports = AnimatedMultiplication; diff --git a/docgen/Libraries/Animated/src/nodes/AnimatedNode.js b/docgen/Libraries/Animated/src/nodes/AnimatedNode.js deleted file mode 100644 index c29f4b7f1a8..00000000000 --- a/docgen/Libraries/Animated/src/nodes/AnimatedNode.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule AnimatedNode - * @flow - * @format - */ -'use strict'; - -const NativeAnimatedHelper = require('../NativeAnimatedHelper'); - -const invariant = require('fbjs/lib/invariant'); - -// Note(vjeux): this would be better as an interface but flow doesn't -// support them yet -class AnimatedNode { - __attach(): void {} - __detach(): void { - if (this.__isNative && this.__nativeTag != null) { - NativeAnimatedHelper.API.dropAnimatedNode(this.__nativeTag); - this.__nativeTag = undefined; - } - } - __getValue(): any {} - __getAnimatedValue(): any { - return this.__getValue(); - } - __addChild(child: AnimatedNode) {} - __removeChild(child: AnimatedNode) {} - __getChildren(): Array { - return []; - } - - /* Methods and props used by native Animated impl */ - __isNative: boolean; - __nativeTag: ?number; - __makeNative() { - if (!this.__isNative) { - throw new Error('This node cannot be made a "native" animated node'); - } - } - __getNativeTag(): ?number { - NativeAnimatedHelper.assertNativeAnimatedModule(); - invariant( - this.__isNative, - 'Attempt to get native tag from node not marked as "native"', - ); - if (this.__nativeTag == null) { - const nativeTag: ?number = NativeAnimatedHelper.generateNewNodeTag(); - NativeAnimatedHelper.API.createAnimatedNode( - nativeTag, - this.__getNativeConfig(), - ); - this.__nativeTag = nativeTag; - } - return this.__nativeTag; - } - __getNativeConfig(): Object { - throw new Error( - 'This JS animated node type cannot be used as native animated node', - ); - } - toJSON(): any { - return this.__getValue(); - } -} - -module.exports = AnimatedNode; diff --git a/docgen/Libraries/Animated/src/nodes/AnimatedProps.js b/docgen/Libraries/Animated/src/nodes/AnimatedProps.js deleted file mode 100644 index 0b9f6508d15..00000000000 --- a/docgen/Libraries/Animated/src/nodes/AnimatedProps.js +++ /dev/null @@ -1,167 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule AnimatedProps - * @flow - * @format - */ -'use strict'; - -const {AnimatedEvent} = require('../AnimatedEvent'); -const AnimatedNode = require('./AnimatedNode'); -const AnimatedStyle = require('./AnimatedStyle'); -const NativeAnimatedHelper = require('../NativeAnimatedHelper'); -const ReactNative = require('ReactNative'); - -const invariant = require('fbjs/lib/invariant'); - -class AnimatedProps extends AnimatedNode { - _props: Object; - _animatedView: any; - _callback: () => void; - - constructor(props: Object, callback: () => void) { - super(); - if (props.style) { - props = { - ...props, - style: new AnimatedStyle(props.style), - }; - } - this._props = props; - this._callback = callback; - this.__attach(); - } - - __getValue(): Object { - const props = {}; - for (const key in this._props) { - const value = this._props[key]; - if (value instanceof AnimatedNode) { - if (!value.__isNative || value instanceof AnimatedStyle) { - // We cannot use value of natively driven nodes this way as the value we have access from - // JS may not be up to date. - props[key] = value.__getValue(); - } - } else if (value instanceof AnimatedEvent) { - props[key] = value.__getHandler(); - } else { - props[key] = value; - } - } - return props; - } - - __getAnimatedValue(): Object { - const props = {}; - for (const key in this._props) { - const value = this._props[key]; - if (value instanceof AnimatedNode) { - props[key] = value.__getAnimatedValue(); - } - } - return props; - } - - __attach(): void { - for (const key in this._props) { - const value = this._props[key]; - if (value instanceof AnimatedNode) { - value.__addChild(this); - } - } - } - - __detach(): void { - if (this.__isNative && this._animatedView) { - this.__disconnectAnimatedView(); - } - for (const key in this._props) { - const value = this._props[key]; - if (value instanceof AnimatedNode) { - value.__removeChild(this); - } - } - super.__detach(); - } - - update(): void { - this._callback(); - } - - __makeNative(): void { - if (!this.__isNative) { - this.__isNative = true; - for (const key in this._props) { - const value = this._props[key]; - if (value instanceof AnimatedNode) { - value.__makeNative(); - } - } - if (this._animatedView) { - this.__connectAnimatedView(); - } - } - } - - setNativeView(animatedView: any): void { - if (this._animatedView === animatedView) { - return; - } - this._animatedView = animatedView; - if (this.__isNative) { - this.__connectAnimatedView(); - } - } - - __connectAnimatedView(): void { - invariant(this.__isNative, 'Expected node to be marked as "native"'); - const nativeViewTag: ?number = ReactNative.findNodeHandle( - this._animatedView, - ); - invariant( - nativeViewTag != null, - 'Unable to locate attached view in the native tree', - ); - NativeAnimatedHelper.API.connectAnimatedNodeToView( - this.__getNativeTag(), - nativeViewTag, - ); - } - - __disconnectAnimatedView(): void { - invariant(this.__isNative, 'Expected node to be marked as "native"'); - const nativeViewTag: ?number = ReactNative.findNodeHandle( - this._animatedView, - ); - invariant( - nativeViewTag != null, - 'Unable to locate attached view in the native tree', - ); - NativeAnimatedHelper.API.disconnectAnimatedNodeFromView( - this.__getNativeTag(), - nativeViewTag, - ); - } - - __getNativeConfig(): Object { - const propsConfig = {}; - for (const propKey in this._props) { - const value = this._props[propKey]; - if (value instanceof AnimatedNode) { - propsConfig[propKey] = value.__getNativeTag(); - } - } - return { - type: 'props', - props: propsConfig, - }; - } -} - -module.exports = AnimatedProps; diff --git a/docgen/Libraries/Animated/src/nodes/AnimatedStyle.js b/docgen/Libraries/Animated/src/nodes/AnimatedStyle.js deleted file mode 100644 index f2cdf31dfde..00000000000 --- a/docgen/Libraries/Animated/src/nodes/AnimatedStyle.js +++ /dev/null @@ -1,127 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule AnimatedStyle - * @flow - * @format - */ -'use strict'; - -const AnimatedNode = require('./AnimatedNode'); -const AnimatedTransform = require('./AnimatedTransform'); -const AnimatedWithChildren = require('./AnimatedWithChildren'); -const NativeAnimatedHelper = require('../NativeAnimatedHelper'); - -const flattenStyle = require('flattenStyle'); - -class AnimatedStyle extends AnimatedWithChildren { - _style: Object; - - constructor(style: any) { - super(); - style = flattenStyle(style) || {}; - if (style.transform) { - style = { - ...style, - transform: new AnimatedTransform(style.transform), - }; - } - this._style = style; - } - - // Recursively get values for nested styles (like iOS's shadowOffset) - _walkStyleAndGetValues(style) { - const updatedStyle = {}; - for (const key in style) { - const value = style[key]; - if (value instanceof AnimatedNode) { - if (!value.__isNative) { - // We cannot use value of natively driven nodes this way as the value we have access from - // JS may not be up to date. - updatedStyle[key] = value.__getValue(); - } - } else if (value && !Array.isArray(value) && typeof value === 'object') { - // Support animating nested values (for example: shadowOffset.height) - updatedStyle[key] = this._walkStyleAndGetValues(value); - } else { - updatedStyle[key] = value; - } - } - return updatedStyle; - } - - __getValue(): Object { - return this._walkStyleAndGetValues(this._style); - } - - // Recursively get animated values for nested styles (like iOS's shadowOffset) - _walkStyleAndGetAnimatedValues(style) { - const updatedStyle = {}; - for (const key in style) { - const value = style[key]; - if (value instanceof AnimatedNode) { - updatedStyle[key] = value.__getAnimatedValue(); - } else if (value && !Array.isArray(value) && typeof value === 'object') { - // Support animating nested values (for example: shadowOffset.height) - updatedStyle[key] = this._walkStyleAndGetAnimatedValues(value); - } - } - return updatedStyle; - } - - __getAnimatedValue(): Object { - return this._walkStyleAndGetAnimatedValues(this._style); - } - - __attach(): void { - for (const key in this._style) { - const value = this._style[key]; - if (value instanceof AnimatedNode) { - value.__addChild(this); - } - } - } - - __detach(): void { - for (const key in this._style) { - const value = this._style[key]; - if (value instanceof AnimatedNode) { - value.__removeChild(this); - } - } - super.__detach(); - } - - __makeNative() { - super.__makeNative(); - for (const key in this._style) { - const value = this._style[key]; - if (value instanceof AnimatedNode) { - value.__makeNative(); - } - } - } - - __getNativeConfig(): Object { - const styleConfig = {}; - for (const styleKey in this._style) { - if (this._style[styleKey] instanceof AnimatedNode) { - styleConfig[styleKey] = this._style[styleKey].__getNativeTag(); - } - // Non-animated styles are set using `setNativeProps`, no need - // to pass those as a part of the node config - } - NativeAnimatedHelper.validateStyles(styleConfig); - return { - type: 'style', - style: styleConfig, - }; - } -} - -module.exports = AnimatedStyle; diff --git a/docgen/Libraries/Animated/src/nodes/AnimatedTracking.js b/docgen/Libraries/Animated/src/nodes/AnimatedTracking.js deleted file mode 100644 index 1a54f78abb5..00000000000 --- a/docgen/Libraries/Animated/src/nodes/AnimatedTracking.js +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule AnimatedTracking - * @flow - * @format - */ -'use strict'; - -const AnimatedValue = require('./AnimatedValue'); -const AnimatedNode = require('./AnimatedNode'); - -import type {EndCallback} from '../animations/Animation'; - -class AnimatedTracking extends AnimatedNode { - _value: AnimatedValue; - _parent: AnimatedNode; - _callback: ?EndCallback; - _animationConfig: Object; - _animationClass: any; - - constructor( - value: AnimatedValue, - parent: AnimatedNode, - animationClass: any, - animationConfig: Object, - callback?: ?EndCallback, - ) { - super(); - this._value = value; - this._parent = parent; - this._animationClass = animationClass; - this._animationConfig = animationConfig; - this._callback = callback; - this.__attach(); - } - - __getValue(): Object { - return this._parent.__getValue(); - } - - __attach(): void { - this._parent.__addChild(this); - } - - __detach(): void { - this._parent.__removeChild(this); - super.__detach(); - } - - update(): void { - this._value.animate( - new this._animationClass({ - ...this._animationConfig, - toValue: (this._animationConfig.toValue: any).__getValue(), - }), - this._callback, - ); - } -} - -module.exports = AnimatedTracking; diff --git a/docgen/Libraries/Animated/src/nodes/AnimatedTransform.js b/docgen/Libraries/Animated/src/nodes/AnimatedTransform.js deleted file mode 100644 index c95aa16f699..00000000000 --- a/docgen/Libraries/Animated/src/nodes/AnimatedTransform.js +++ /dev/null @@ -1,123 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule AnimatedTransform - * @flow - * @format - */ -'use strict'; - -const AnimatedNode = require('./AnimatedNode'); -const AnimatedWithChildren = require('./AnimatedWithChildren'); -const NativeAnimatedHelper = require('../NativeAnimatedHelper'); - -class AnimatedTransform extends AnimatedWithChildren { - _transforms: Array; - - constructor(transforms: Array) { - super(); - this._transforms = transforms; - } - - __makeNative() { - super.__makeNative(); - this._transforms.forEach(transform => { - for (const key in transform) { - const value = transform[key]; - if (value instanceof AnimatedNode) { - value.__makeNative(); - } - } - }); - } - - __getValue(): Array { - return this._transforms.map(transform => { - const result = {}; - for (const key in transform) { - const value = transform[key]; - if (value instanceof AnimatedNode) { - result[key] = value.__getValue(); - } else { - result[key] = value; - } - } - return result; - }); - } - - __getAnimatedValue(): Array { - return this._transforms.map(transform => { - const result = {}; - for (const key in transform) { - const value = transform[key]; - if (value instanceof AnimatedNode) { - result[key] = value.__getAnimatedValue(); - } else { - // All transform components needed to recompose matrix - result[key] = value; - } - } - return result; - }); - } - - __attach(): void { - this._transforms.forEach(transform => { - for (const key in transform) { - const value = transform[key]; - if (value instanceof AnimatedNode) { - value.__addChild(this); - } - } - }); - } - - __detach(): void { - this._transforms.forEach(transform => { - for (const key in transform) { - const value = transform[key]; - if (value instanceof AnimatedNode) { - value.__removeChild(this); - } - } - }); - super.__detach(); - } - - __getNativeConfig(): any { - const transConfigs = []; - - this._transforms.forEach(transform => { - for (const key in transform) { - const value = transform[key]; - if (value instanceof AnimatedNode) { - transConfigs.push({ - type: 'animated', - property: key, - nodeTag: value.__getNativeTag(), - }); - } else { - transConfigs.push({ - type: 'static', - property: key, - value, - }); - } - } - }); - - NativeAnimatedHelper.validateTransform(transConfigs); - return { - type: 'transform', - transforms: transConfigs, - }; - } -} - -module.exports = AnimatedTransform; diff --git a/docgen/Libraries/Animated/src/nodes/AnimatedValue.js b/docgen/Libraries/Animated/src/nodes/AnimatedValue.js deleted file mode 100644 index ebe0210aa59..00000000000 --- a/docgen/Libraries/Animated/src/nodes/AnimatedValue.js +++ /dev/null @@ -1,309 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule AnimatedValue - * @flow - * @format - */ -'use strict'; - -const AnimatedInterpolation = require('./AnimatedInterpolation'); -const AnimatedNode = require('./AnimatedNode'); -const AnimatedWithChildren = require('./AnimatedWithChildren'); -const InteractionManager = require('InteractionManager'); -const NativeAnimatedHelper = require('../NativeAnimatedHelper'); - -import type Animation, {EndCallback} from '../animations/Animation'; -import type {InterpolationConfigType} from './AnimatedInterpolation'; - -const NativeAnimatedAPI = NativeAnimatedHelper.API; - -type ValueListenerCallback = (state: {value: number}) => void; - -let _uniqueId = 1; - -/** - * Animated works by building a directed acyclic graph of dependencies - * transparently when you render your Animated components. - * - * new Animated.Value(0) - * .interpolate() .interpolate() new Animated.Value(1) - * opacity translateY scale - * style transform - * View#234 style - * View#123 - * - * A) Top Down phase - * When an Animated.Value is updated, we recursively go down through this - * graph in order to find leaf nodes: the views that we flag as needing - * an update. - * - * B) Bottom Up phase - * When a view is flagged as needing an update, we recursively go back up - * in order to build the new value that it needs. The reason why we need - * this two-phases process is to deal with composite props such as - * transform which can receive values from multiple parents. - */ -function _flush(rootNode: AnimatedValue): void { - const animatedStyles = new Set(); - function findAnimatedStyles(node) { - if (typeof node.update === 'function') { - animatedStyles.add(node); - } else { - node.__getChildren().forEach(findAnimatedStyles); - } - } - findAnimatedStyles(rootNode); - /* $FlowFixMe */ - animatedStyles.forEach(animatedStyle => animatedStyle.update()); -} - -/** - * Standard value for driving animations. One `Animated.Value` can drive - * multiple properties in a synchronized fashion, but can only be driven by one - * mechanism at a time. Using a new mechanism (e.g. starting a new animation, - * or calling `setValue`) will stop any previous ones. - */ -class AnimatedValue extends AnimatedWithChildren { - _value: number; - _startingValue: number; - _offset: number; - _animation: ?Animation; - _tracking: ?AnimatedNode; - _listeners: {[key: string]: ValueListenerCallback}; - __nativeAnimatedValueListener: ?any; - - constructor(value: number) { - super(); - this._startingValue = this._value = value; - this._offset = 0; - this._animation = null; - this._listeners = {}; - } - - __detach() { - this.stopAnimation(); - super.__detach(); - } - - __getValue(): number { - return this._value + this._offset; - } - - __makeNative() { - super.__makeNative(); - - if (Object.keys(this._listeners).length) { - this._startListeningToNativeValueUpdates(); - } - } - - /** - * Directly set the value. This will stop any animations running on the value - * and update all the bound properties. - */ - setValue(value: number): void { - if (this._animation) { - this._animation.stop(); - this._animation = null; - } - this._updateValue( - value, - !this.__isNative /* don't perform a flush for natively driven values */, - ); - if (this.__isNative) { - NativeAnimatedAPI.setAnimatedNodeValue(this.__getNativeTag(), value); - } - } - - /** - * Sets an offset that is applied on top of whatever value is set, whether via - * `setValue`, an animation, or `Animated.event`. Useful for compensating - * things like the start of a pan gesture. - */ - setOffset(offset: number): void { - this._offset = offset; - if (this.__isNative) { - NativeAnimatedAPI.setAnimatedNodeOffset(this.__getNativeTag(), offset); - } - } - - /** - * Merges the offset value into the base value and resets the offset to zero. - * The final output of the value is unchanged. - */ - flattenOffset(): void { - this._value += this._offset; - this._offset = 0; - if (this.__isNative) { - NativeAnimatedAPI.flattenAnimatedNodeOffset(this.__getNativeTag()); - } - } - - /** - * Sets the offset value to the base value, and resets the base value to zero. - * The final output of the value is unchanged. - */ - extractOffset(): void { - this._offset += this._value; - this._value = 0; - if (this.__isNative) { - NativeAnimatedAPI.extractAnimatedNodeOffset(this.__getNativeTag()); - } - } - - /** - * Adds an asynchronous listener to the value so you can observe updates from - * animations. This is useful because there is no way to - * synchronously read the value because it might be driven natively. - */ - addListener(callback: ValueListenerCallback): string { - const id = String(_uniqueId++); - this._listeners[id] = callback; - if (this.__isNative) { - this._startListeningToNativeValueUpdates(); - } - return id; - } - - removeListener(id: string): void { - delete this._listeners[id]; - if (this.__isNative && Object.keys(this._listeners).length === 0) { - this._stopListeningForNativeValueUpdates(); - } - } - - removeAllListeners(): void { - this._listeners = {}; - if (this.__isNative) { - this._stopListeningForNativeValueUpdates(); - } - } - - _startListeningToNativeValueUpdates() { - if (this.__nativeAnimatedValueListener) { - return; - } - - NativeAnimatedAPI.startListeningToAnimatedNodeValue(this.__getNativeTag()); - this.__nativeAnimatedValueListener = NativeAnimatedHelper.nativeEventEmitter.addListener( - 'onAnimatedValueUpdate', - data => { - if (data.tag !== this.__getNativeTag()) { - return; - } - this._updateValue(data.value, false /* flush */); - }, - ); - } - - _stopListeningForNativeValueUpdates() { - if (!this.__nativeAnimatedValueListener) { - return; - } - - this.__nativeAnimatedValueListener.remove(); - this.__nativeAnimatedValueListener = null; - NativeAnimatedAPI.stopListeningToAnimatedNodeValue(this.__getNativeTag()); - } - - /** - * Stops any running animation or tracking. `callback` is invoked with the - * final value after stopping the animation, which is useful for updating - * state to match the animation position with layout. - */ - stopAnimation(callback?: ?(value: number) => void): void { - this.stopTracking(); - this._animation && this._animation.stop(); - this._animation = null; - callback && callback(this.__getValue()); - } - - /** - * Stops any animation and resets the value to its original - */ - resetAnimation(callback?: ?(value: number) => void): void { - this.stopAnimation(callback); - this._value = this._startingValue; - } - - /** - * Interpolates the value before updating the property, e.g. mapping 0-1 to - * 0-10. - */ - interpolate(config: InterpolationConfigType): AnimatedInterpolation { - return new AnimatedInterpolation(this, config); - } - - /** - * Typically only used internally, but could be used by a custom Animation - * class. - */ - animate(animation: Animation, callback: ?EndCallback): void { - let handle = null; - if (animation.__isInteraction) { - handle = InteractionManager.createInteractionHandle(); - } - const previousAnimation = this._animation; - this._animation && this._animation.stop(); - this._animation = animation; - animation.start( - this._value, - value => { - // Natively driven animations will never call into that callback, therefore we can always - // pass flush = true to allow the updated value to propagate to native with setNativeProps - this._updateValue(value, true /* flush */); - }, - result => { - this._animation = null; - if (handle !== null) { - InteractionManager.clearInteractionHandle(handle); - } - callback && callback(result); - }, - previousAnimation, - this, - ); - } - - /** - * Typically only used internally. - */ - stopTracking(): void { - this._tracking && this._tracking.__detach(); - this._tracking = null; - } - - /** - * Typically only used internally. - */ - track(tracking: AnimatedNode): void { - this.stopTracking(); - this._tracking = tracking; - } - - _updateValue(value: number, flush: boolean): void { - this._value = value; - if (flush) { - _flush(this); - } - for (const key in this._listeners) { - this._listeners[key]({value: this.__getValue()}); - } - } - - __getNativeConfig(): Object { - return { - type: 'value', - value: this._value, - offset: this._offset, - }; - } -} - -module.exports = AnimatedValue; diff --git a/docgen/Libraries/Animated/src/nodes/AnimatedValueXY.js b/docgen/Libraries/Animated/src/nodes/AnimatedValueXY.js deleted file mode 100644 index 8d26560ea6e..00000000000 --- a/docgen/Libraries/Animated/src/nodes/AnimatedValueXY.js +++ /dev/null @@ -1,180 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule AnimatedValueXY - * @flow - * @format - */ -'use strict'; - -const AnimatedValue = require('./AnimatedValue'); -const AnimatedWithChildren = require('./AnimatedWithChildren'); - -const invariant = require('fbjs/lib/invariant'); - -type ValueXYListenerCallback = (value: {x: number, y: number}) => void; - -let _uniqueId = 1; - -/** - * 2D Value for driving 2D animations, such as pan gestures. Almost identical - * API to normal `Animated.Value`, but multiplexed. Contains two regular - * `Animated.Value`s under the hood. - * - * #### Example - * - *```javascript - * class DraggableView extends React.Component { - * constructor(props) { - * super(props); - * this.state = { - * pan: new Animated.ValueXY(), // inits to zero - * }; - * this.state.panResponder = PanResponder.create({ - * onStartShouldSetPanResponder: () => true, - * onPanResponderMove: Animated.event([null, { - * dx: this.state.pan.x, // x,y are Animated.Value - * dy: this.state.pan.y, - * }]), - * onPanResponderRelease: () => { - * Animated.spring( - * this.state.pan, // Auto-multiplexed - * {toValue: {x: 0, y: 0}} // Back to zero - * ).start(); - * }, - * }); - * } - * render() { - * return ( - * - * {this.props.children} - * - * ); - * } - * } - *``` - */ -class AnimatedValueXY extends AnimatedWithChildren { - x: AnimatedValue; - y: AnimatedValue; - _listeners: {[key: string]: {x: string, y: string}}; - - constructor( - valueIn?: ?{x: number | AnimatedValue, y: number | AnimatedValue}, - ) { - super(); - const value: any = valueIn || {x: 0, y: 0}; // @flowfixme: shouldn't need `: any` - if (typeof value.x === 'number' && typeof value.y === 'number') { - this.x = new AnimatedValue(value.x); - this.y = new AnimatedValue(value.y); - } else { - invariant( - value.x instanceof AnimatedValue && value.y instanceof AnimatedValue, - 'AnimatedValueXY must be initalized with an object of numbers or ' + - 'AnimatedValues.', - ); - this.x = value.x; - this.y = value.y; - } - this._listeners = {}; - } - - setValue(value: {x: number, y: number}) { - this.x.setValue(value.x); - this.y.setValue(value.y); - } - - setOffset(offset: {x: number, y: number}) { - this.x.setOffset(offset.x); - this.y.setOffset(offset.y); - } - - flattenOffset(): void { - this.x.flattenOffset(); - this.y.flattenOffset(); - } - - extractOffset(): void { - this.x.extractOffset(); - this.y.extractOffset(); - } - - __getValue(): {x: number, y: number} { - return { - x: this.x.__getValue(), - y: this.y.__getValue(), - }; - } - - resetAnimation(callback?: (value: {x: number, y: number}) => void): void { - this.x.resetAnimation(); - this.y.resetAnimation(); - callback && callback(this.__getValue()); - } - - stopAnimation(callback?: (value: {x: number, y: number}) => void): void { - this.x.stopAnimation(); - this.y.stopAnimation(); - callback && callback(this.__getValue()); - } - - addListener(callback: ValueXYListenerCallback): string { - const id = String(_uniqueId++); - const jointCallback = ({value: number}) => { - callback(this.__getValue()); - }; - this._listeners[id] = { - x: this.x.addListener(jointCallback), - y: this.y.addListener(jointCallback), - }; - return id; - } - - removeListener(id: string): void { - this.x.removeListener(this._listeners[id].x); - this.y.removeListener(this._listeners[id].y); - delete this._listeners[id]; - } - - removeAllListeners(): void { - this.x.removeAllListeners(); - this.y.removeAllListeners(); - this._listeners = {}; - } - - /** - * Converts `{x, y}` into `{left, top}` for use in style, e.g. - * - *```javascript - * style={this.state.anim.getLayout()} - *``` - */ - getLayout(): {[key: string]: AnimatedValue} { - return { - left: this.x, - top: this.y, - }; - } - - /** - * Converts `{x, y}` into a useable translation transform, e.g. - * - *```javascript - * style={{ - * transform: this.state.anim.getTranslateTransform() - * }} - *``` - */ - getTranslateTransform(): Array<{[key: string]: AnimatedValue}> { - return [{translateX: this.x}, {translateY: this.y}]; - } -} - -module.exports = AnimatedValueXY; diff --git a/docgen/Libraries/Animated/src/nodes/AnimatedWithChildren.js b/docgen/Libraries/Animated/src/nodes/AnimatedWithChildren.js deleted file mode 100644 index 4676437a9ea..00000000000 --- a/docgen/Libraries/Animated/src/nodes/AnimatedWithChildren.js +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule AnimatedWithChildren - * @flow - * @format - */ -'use strict'; - -const AnimatedNode = require('./AnimatedNode'); -const NativeAnimatedHelper = require('../NativeAnimatedHelper'); - -class AnimatedWithChildren extends AnimatedNode { - _children: Array; - - constructor() { - super(); - this._children = []; - } - - __makeNative() { - if (!this.__isNative) { - this.__isNative = true; - for (const child of this._children) { - child.__makeNative(); - NativeAnimatedHelper.API.connectAnimatedNodes( - this.__getNativeTag(), - child.__getNativeTag(), - ); - } - } - } - - __addChild(child: AnimatedNode): void { - if (this._children.length === 0) { - this.__attach(); - } - this._children.push(child); - if (this.__isNative) { - // Only accept "native" animated nodes as children - child.__makeNative(); - NativeAnimatedHelper.API.connectAnimatedNodes( - this.__getNativeTag(), - child.__getNativeTag(), - ); - } - } - - __removeChild(child: AnimatedNode): void { - const index = this._children.indexOf(child); - if (index === -1) { - console.warn("Trying to remove a child that doesn't exist"); - return; - } - if (this.__isNative && child.__isNative) { - NativeAnimatedHelper.API.disconnectAnimatedNodes( - this.__getNativeTag(), - child.__getNativeTag(), - ); - } - this._children.splice(index, 1); - if (this._children.length === 0) { - this.__detach(); - } - } - - __getChildren(): Array { - return this._children; - } -} - -module.exports = AnimatedWithChildren; diff --git a/docgen/Libraries/Animated/src/polyfills/InteractionManager.js b/docgen/Libraries/Animated/src/polyfills/InteractionManager.js deleted file mode 100644 index db45ede6426..00000000000 --- a/docgen/Libraries/Animated/src/polyfills/InteractionManager.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -'use strict'; - -module.exports = { - createInteractionHandle: function() {}, - clearInteractionHandle: function() {} -}; diff --git a/docgen/Libraries/Animated/src/polyfills/Set.js b/docgen/Libraries/Animated/src/polyfills/Set.js deleted file mode 100644 index 988f0b3f13f..00000000000 --- a/docgen/Libraries/Animated/src/polyfills/Set.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -'use strict'; - -function SetPolyfill() { - this._cache = []; -} - -SetPolyfill.prototype.add = function(e) { - if (this._cache.indexOf(e) === -1) { - this._cache.push(e); - } -}; - -SetPolyfill.prototype.forEach = function(cb) { - this._cache.forEach(cb); -}; - -module.exports = SetPolyfill; diff --git a/docgen/Libraries/Animated/src/polyfills/flattenStyle.js b/docgen/Libraries/Animated/src/polyfills/flattenStyle.js deleted file mode 100644 index 42a68020c65..00000000000 --- a/docgen/Libraries/Animated/src/polyfills/flattenStyle.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ -'use strict'; -module.exports = function(style) { - return style; -}; diff --git a/docgen/Libraries/AppState/AppState.js b/docgen/Libraries/AppState/AppState.js deleted file mode 100644 index 61cfd5d0c97..00000000000 --- a/docgen/Libraries/AppState/AppState.js +++ /dev/null @@ -1,211 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule AppState - * @flow - */ -'use strict'; - -const MissingNativeEventEmitterShim = require('MissingNativeEventEmitterShim'); -const NativeEventEmitter = require('NativeEventEmitter'); -const NativeModules = require('NativeModules'); -const RCTAppState = NativeModules.AppState; - -const logError = require('logError'); -const invariant = require('fbjs/lib/invariant'); - -/** - * `AppState` can tell you if the app is in the foreground or background, - * and notify you when the state changes. - * - * AppState is frequently used to determine the intent and proper behavior when - * handling push notifications. - * - * ### App States - * - * - `active` - The app is running in the foreground - * - `background` - The app is running in the background. The user is either - * in another app or on the home screen - * - `inactive` - This is a state that occurs when transitioning between - * foreground & background, and during periods of inactivity such as - * entering the Multitasking view or in the event of an incoming call - * - * For more information, see - * [Apple's documentation](https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/TheAppLifeCycle/TheAppLifeCycle.html) - * - * ### Basic Usage - * - * To see the current state, you can check `AppState.currentState`, which - * will be kept up-to-date. However, `currentState` will be null at launch - * while `AppState` retrieves it over the bridge. - * - * ``` - * import React, {Component} from 'react' - * import {AppState, Text} from 'react-native' - * - * class AppStateExample extends Component { - * - * state = { - * appState: AppState.currentState - * } - * - * componentDidMount() { - * AppState.addEventListener('change', this._handleAppStateChange); - * } - * - * componentWillUnmount() { - * AppState.removeEventListener('change', this._handleAppStateChange); - * } - * - * _handleAppStateChange = (nextAppState) => { - * if (this.state.appState.match(/inactive|background/) && nextAppState === 'active') { - * console.log('App has come to the foreground!') - * } - * this.setState({appState: nextAppState}); - * } - * - * render() { - * return ( - * Current state is: {this.state.appState} - * ); - * } - * - * } - * ``` - * - * This example will only ever appear to say "Current state is: active" because - * the app is only visible to the user when in the `active` state, and the null - * state will happen only momentarily. - */ - -class AppState extends NativeEventEmitter { - - _eventHandlers: Object; - currentState: ?string; - isAvailable: boolean = true; - - constructor() { - super(RCTAppState); - - this.isAvailable = true; - this._eventHandlers = { - change: new Map(), - memoryWarning: new Map(), - }; - - // TODO: Remove the 'active' fallback after `initialAppState` is exported by - // the Android implementation. - this.currentState = RCTAppState.initialAppState || 'active'; - - let eventUpdated = false; - - // TODO: this is a terrible solution - in order to ensure `currentState` prop - // is up to date, we have to register an observer that updates it whenever - // the state changes, even if nobody cares. We should just deprecate the - // `currentState` property and get rid of this. - this.addListener( - 'appStateDidChange', - (appStateData) => { - eventUpdated = true; - this.currentState = appStateData.app_state; - } - ); - - // TODO: see above - this request just populates the value of `currentState` - // when the module is first initialized. Would be better to get rid of the prop - // and expose `getCurrentAppState` method directly. - RCTAppState.getCurrentAppState( - (appStateData) => { - if (!eventUpdated) { - this.currentState = appStateData.app_state; - } - }, - logError - ); - } - - /** - * Add a handler to AppState changes by listening to the `change` event type - * and providing the handler - * - * TODO: now that AppState is a subclass of NativeEventEmitter, we could deprecate - * `addEventListener` and `removeEventListener` and just use `addListener` and - * `listener.remove()` directly. That will be a breaking change though, as both - * the method and event names are different (addListener events are currently - * required to be globally unique). - */ - addEventListener( - type: string, - handler: Function - ) { - invariant( - ['change', 'memoryWarning'].indexOf(type) !== -1, - 'Trying to subscribe to unknown event: "%s"', type - ); - if (type === 'change') { - this._eventHandlers[type].set(handler, this.addListener( - 'appStateDidChange', - (appStateData) => { - handler(appStateData.app_state); - } - )); - } else if (type === 'memoryWarning') { - this._eventHandlers[type].set(handler, this.addListener( - 'memoryWarning', - handler - )); - } - } - - /** - * Remove a handler by passing the `change` event type and the handler - */ - removeEventListener( - type: string, - handler: Function - ) { - invariant( - ['change', 'memoryWarning'].indexOf(type) !== -1, - 'Trying to remove listener for unknown event: "%s"', type - ); - if (!this._eventHandlers[type].has(handler)) { - return; - } - this._eventHandlers[type].get(handler).remove(); - this._eventHandlers[type].delete(handler); - } -} - -if (__DEV__ && !RCTAppState) { - class MissingNativeAppStateShim extends MissingNativeEventEmitterShim { - constructor() { - super('RCTAppState', 'AppState'); - } - - get currentState(): ?string { - this.throwMissingNativeModule(); - } - - addEventListener(...args: Array) { - this.throwMissingNativeModule(); - } - - removeEventListener(...args: Array) { - this.throwMissingNativeModule(); - } - } - - // This module depends on the native `RCTAppState` module. If you don't include it, - // `AppState.isAvailable` will return `false`, and any method calls will throw. - // We reassign the class variable to keep the autodoc generator happy. - AppState = new MissingNativeAppStateShim(); -} else { - AppState = new AppState(); -} - -module.exports = AppState; diff --git a/docgen/Libraries/BatchedBridge/BatchedBridge.js b/docgen/Libraries/BatchedBridge/BatchedBridge.js deleted file mode 100644 index d4c75e682ec..00000000000 --- a/docgen/Libraries/BatchedBridge/BatchedBridge.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule BatchedBridge - * @flow - * @format - */ -'use strict'; - -const MessageQueue = require('MessageQueue'); - -const BatchedBridge = new MessageQueue(); - -// Wire up the batched bridge on the global object so that we can call into it. -// Ideally, this would be the inverse relationship. I.e. the native environment -// provides this global directly with its script embedded. Then this module -// would export it. A possible fix would be to trim the dependencies in -// MessageQueue to its minimal features and embed that in the native runtime. - -Object.defineProperty(global, '__fbBatchedBridge', { - configurable: true, - value: BatchedBridge, -}); - -module.exports = BatchedBridge; diff --git a/docgen/Libraries/BatchedBridge/MessageQueue.js b/docgen/Libraries/BatchedBridge/MessageQueue.js deleted file mode 100644 index 9acf4a91f6f..00000000000 --- a/docgen/Libraries/BatchedBridge/MessageQueue.js +++ /dev/null @@ -1,413 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule MessageQueue - * @flow - * @format - */ - -/*eslint no-bitwise: 0*/ - -'use strict'; - -const ErrorUtils = require('ErrorUtils'); -const Systrace = require('Systrace'); - -const deepFreezeAndThrowOnMutationInDev = require('deepFreezeAndThrowOnMutationInDev'); -const invariant = require('fbjs/lib/invariant'); -const stringifySafe = require('stringifySafe'); - -export type SpyData = { - type: number, - module: ?string, - method: string | number, - isSync: boolean, - successCbId: number, - failCbId: number, - args: Array, - returnValue?: any, -}; - -const TO_JS = 0; -const TO_NATIVE = 1; - -const MODULE_IDS = 0; -const METHOD_IDS = 1; -const PARAMS = 2; -const MIN_TIME_BETWEEN_FLUSHES_MS = 5; - -const TRACE_TAG_REACT_APPS = 1 << 17; - -const DEBUG_INFO_LIMIT = 64; - -// Work around an initialization order issue -let JSTimers = null; - -class MessageQueue { - _lazyCallableModules: {[key: string]: (void) => Object}; - _queue: [Array, Array, Array, number]; - _successCallbacks: Array; - _failureCallbacks: Array; - _callID: number; - _inCall: number; - _lastFlush: number; - _eventLoopStartTime: number; - - _debugInfo: Object; - _remoteModuleTable: Object; - _remoteMethodTable: Object; - - __spy: ?(data: SpyData) => void; - - constructor() { - this._lazyCallableModules = {}; - this._queue = [[], [], [], 0]; - this._successCallbacks = []; - this._failureCallbacks = []; - this._callID = 0; - this._lastFlush = 0; - this._eventLoopStartTime = new Date().getTime(); - - if (__DEV__) { - this._debugInfo = {}; - this._remoteModuleTable = {}; - this._remoteMethodTable = {}; - } - } - - /** - * Public APIs - */ - static spy(spyOrToggle: boolean | ((data: SpyData) => void)) { - if (spyOrToggle === true) { - MessageQueue.prototype.__spy = info => { - console.log( - `${info.type === TO_JS ? 'N->JS' : 'JS->N'} : ` + - `${info.module ? info.module + '.' : ''}${info.method}` + - `(${JSON.stringify(info.args)})`, - ); - }; - } else if (spyOrToggle === false) { - MessageQueue.prototype.__spy = null; - } else { - MessageQueue.prototype.__spy = spyOrToggle; - } - } - - callFunctionReturnFlushedQueue = ( - module: string, - method: string, - args: Array, - ) => { - this.__guard(() => { - this.__callFunction(module, method, args); - }); - - return this.flushedQueue(); - }; - - callFunctionReturnResultAndFlushedQueue = ( - module: string, - method: string, - args: Array, - ) => { - let result; - this.__guard(() => { - result = this.__callFunction(module, method, args); - }); - - return [result, this.flushedQueue()]; - }; - - invokeCallbackAndReturnFlushedQueue = (cbID: number, args: Array) => { - this.__guard(() => { - this.__invokeCallback(cbID, args); - }); - - return this.flushedQueue(); - }; - - flushedQueue = () => { - this.__guard(() => { - this.__callImmediates(); - }); - - const queue = this._queue; - this._queue = [[], [], [], this._callID]; - return queue[0].length ? queue : null; - }; - - getEventLoopRunningTime() { - return new Date().getTime() - this._eventLoopStartTime; - } - - registerCallableModule(name: string, module: Object) { - this._lazyCallableModules[name] = () => module; - } - - registerLazyCallableModule(name: string, factory: void => Object) { - let module: Object; - let getValue: ?(void) => Object = factory; - this._lazyCallableModules[name] = () => { - if (getValue) { - module = getValue(); - getValue = null; - } - return module; - }; - } - - getCallableModule(name: string) { - const getValue = this._lazyCallableModules[name]; - return getValue ? getValue() : null; - } - - enqueueNativeCall( - moduleID: number, - methodID: number, - params: Array, - onFail: ?Function, - onSucc: ?Function, - ) { - if (onFail || onSucc) { - if (__DEV__) { - this._debugInfo[this._callID] = [moduleID, methodID]; - if (this._callID > DEBUG_INFO_LIMIT) { - delete this._debugInfo[this._callID - DEBUG_INFO_LIMIT]; - } - } - // Encode callIDs into pairs of callback identifiers by shifting left and using the rightmost bit - // to indicate fail (0) or success (1) - onFail && params.push(this._callID << 1); - onSucc && params.push((this._callID << 1) | 1); - this._successCallbacks[this._callID] = onSucc; - this._failureCallbacks[this._callID] = onFail; - } - - if (__DEV__) { - global.nativeTraceBeginAsyncFlow && - global.nativeTraceBeginAsyncFlow( - TRACE_TAG_REACT_APPS, - 'native', - this._callID, - ); - } - this._callID++; - - this._queue[MODULE_IDS].push(moduleID); - this._queue[METHOD_IDS].push(methodID); - - if (__DEV__) { - // Any params sent over the bridge should be encodable as JSON - JSON.stringify(params); - - // The params object should not be mutated after being queued - deepFreezeAndThrowOnMutationInDev((params: any)); - } - this._queue[PARAMS].push(params); - - const now = new Date().getTime(); - if ( - global.nativeFlushQueueImmediate && - (now - this._lastFlush >= MIN_TIME_BETWEEN_FLUSHES_MS || - this._inCall === 0) - ) { - var queue = this._queue; - this._queue = [[], [], [], this._callID]; - this._lastFlush = now; - global.nativeFlushQueueImmediate(queue); - } - Systrace.counterEvent('pending_js_to_native_queue', this._queue[0].length); - - if (this.__spy) { - this.__spyNativeCall(moduleID, methodID, params, { - failCbId: onFail ? params[params.length - 2] : -1, - successCbId: onSucc ? params[params.length - 1] : -1, - }); - } - } - - callSyncHook(moduleID: number, methodID: number, args: Array) { - if (__DEV__) { - invariant( - global.nativeCallSyncHook, - 'Calling synchronous methods on native ' + - 'modules is not supported in Chrome.\n\n Consider providing alternative ' + - 'methods to expose this method in debug mode, e.g. by exposing constants ' + - 'ahead-of-time.', - ); - } - const returnValue = global.nativeCallSyncHook(moduleID, methodID, args); - if (this.__spy) { - this.__spyNativeCall(moduleID, methodID, args, { - isSync: true, - returnValue, - }); - } - return returnValue; - } - - createDebugLookup(moduleID: number, name: string, methods: Array) { - if (__DEV__) { - this._remoteModuleTable[moduleID] = name; - this._remoteMethodTable[moduleID] = methods; - } - } - - /** - * Private methods - */ - - __guard(fn: () => void) { - this._inCall++; - try { - fn(); - } catch (error) { - ErrorUtils.reportFatalError(error); - } finally { - this._inCall--; - } - } - - __callImmediates() { - Systrace.beginEvent('JSTimers.callImmediates()'); - if (!JSTimers) { - JSTimers = require('JSTimers'); - } - JSTimers.callImmediates(); - Systrace.endEvent(); - } - - __callFunction(module: string, method: string, args: Array) { - this._lastFlush = new Date().getTime(); - this._eventLoopStartTime = this._lastFlush; - Systrace.beginEvent(`${module}.${method}()`); - if (this.__spy) { - this.__spyJSCall(module, method, args); - } - const moduleMethods = this.getCallableModule(module); - invariant( - !!moduleMethods, - 'Module %s is not a registered callable module (calling %s)', - module, - method, - ); - invariant( - !!moduleMethods[method], - 'Method %s does not exist on module %s', - method, - module, - ); - const result = moduleMethods[method].apply(moduleMethods, args); - Systrace.endEvent(); - return result; - } - - __invokeCallback(cbID: number, args: Array) { - this._lastFlush = new Date().getTime(); - this._eventLoopStartTime = this._lastFlush; - - // The rightmost bit of cbID indicates fail (0) or success (1), the other bits are the callID shifted left. - const callID = cbID >>> 1; - const isSuccess = cbID & 1; - const callback = isSuccess - ? this._successCallbacks[callID] - : this._failureCallbacks[callID]; - - if (__DEV__) { - const debug = this._debugInfo[callID]; - const module = debug && this._remoteModuleTable[debug[0]]; - const method = debug && this._remoteMethodTable[debug[0]][debug[1]]; - if (!callback) { - let errorMessage = `Callback with id ${cbID}: ${module}.${method}() not found`; - if (method) { - errorMessage = - `The callback ${method}() exists in module ${module}, ` + - 'but only one callback may be registered to a function in a native module.'; - } - invariant(callback, errorMessage); - } - const profileName = debug - ? '' - : cbID + ''; - if (this.__spy) { - this.__spyJSCall(null, profileName, args, { - failCbId: isSuccess ? -1 : cbID, - successCbId: isSuccess ? cbID : -1, - }); - } - Systrace.beginEvent( - `MessageQueue.invokeCallback(${profileName}, ${stringifySafe(args)})`, - ); - } - - if (!callback) { - return; - } - - this._successCallbacks[callID] = this._failureCallbacks[callID] = null; - callback.apply(null, args); - - if (__DEV__) { - Systrace.endEvent(); - } - } - - __spyJSCall( - module: ?string, - method: string, - methodArgs: Array, - params: any, - ) { - if (!this.__spy) { - return; - } - this.__spy({ - type: TO_JS, - isSync: false, - module, - method, - failCbId: -1, - successCbId: -1, - args: methodArgs, - ...params, - }); - } - - __spyNativeCall( - moduleID: number, - methodID: number, - methodArgs: Array, - params: any, - ) { - const spy = this.__spy; - if (!spy) { - return; - } - - let moduleName = moduleID + ''; - let methodName = methodID; - if (__DEV__ && isFinite(moduleID)) { - moduleName = this._remoteModuleTable[moduleID]; - methodName = this._remoteMethodTable[moduleID][methodID]; - } - - spy({ - type: TO_NATIVE, - isSync: false, - module: moduleName, - method: methodName, - failCbId: -1, - successCbId: -1, - args: methodArgs, - ...params, - }); - } -} - -module.exports = MessageQueue; diff --git a/docgen/Libraries/BatchedBridge/NativeModules.js b/docgen/Libraries/BatchedBridge/NativeModules.js deleted file mode 100644 index c943c88e2af..00000000000 --- a/docgen/Libraries/BatchedBridge/NativeModules.js +++ /dev/null @@ -1,150 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule NativeModules - * @flow - */ -'use strict'; - -const BatchedBridge = require('BatchedBridge'); - -const invariant = require('fbjs/lib/invariant'); - -import type {ExtendedError} from 'parseErrorStack'; - -type ModuleConfig = [ - string, /* name */ - ?Object, /* constants */ - Array, /* functions */ - Array, /* promise method IDs */ - Array, /* sync method IDs */ -]; - -export type MethodType = 'async' | 'promise' | 'sync'; - -function genModule(config: ?ModuleConfig, moduleID: number): ?{name: string, module?: Object} { - if (!config) { - return null; - } - - const [moduleName, constants, methods, promiseMethods, syncMethods] = config; - invariant(!moduleName.startsWith('RCT') && !moduleName.startsWith('RK'), - 'Module name prefixes should\'ve been stripped by the native side ' + - 'but wasn\'t for ' + moduleName); - - if (!constants && !methods) { - // Module contents will be filled in lazily later - return { name: moduleName }; - } - - const module = {}; - methods && methods.forEach((methodName, methodID) => { - const isPromise = promiseMethods && arrayContains(promiseMethods, methodID); - const isSync = syncMethods && arrayContains(syncMethods, methodID); - invariant(!isPromise || !isSync, 'Cannot have a method that is both async and a sync hook'); - const methodType = isPromise ? 'promise' : isSync ? 'sync' : 'async'; - module[methodName] = genMethod(moduleID, methodID, methodType); - }); - Object.assign(module, constants); - - if (__DEV__) { - BatchedBridge.createDebugLookup(moduleID, moduleName, methods); - } - - return { name: moduleName, module }; -} - -// export this method as a global so we can call it from native -global.__fbGenNativeModule = genModule; - -function loadModule(name: string, moduleID: number): ?Object { - invariant(global.nativeRequireModuleConfig, - 'Can\'t lazily create module without nativeRequireModuleConfig'); - const config = global.nativeRequireModuleConfig(name); - const info = genModule(config, moduleID); - return info && info.module; -} - -function genMethod(moduleID: number, methodID: number, type: MethodType) { - let fn = null; - if (type === 'promise') { - fn = function(...args: Array) { - return new Promise((resolve, reject) => { - BatchedBridge.enqueueNativeCall(moduleID, methodID, args, - (data) => resolve(data), - (errorData) => reject(createErrorFromErrorData(errorData))); - }); - }; - } else if (type === 'sync') { - fn = function(...args: Array) { - return BatchedBridge.callSyncHook(moduleID, methodID, args); - }; - } else { - fn = function(...args: Array) { - const lastArg = args.length > 0 ? args[args.length - 1] : null; - const secondLastArg = args.length > 1 ? args[args.length - 2] : null; - const hasSuccessCallback = typeof lastArg === 'function'; - const hasErrorCallback = typeof secondLastArg === 'function'; - hasErrorCallback && invariant( - hasSuccessCallback, - 'Cannot have a non-function arg after a function arg.' - ); - const onSuccess = hasSuccessCallback ? lastArg : null; - const onFail = hasErrorCallback ? secondLastArg : null; - const callbackCount = hasSuccessCallback + hasErrorCallback; - args = args.slice(0, args.length - callbackCount); - BatchedBridge.enqueueNativeCall(moduleID, methodID, args, onFail, onSuccess); - }; - } - fn.type = type; - return fn; -} - -function arrayContains(array: Array, value: T): boolean { - return array.indexOf(value) !== -1; -} - -function createErrorFromErrorData(errorData: {message: string}): ExtendedError { - const { - message, - ...extraErrorInfo - } = errorData || {}; - const error : ExtendedError = new Error(message); - error.framesToPop = 1; - return Object.assign(error, extraErrorInfo); -} - -let NativeModules : {[moduleName: string]: Object} = {}; -if (global.nativeModuleProxy) { - NativeModules = global.nativeModuleProxy; -} else { - const bridgeConfig = global.__fbBatchedBridgeConfig; - invariant(bridgeConfig, '__fbBatchedBridgeConfig is not set, cannot invoke native modules'); - - const defineLazyObjectProperty = require('defineLazyObjectProperty'); - (bridgeConfig.remoteModuleConfig || []).forEach((config: ModuleConfig, moduleID: number) => { - // Initially this config will only contain the module name when running in JSC. The actual - // configuration of the module will be lazily loaded. - const info = genModule(config, moduleID); - if (!info) { - return; - } - - if (info.module) { - NativeModules[info.name] = info.module; - } - // If there's no module config, define a lazy getter - else { - defineLazyObjectProperty(NativeModules, info.name, { - get: () => loadModule(info.name, moduleID) - }); - } - }); -} - -module.exports = NativeModules; diff --git a/docgen/Libraries/BatchedBridge/__mocks__/MessageQueueTestConfig.js b/docgen/Libraries/BatchedBridge/__mocks__/MessageQueueTestConfig.js deleted file mode 100644 index 09ec56663b5..00000000000 --- a/docgen/Libraries/BatchedBridge/__mocks__/MessageQueueTestConfig.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * These don't actually exist anywhere in the code. - */ -'use strict'; -var remoteModulesConfig = [ - ['RemoteModule1',null,['remoteMethod','promiseMethod'],[]], - ['RemoteModule2',null,['remoteMethod','promiseMethod'],[]], -]; - -var MessageQueueTestConfig = { - remoteModuleConfig: remoteModulesConfig, -}; - -module.exports = MessageQueueTestConfig; diff --git a/docgen/Libraries/BatchedBridge/__mocks__/MessageQueueTestModule.js b/docgen/Libraries/BatchedBridge/__mocks__/MessageQueueTestModule.js deleted file mode 100644 index 380bacf65e2..00000000000 --- a/docgen/Libraries/BatchedBridge/__mocks__/MessageQueueTestModule.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ -'use strict'; - -/** - * Dummy module that only exists for the sake of proving that the message queue - * correctly dispatches to commonJS modules. The `testHook` is overriden by test - * cases. - */ -var MessageQueueTestModule = { - testHook1: function() { - }, - testHook2: function() { - } -}; - -module.exports = MessageQueueTestModule; diff --git a/docgen/Libraries/BatchedBridge/__tests__/MessageQueue-test.js b/docgen/Libraries/BatchedBridge/__tests__/MessageQueue-test.js deleted file mode 100644 index d9cd5a4e358..00000000000 --- a/docgen/Libraries/BatchedBridge/__tests__/MessageQueue-test.js +++ /dev/null @@ -1,113 +0,0 @@ -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ -'use strict'; - -let MessageQueue; -let MessageQueueTestModule; -let queue; - -const MODULE_IDS = 0; -const METHOD_IDS = 1; -const PARAMS = 2; - -const assertQueue = (flushedQueue, index, moduleID, methodID, params) => { - expect(flushedQueue[MODULE_IDS][index]).toEqual(moduleID); - expect(flushedQueue[METHOD_IDS][index]).toEqual(methodID); - expect(flushedQueue[PARAMS][index]).toEqual(params); -}; - -// Important things to test: -// -// [x] Local modules can be invoked through the queue. -// -// [ ] Local modules that throw exceptions are gracefully caught. In that case -// local callbacks stored by IDs are cleaned up. -describe('MessageQueue', function() { - beforeEach(function() { - jest.resetModules(); - MessageQueue = require('MessageQueue'); - MessageQueueTestModule = require('MessageQueueTestModule'); - queue = new MessageQueue(); - queue.registerCallableModule( - 'MessageQueueTestModule', - MessageQueueTestModule - ); - queue.createDebugLookup(0, 'MessageQueueTestModule', - ['testHook1', 'testHook2']); - }); - - it('should enqueue native calls', () => { - queue.enqueueNativeCall(0, 1, [2]); - const flushedQueue = queue.flushedQueue(); - assertQueue(flushedQueue, 0, 0, 1, [2]); - }); - - it('should call a local function with the function name', () => { - MessageQueueTestModule.testHook2 = jasmine.createSpy(); - expect(MessageQueueTestModule.testHook2.calls.count()).toEqual(0); - queue.__callFunction('MessageQueueTestModule', 'testHook2', [2]); - expect(MessageQueueTestModule.testHook2.calls.count()).toEqual(1); - }); - - it('should store callbacks', () => { - queue.enqueueNativeCall(0, 1, ['foo'], null, null); - const flushedQueue = queue.flushedQueue(); - assertQueue(flushedQueue, 0, 0, 1, ['foo']); - }); - - it('should call the stored callback', () => { - let done = false; - queue.enqueueNativeCall(0, 1, [], () => {}, () => { done = true; }); - queue.__invokeCallback(1); - expect(done).toEqual(true); - }); - - it('should throw when calling the same callback twice', () => { - queue.enqueueNativeCall(0, 1, [], () => {}, () => {}); - queue.__invokeCallback(1); - expect(() => queue.__invokeCallback(1)).toThrow(); - }); - - it('should throw when calling both success and failure callback', () => { - queue.enqueueNativeCall(0, 1, [], () => {}, () => {}); - queue.__invokeCallback(1); - expect(() => queue.__invokeCallback(0)).toThrow(); - }); - - it('should throw when calling with unknown module', () => { - const unknownModule = 'UnknownModule', unknownMethod = 'UnknownMethod'; - expect(() => queue.__callFunction(unknownModule, unknownMethod)).toThrow( - `Module ${unknownModule} is not a registered callable module (calling ${unknownMethod})`, - ); - }); - - it('should return lazily registered module', () => { - const dummyModule = {}, name = 'modulesName'; - queue.registerLazyCallableModule(name, () => dummyModule); - - expect(queue.getCallableModule(name)).toEqual(dummyModule); - }); - - it('should not initialize lazily registered module before it was used for the first time', () => { - const dummyModule = {}, name = 'modulesName'; - const factory = jest.fn(() => dummyModule); - queue.registerLazyCallableModule(name, factory); - expect(factory).not.toHaveBeenCalled(); - }); - - it('should initialize lazily registered module only once', () => { - const dummyModule = {}, name = 'modulesName'; - const factory = jest.fn(() => dummyModule); - queue.registerLazyCallableModule(name, factory); - queue.getCallableModule(name); - queue.getCallableModule(name); - expect(factory).toHaveBeenCalledTimes(1); - }); -}); diff --git a/docgen/Libraries/BatchedBridge/__tests__/NativeModules-test.js b/docgen/Libraries/BatchedBridge/__tests__/NativeModules-test.js deleted file mode 100644 index 9385830efa8..00000000000 --- a/docgen/Libraries/BatchedBridge/__tests__/NativeModules-test.js +++ /dev/null @@ -1,112 +0,0 @@ -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ -'use strict'; - -jest - .enableAutomock() - .unmock('BatchedBridge') - .unmock('defineLazyObjectProperty') - .unmock('MessageQueue') - .unmock('NativeModules'); - -let BatchedBridge; -let NativeModules; - -const MODULE_IDS = 0; -const METHOD_IDS = 1; -const PARAMS = 2; -const CALL_ID = 3; - -const assertQueue = (flushedQueue, index, moduleID, methodID, params) => { - expect(flushedQueue[MODULE_IDS][index]).toEqual(moduleID); - expect(flushedQueue[METHOD_IDS][index]).toEqual(methodID); - expect(flushedQueue[PARAMS][index]).toEqual(params); -}; - -// Important things to test: -// -// [x] Calling remote method actually queues it up on the BatchedBridge -// -// [x] Both error and success callbacks are invoked. -// -// [x] When simulating an error callback from remote method, both error and -// success callbacks are cleaned up. -// -// [ ] Remote invocation throws if not supplying an error callback. -describe('MessageQueue', function() { - beforeEach(function() { - jest.resetModules(); - - global.__fbBatchedBridgeConfig = require('MessageQueueTestConfig'); - BatchedBridge = require('BatchedBridge'); - NativeModules = require('NativeModules'); - }); - - it('should generate native modules', () => { - NativeModules.RemoteModule1.remoteMethod('foo'); - const flushedQueue = BatchedBridge.flushedQueue(); - assertQueue(flushedQueue, 0, 0, 0, ['foo']); - }); - - it('should make round trip and clear memory', function() { - const onFail = jasmine.createSpy(); - const onSucc = jasmine.createSpy(); - - // Perform communication - NativeModules.RemoteModule1.promiseMethod('paloAlto', 'menloPark', onFail, onSucc); - NativeModules.RemoteModule2.promiseMethod('mac', 'windows', onFail, onSucc); - - const resultingRemoteInvocations = BatchedBridge.flushedQueue(); - - // As always, the message queue has four fields - expect(resultingRemoteInvocations.length).toBe(4); - expect(resultingRemoteInvocations[MODULE_IDS].length).toBe(2); - expect(resultingRemoteInvocations[METHOD_IDS].length).toBe(2); - expect(resultingRemoteInvocations[PARAMS].length).toBe(2); - expect(typeof resultingRemoteInvocations[CALL_ID]).toEqual('number'); - - expect(resultingRemoteInvocations[0][0]).toBe(0); // `RemoteModule1` - expect(resultingRemoteInvocations[1][0]).toBe(1); // `promiseMethod` - expect([ // the arguments - resultingRemoteInvocations[2][0][0], - resultingRemoteInvocations[2][0][1] - ]).toEqual(['paloAlto', 'menloPark']); - // Callbacks ids are tacked onto the end of the remote arguments. - const firstFailCBID = resultingRemoteInvocations[2][0][2]; - const firstSuccCBID = resultingRemoteInvocations[2][0][3]; - - expect(resultingRemoteInvocations[0][1]).toBe(1); // `RemoteModule2` - expect(resultingRemoteInvocations[1][1]).toBe(1); // `promiseMethod` - expect([ // the arguments - resultingRemoteInvocations[2][1][0], - resultingRemoteInvocations[2][1][1] - ]).toEqual(['mac', 'windows']); - const secondFailCBID = resultingRemoteInvocations[2][1][2]; - const secondSuccCBID = resultingRemoteInvocations[2][1][3]; - - // Handle the first remote invocation by signaling failure. - BatchedBridge.__invokeCallback(firstFailCBID, ['firstFailure']); - // The failure callback was already invoked, the success is no longer valid - expect(function() { - BatchedBridge.__invokeCallback(firstSuccCBID, ['firstSucc']); - }).toThrow(); - expect(onFail.calls.count()).toBe(1); - expect(onSucc.calls.count()).toBe(0); - - // Handle the second remote invocation by signaling success. - BatchedBridge.__invokeCallback(secondSuccCBID, ['secondSucc']); - // The success callback was already invoked, the fail cb is no longer valid - expect(function() { - BatchedBridge.__invokeCallback(secondFailCBID, ['secondFail']); - }).toThrow(); - expect(onFail.calls.count()).toBe(1); - expect(onSucc.calls.count()).toBe(1); - }); -}); diff --git a/docgen/Libraries/Blob/Blob.js b/docgen/Libraries/Blob/Blob.js deleted file mode 100644 index 0180e15e2ab..00000000000 --- a/docgen/Libraries/Blob/Blob.js +++ /dev/null @@ -1,153 +0,0 @@ -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule Blob - * @flow - */ - -'use strict'; - -const invariant = require('fbjs/lib/invariant'); -const uuid = require('uuid'); - -const { BlobModule } = require('NativeModules'); - -import type { BlobProps } from 'BlobTypes'; - -/** - * Opaque JS representation of some binary data in native. - * - * The API is modeled after the W3C Blob API, with one caveat - * regarding explicit deallocation. Refer to the `close()` - * method for further details. - * - * Example usage in a React component: - * - * class WebSocketImage extends React.Component { - * state = {blob: null}; - * componentDidMount() { - * let ws = this.ws = new WebSocket(...); - * ws.binaryType = 'blob'; - * ws.onmessage = (event) => { - * if (this.state.blob) { - * this.state.blob.close(); - * } - * this.setState({blob: event.data}); - * }; - * } - * componentUnmount() { - * if (this.state.blob) { - * this.state.blob.close(); - * } - * this.ws.close(); - * } - * render() { - * if (!this.state.blob) { - * return ; - * } - * return ; - * } - * } - * - * Reference: https://developer.mozilla.org/en-US/docs/Web/API/Blob - */ -class Blob { - /** - * Size of the data contained in the Blob object, in bytes. - */ - size: number; - /* - * String indicating the MIME type of the data contained in the Blob. - * If the type is unknown, this string is empty. - */ - type: string; - - /* - * Unique id to identify the blob on native side (non-standard) - */ - blobId: string; - /* - * Offset to indicate part of blob, used when sliced (non-standard) - */ - offset: number; - - /** - * Construct blob instance from blob data from native. - * Used internally by modules like XHR, WebSocket, etc. - */ - static create(props: BlobProps): Blob { - return Object.assign(Object.create(Blob.prototype), props); - } - - /** - * Constructor for JS consumers. - * Currently we only support creating Blobs from other Blobs. - * Reference: https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob - */ - constructor(parts: Array, options: any) { - const blobId = uuid(); - let size = 0; - parts.forEach((part) => { - invariant(part instanceof Blob, 'Can currently only create a Blob from other Blobs'); - size += part.size; - }); - BlobModule.createFromParts(parts, blobId); - return Blob.create({ - blobId, - offset: 0, - size, - }); - } - - /* - * This method is used to create a new Blob object containing - * the data in the specified range of bytes of the source Blob. - * Reference: https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice - */ - slice(start?: number, end?: number): Blob { - let offset = this.offset; - let size = this.size; - if (typeof start === 'number') { - if (start > size) { - start = size; - } - offset += start; - size -= start; - - if (typeof end === 'number') { - if (end < 0) { - end = this.size + end; - } - size = end - start; - } - } - return Blob.create({ - blobId: this.blobId, - offset, - size, - }); - } - - /** - * This method is in the standard, but not actually implemented by - * any browsers at this point. It's important for how Blobs work in - * React Native, however, since we cannot de-allocate resources automatically, - * so consumers need to explicitly de-allocate them. - * - * Note that the semantics around Blobs created via `blob.slice()` - * and `new Blob([blob])` are different. `blob.slice()` creates a - * new *view* onto the same binary data, so calling `close()` on any - * of those views is enough to deallocate the data, whereas - * `new Blob([blob, ...])` actually copies the data in memory. - */ - close() { - BlobModule.release(this.blobId); - } -} - -module.exports = Blob; diff --git a/docgen/Libraries/Blob/BlobTypes.js b/docgen/Libraries/Blob/BlobTypes.js deleted file mode 100644 index 8201df47bc3..00000000000 --- a/docgen/Libraries/Blob/BlobTypes.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule BlobTypes - * @flow - */ - -'use strict'; - -export type BlobProps = { - blobId: string, - offset: number, - size: number, - type?: string, -}; - -export type FileProps = BlobProps & { - name: string, - lastModified: number, -}; diff --git a/docgen/Libraries/Blob/RCTBlob.xcodeproj/project.pbxproj b/docgen/Libraries/Blob/RCTBlob.xcodeproj/project.pbxproj deleted file mode 100755 index bb5944caae6..00000000000 --- a/docgen/Libraries/Blob/RCTBlob.xcodeproj/project.pbxproj +++ /dev/null @@ -1,347 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - AD0871131E215B28007D136D /* RCTBlobManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = AD9A43C11DFC7126008DC588 /* RCTBlobManager.h */; }; - AD0871161E215EC9007D136D /* RCTBlobManager.h in Headers */ = {isa = PBXBuildFile; fileRef = AD9A43C11DFC7126008DC588 /* RCTBlobManager.h */; }; - AD0871181E215ED1007D136D /* RCTBlobManager.h in Headers */ = {isa = PBXBuildFile; fileRef = AD9A43C11DFC7126008DC588 /* RCTBlobManager.h */; }; - AD08711A1E2162C8007D136D /* RCTBlobManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = AD9A43C11DFC7126008DC588 /* RCTBlobManager.h */; }; - AD9A43C31DFC7126008DC588 /* RCTBlobManager.m in Sources */ = {isa = PBXBuildFile; fileRef = AD9A43C21DFC7126008DC588 /* RCTBlobManager.m */; }; - ADD01A711E09404A00F6D226 /* RCTBlobManager.m in Sources */ = {isa = PBXBuildFile; fileRef = AD9A43C21DFC7126008DC588 /* RCTBlobManager.m */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 358F4ED51D1E81A9004DF814 /* Copy Headers */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = include/RCTBlob; - dstSubfolderSpec = 16; - files = ( - AD08711A1E2162C8007D136D /* RCTBlobManager.h in Copy Headers */, - ); - name = "Copy Headers"; - runOnlyForDeploymentPostprocessing = 0; - }; - AD0871121E215B16007D136D /* Copy Headers */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = include/RCTBlob; - dstSubfolderSpec = 16; - files = ( - AD0871131E215B28007D136D /* RCTBlobManager.h in Copy Headers */, - ); - name = "Copy Headers"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 358F4ED71D1E81A9004DF814 /* libRCTBlob.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTBlob.a; sourceTree = BUILT_PRODUCTS_DIR; }; - AD9A43C11DFC7126008DC588 /* RCTBlobManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTBlobManager.h; sourceTree = ""; }; - AD9A43C21DFC7126008DC588 /* RCTBlobManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTBlobManager.m; sourceTree = ""; }; - ADD01A681E09402E00F6D226 /* libRCTBlob-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libRCTBlob-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXGroup section */ - 358F4ECE1D1E81A9004DF814 = { - isa = PBXGroup; - children = ( - AD9A43C11DFC7126008DC588 /* RCTBlobManager.h */, - AD9A43C21DFC7126008DC588 /* RCTBlobManager.m */, - 358F4ED81D1E81A9004DF814 /* Products */, - ); - indentWidth = 2; - sourceTree = ""; - tabWidth = 2; - usesTabs = 0; - }; - 358F4ED81D1E81A9004DF814 /* Products */ = { - isa = PBXGroup; - children = ( - 358F4ED71D1E81A9004DF814 /* libRCTBlob.a */, - ADD01A681E09402E00F6D226 /* libRCTBlob-tvOS.a */, - ); - name = Products; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - AD0871151E215EB7007D136D /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - AD0871161E215EC9007D136D /* RCTBlobManager.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - AD0871171E215ECC007D136D /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - AD0871181E215ED1007D136D /* RCTBlobManager.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 358F4ED61D1E81A9004DF814 /* RCTBlob */ = { - isa = PBXNativeTarget; - buildConfigurationList = 358F4EE01D1E81A9004DF814 /* Build configuration list for PBXNativeTarget "RCTBlob" */; - buildPhases = ( - AD0871151E215EB7007D136D /* Headers */, - 358F4ED51D1E81A9004DF814 /* Copy Headers */, - 358F4ED31D1E81A9004DF814 /* Sources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = RCTBlob; - productName = SLKBlobs; - productReference = 358F4ED71D1E81A9004DF814 /* libRCTBlob.a */; - productType = "com.apple.product-type.library.static"; - }; - ADD01A671E09402E00F6D226 /* RCTBlob-tvOS */ = { - isa = PBXNativeTarget; - buildConfigurationList = ADD01A6E1E09402E00F6D226 /* Build configuration list for PBXNativeTarget "RCTBlob-tvOS" */; - buildPhases = ( - AD0871171E215ECC007D136D /* Headers */, - AD0871121E215B16007D136D /* Copy Headers */, - ADD01A641E09402E00F6D226 /* Sources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "RCTBlob-tvOS"; - productName = "RCTBlob-tvOS"; - productReference = ADD01A681E09402E00F6D226 /* libRCTBlob-tvOS.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 358F4ECF1D1E81A9004DF814 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0730; - ORGANIZATIONNAME = "Silk Labs"; - TargetAttributes = { - 358F4ED61D1E81A9004DF814 = { - CreatedOnToolsVersion = 7.3; - }; - ADD01A671E09402E00F6D226 = { - CreatedOnToolsVersion = 8.2; - ProvisioningStyle = Automatic; - }; - }; - }; - buildConfigurationList = 358F4ED21D1E81A9004DF814 /* Build configuration list for PBXProject "RCTBlob" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 358F4ECE1D1E81A9004DF814; - productRefGroup = 358F4ED81D1E81A9004DF814 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 358F4ED61D1E81A9004DF814 /* RCTBlob */, - ADD01A671E09402E00F6D226 /* RCTBlob-tvOS */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 358F4ED31D1E81A9004DF814 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - AD9A43C31DFC7126008DC588 /* RCTBlobManager.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - ADD01A641E09402E00F6D226 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ADD01A711E09404A00F6D226 /* RCTBlobManager.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 358F4EDE1D1E81A9004DF814 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 358F4EDF1D1E81A9004DF814 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 358F4EE11D1E81A9004DF814 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 358F4EE21D1E81A9004DF814 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - }; - name = Release; - }; - ADD01A6F1E09402E00F6D226 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = appletvos; - SKIP_INSTALL = YES; - TVOS_DEPLOYMENT_TARGET = 10.1; - }; - name = Debug; - }; - ADD01A701E09402E00F6D226 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = appletvos; - SKIP_INSTALL = YES; - TVOS_DEPLOYMENT_TARGET = 10.1; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 358F4ED21D1E81A9004DF814 /* Build configuration list for PBXProject "RCTBlob" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 358F4EDE1D1E81A9004DF814 /* Debug */, - 358F4EDF1D1E81A9004DF814 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 358F4EE01D1E81A9004DF814 /* Build configuration list for PBXNativeTarget "RCTBlob" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 358F4EE11D1E81A9004DF814 /* Debug */, - 358F4EE21D1E81A9004DF814 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - ADD01A6E1E09402E00F6D226 /* Build configuration list for PBXNativeTarget "RCTBlob-tvOS" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - ADD01A6F1E09402E00F6D226 /* Debug */, - ADD01A701E09402E00F6D226 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 358F4ECF1D1E81A9004DF814 /* Project object */; -} diff --git a/docgen/Libraries/Blob/RCTBlobManager.h b/docgen/Libraries/Blob/RCTBlobManager.h deleted file mode 100755 index 03b3ffc60a6..00000000000 --- a/docgen/Libraries/Blob/RCTBlobManager.h +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import -#import -#import - -@interface RCTBlobManager : NSObject - -@end diff --git a/docgen/Libraries/Blob/RCTBlobManager.m b/docgen/Libraries/Blob/RCTBlobManager.m deleted file mode 100755 index d556d634a1c..00000000000 --- a/docgen/Libraries/Blob/RCTBlobManager.m +++ /dev/null @@ -1,218 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "RCTBlobManager.h" - -#import -#import - -static NSString *const kBlobUriScheme = @"blob"; - -@interface _RCTBlobContentHandler : NSObject - -- (instancetype)initWithBlobManager:(RCTBlobManager *)blobManager; - -@end - - -@implementation RCTBlobManager -{ - NSMutableDictionary *_blobs; - _RCTBlobContentHandler *_contentHandler; - NSOperationQueue *_queue; -} - -RCT_EXPORT_MODULE(BlobModule) - -@synthesize bridge = _bridge; - -+ (BOOL)requiresMainQueueSetup -{ - return NO; -} - -- (NSDictionary *)constantsToExport -{ - return @{ - @"BLOB_URI_SCHEME": kBlobUriScheme, - @"BLOB_URI_HOST": [NSNull null], - }; -} - -- (dispatch_queue_t)methodQueue -{ - return [[_bridge webSocketModule] methodQueue]; -} - -- (NSString *)store:(NSData *)data -{ - NSString *blobId = [NSUUID UUID].UUIDString; - [self store:data withId:blobId]; - return blobId; -} - -- (void)store:(NSData *)data withId:(NSString *)blobId -{ - if (!_blobs) { - _blobs = [NSMutableDictionary new]; - } - - _blobs[blobId] = data; -} - -- (NSData *)resolve:(NSDictionary *)blob -{ - NSString *blobId = [RCTConvert NSString:blob[@"blobId"]]; - NSNumber *offset = [RCTConvert NSNumber:blob[@"offset"]]; - NSNumber *size = [RCTConvert NSNumber:blob[@"size"]]; - - return [self resolve:blobId - offset:offset ? [offset integerValue] : 0 - size:size ? [size integerValue] : -1]; -} - -- (NSData *)resolve:(NSString *)blobId offset:(NSInteger)offset size:(NSInteger)size -{ - NSData *data = _blobs[blobId]; - if (!data) { - return nil; - } - if (offset != 0 || (size != -1 && size != data.length)) { - data = [data subdataWithRange:NSMakeRange(offset, size)]; - } - return data; -} - -RCT_EXPORT_METHOD(enableBlobSupport:(nonnull NSNumber *)socketID) -{ - if (!_contentHandler) { - _contentHandler = [[_RCTBlobContentHandler alloc] initWithBlobManager:self]; - } - [[_bridge webSocketModule] setContentHandler:_contentHandler forSocketID:socketID]; -} - -RCT_EXPORT_METHOD(disableBlobSupport:(nonnull NSNumber *)socketID) -{ - [[_bridge webSocketModule] setContentHandler:nil forSocketID:socketID]; -} - -RCT_EXPORT_METHOD(sendBlob:(NSDictionary *)blob socketID:(nonnull NSNumber *)socketID) -{ - [[_bridge webSocketModule] sendData:[self resolve:blob] forSocketID:socketID]; -} - -RCT_EXPORT_METHOD(createFromParts:(NSArray *> *)parts withId:(NSString *)blobId) -{ - NSMutableData *data = [NSMutableData new]; - for (NSDictionary *part in parts) { - NSData *partData = [self resolve:part]; - [data appendData:partData]; - } - [self store:data withId:blobId]; -} - -RCT_EXPORT_METHOD(release:(NSString *)blobId) -{ - [_blobs removeObjectForKey:blobId]; -} - -#pragma mark - RCTURLRequestHandler methods - -- (BOOL)canHandleRequest:(NSURLRequest *)request -{ - return [request.URL.scheme caseInsensitiveCompare:kBlobUriScheme] == NSOrderedSame; -} - -- (id)sendRequest:(NSURLRequest *)request withDelegate:(id)delegate -{ - // Lazy setup - if (!_queue) { - _queue = [NSOperationQueue new]; - _queue.maxConcurrentOperationCount = 2; - } - - __weak __block NSBlockOperation *weakOp; - __block NSBlockOperation *op = [NSBlockOperation blockOperationWithBlock:^{ - NSURLResponse *response = [[NSURLResponse alloc] initWithURL:request.URL - MIMEType:nil - expectedContentLength:-1 - textEncodingName:nil]; - - [delegate URLRequest:weakOp didReceiveResponse:response]; - - NSURLComponents *components = [[NSURLComponents alloc] initWithURL:request.URL resolvingAgainstBaseURL:NO]; - - NSString *blobId = components.path; - NSInteger offset = 0; - NSInteger size = -1; - - if (components.queryItems) { - for (NSURLQueryItem *queryItem in components.queryItems) { - if ([queryItem.name isEqualToString:@"offset"]) { - offset = [queryItem.value integerValue]; - } - if ([queryItem.name isEqualToString:@"size"]) { - size = [queryItem.value integerValue]; - } - } - } - - NSData *data; - if (blobId) { - data = [self resolve:blobId offset:offset size:size]; - } - NSError *error; - if (data) { - [delegate URLRequest:weakOp didReceiveData:data]; - } else { - error = [[NSError alloc] initWithDomain:NSURLErrorDomain code:NSURLErrorBadURL userInfo:nil]; - } - [delegate URLRequest:weakOp didCompleteWithError:error]; - }]; - - weakOp = op; - [_queue addOperation:op]; - return op; -} - -- (void)cancelRequest:(NSOperation *)op -{ - [op cancel]; -} - -@end - -@implementation _RCTBlobContentHandler { - __weak RCTBlobManager *_blobManager; -} - -- (instancetype)initWithBlobManager:(RCTBlobManager *)blobManager -{ - if (self = [super init]) { - _blobManager = blobManager; - } - return self; -} - -- (id)processMessage:(id)message forSocketID:(NSNumber *)socketID withType:(NSString *__autoreleasing _Nonnull *)type -{ - if (![message isKindOfClass:[NSData class]]) { - *type = @"text"; - return message; - } - - *type = @"blob"; - return @{ - @"blobId": [_blobManager store:message], - @"offset": @0, - @"size": @(((NSData *)message).length), - }; -} - -@end diff --git a/docgen/Libraries/Blob/URL.js b/docgen/Libraries/Blob/URL.js deleted file mode 100644 index eddddf258b7..00000000000 --- a/docgen/Libraries/Blob/URL.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule URL - * @format - * @flow - */ - -'use strict'; - -const Blob = require('Blob'); - -const {BlobModule} = require('NativeModules'); - -let BLOB_URL_PREFIX = null; - -if (BlobModule && typeof BlobModule.BLOB_URI_SCHEME === 'string') { - BLOB_URL_PREFIX = BlobModule.BLOB_URI_SCHEME + ':'; - if (typeof BlobModule.BLOB_URI_HOST === 'string') { - BLOB_URL_PREFIX += `//${BlobModule.BLOB_URI_HOST}/`; - } -} - -/** - * To allow Blobs be accessed via `content://` URIs, - * you need to register `BlobProvider` as a ContentProvider in your app's `AndroidManifest.xml`: - * - * ```xml - * - * - * - * - * - * ``` - * And then define the `blob_provider_authority` string in `res/values/strings.xml`. - * Use a dotted name that's entirely unique to your app: - * - * ```xml - * - * your.app.package.blobs - * - * ``` - */ -class URL { - constructor() { - throw new Error('Creating BlobURL objects is not supported yet.'); - } - - static createObjectURL(blob: Blob) { - if (BLOB_URL_PREFIX === null) { - throw new Error('Cannot create URL for blob!'); - } - return `${BLOB_URL_PREFIX}${blob.blobId}?offset=${blob.offset}&size=${blob.size}`; - } - - static revokeObjectURL(url: string) { - // Do nothing. - } -} - -module.exports = URL; diff --git a/docgen/Libraries/BugReporting/BugReporting.js b/docgen/Libraries/BugReporting/BugReporting.js deleted file mode 100644 index 277f16b45e1..00000000000 --- a/docgen/Libraries/BugReporting/BugReporting.js +++ /dev/null @@ -1,105 +0,0 @@ -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule BugReporting - * @flow - */ -'use strict'; - -const RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); -const Map = require('Map'); -const infoLog = require('infoLog'); - -import type EmitterSubscription from 'EmitterSubscription'; - -type ExtraData = { [key: string]: string }; -type SourceCallback = () => string; -type DebugData = { extras: ExtraData, files: ExtraData }; - -function defaultExtras() { - BugReporting.addFileSource('react_hierarchy.txt', () => require('dumpReactTree')()); -} - -/** - * A simple class for collecting bug report data. Components can add sources that will be queried when a bug report - * is created via `collectExtraData`. For example, a list component might add a source that provides the list of rows - * that are currently visible on screen. Components should also remember to call `remove()` on the object that is - * returned by `addSource` when they are unmounted. - */ -class BugReporting { - static _extraSources: Map = new Map(); - static _fileSources: Map = new Map(); - static _subscription: ?EmitterSubscription = null; - - static _maybeInit() { - if (!BugReporting._subscription) { - BugReporting._subscription = RCTDeviceEventEmitter - .addListener('collectBugExtraData', BugReporting.collectExtraData, null); - defaultExtras(); - } - } - - /** - * Maps a string key to a simple callback that should return a string payload to be attached - * to a bug report. Source callbacks are called when `collectExtraData` is called. - * - * Returns an object to remove the source when the component unmounts. - * - * Conflicts trample with a warning. - */ - static addSource(key: string, callback: SourceCallback): {remove: () => void} { - return this._addSource(key, callback, BugReporting._extraSources); - } - - /** - * Maps a string key to a simple callback that should return a string payload to be attached - * to a bug report. Source callbacks are called when `collectExtraData` is called. - * - * Returns an object to remove the source when the component unmounts. - * - * Conflicts trample with a warning. - */ - static addFileSource(key: string, callback: SourceCallback): {remove: () => void} { - return this._addSource(key, callback, BugReporting._fileSources); - } - - static _addSource(key: string, callback: SourceCallback, source: Map): {remove: () => void} { - BugReporting._maybeInit(); - if (source.has(key)) { - console.warn(`BugReporting.add* called multiple times for same key '${key}'`); - } - source.set(key, callback); - return {remove: () => { source.delete(key); }}; - } - - /** - * This can be called from a native bug reporting flow, or from JS code. - * - * If available, this will call `NativeModules.BugReporting.setExtraData(extraData)` - * after collecting `extraData`. - */ - static collectExtraData(): DebugData { - const extraData: ExtraData = {}; - for (const [key, callback] of BugReporting._extraSources) { - extraData[key] = callback(); - } - const fileData: ExtraData = {}; - for (const [key, callback] of BugReporting._fileSources) { - fileData[key] = callback(); - } - infoLog('BugReporting extraData:', extraData); - const BugReportingNativeModule = require('NativeModules').BugReporting; - BugReportingNativeModule && - BugReportingNativeModule.setExtraData && - BugReportingNativeModule.setExtraData(extraData, fileData); - - return { extras: extraData, files: fileData }; - } -} - -module.exports = BugReporting; diff --git a/docgen/Libraries/BugReporting/dumpReactTree.js b/docgen/Libraries/BugReporting/dumpReactTree.js deleted file mode 100644 index 88a5b7f8ffb..00000000000 --- a/docgen/Libraries/BugReporting/dumpReactTree.js +++ /dev/null @@ -1,152 +0,0 @@ -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule dumpReactTree - * @flow - */ -'use strict'; - -/* -const getReactData = require('getReactData'); - -const INDENTATION_SIZE = 2; -const MAX_DEPTH = 2; -const MAX_STRING_LENGTH = 50; -*/ - -/** - * Dump all React Native root views and their content. This function tries - * it best to get the content but ultimately relies on implementation details - * of React and will fail in future versions. - */ -function dumpReactTree() { - try { - return getReactTree(); - } catch (e) { - return 'Failed to dump react tree: ' + e; - } -} - -function getReactTree() { - // TODO(sema): Reenable tree dumps using the Fiber tree structure. #15945684 - return ( - 'React tree dumps have been temporarily disabled while React is ' + - 'upgraded to Fiber.' - ); -/* - let output = ''; - const rootIds = Object.getOwnPropertyNames(ReactNativeMount._instancesByContainerID); - for (const rootId of rootIds) { - const instance = ReactNativeMount._instancesByContainerID[rootId]; - output += `============ Root ID: ${rootId} ============\n`; - output += dumpNode(instance, 0); - output += `============ End root ID: ${rootId} ============\n`; - } - return output; -*/ -} - -/* -function dumpNode(node: Object, identation: number) { - const data = getReactData(node); - if (data.nodeType === 'Text') { - return indent(identation) + data.text + '\n'; - } else if (data.nodeType === 'Empty') { - return ''; - } - let output = indent(identation) + `<${data.name}`; - if (data.nodeType === 'Composite') { - for (const propName of Object.getOwnPropertyNames(data.props || {})) { - if (isNormalProp(propName)) { - try { - const value = convertValue(data.props[propName]); - if (value) { - output += ` ${propName}=${value}`; - } - } catch (e) { - const message = `[Failed to get property: ${e}]`; - output += ` ${propName}=${message}`; - } - } - } - } - let childOutput = ''; - for (const child of data.children || []) { - childOutput += dumpNode(child, identation + 1); - } - - if (childOutput) { - output += '>\n' + childOutput + indent(identation) + `\n`; - } else { - output += ' />\n'; - } - - return output; -} - -function isNormalProp(name: string): boolean { - switch (name) { - case 'children': - case 'key': - case 'ref': - return false; - default: - return true; - } -} - -function convertObject(object: Object, depth: number) { - if (depth >= MAX_DEPTH) { - return '[...omitted]'; - } - let output = '{'; - let first = true; - for (const key of Object.getOwnPropertyNames(object)) { - if (!first) { - output += ', '; - } - output += `${key}: ${convertValue(object[key], depth + 1)}`; - first = false; - } - return output + '}'; -} - -function convertValue(value, depth = 0): ?string { - if (!value) { - return null; - } - - switch (typeof value) { - case 'string': - return JSON.stringify(possiblyEllipsis(value).replace('\n', '\\n')); - case 'boolean': - case 'number': - return JSON.stringify(value); - case 'function': - return '[function]'; - case 'object': - return convertObject(value, depth); - default: - return null; - } -} - -function possiblyEllipsis(value: string) { - if (value.length > MAX_STRING_LENGTH) { - return value.slice(0, MAX_STRING_LENGTH) + '...'; - } else { - return value; - } -} - -function indent(size: number) { - return ' '.repeat(size * INDENTATION_SIZE); -} -*/ - -module.exports = dumpReactTree; diff --git a/docgen/Libraries/BugReporting/getReactData.js b/docgen/Libraries/BugReporting/getReactData.js deleted file mode 100644 index 18f4b0888f8..00000000000 --- a/docgen/Libraries/BugReporting/getReactData.js +++ /dev/null @@ -1,168 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule getReactData - * @flow - */ -'use strict'; - -/** - * Convert a react internal instance to a sanitized data object. - * - * This is shamelessly stolen from react-devtools: - * https://github.com/facebook/react-devtools/blob/master/backend/getData.js - */ -function getData(element: Object): Object { - var children = null; - var props = null; - var state = null; - var context = null; - var updater = null; - var name = null; - var type = null; - var text = null; - var publicInstance = null; - var nodeType = 'Native'; - // If the parent is a native node without rendered children, but with - // multiple string children, then the `element` that gets passed in here is - // a plain value -- a string or number. - if (typeof element !== 'object') { - nodeType = 'Text'; - text = element + ''; - } else if (element._currentElement === null || element._currentElement === false) { - nodeType = 'Empty'; - } else if (element._renderedComponent) { - nodeType = 'NativeWrapper'; - children = [element._renderedComponent]; - props = element._instance.props; - state = element._instance.state; - context = element._instance.context; - if (context && Object.keys(context).length === 0) { - context = null; - } - } else if (element._renderedChildren) { - children = childrenList(element._renderedChildren); - } else if (element._currentElement && element._currentElement.props) { - // This is a native node without rendered children -- meaning the children - // prop is just a string or (in the case of the