From 313b00ead3083d88e1946ed282e2be338c0fcd55 Mon Sep 17 00:00:00 2001 From: Vincent Riemer Date: Thu, 13 Sep 2018 12:40:24 -0400 Subject: [PATCH] feat: Add support for RN 0.57 (#73) --- .flowconfig | 16 +- .gitignore | 13 +- Examples/index.html | 30 + docs/doc1.md | 93 + docs/doc2.md | 7 + docs/doc3.md | 37 + docs/exampledoc4.md | 6 + docs/exampledoc5.md | 6 + package.json | 51 +- packages/react-native-dom/.babelrc | 21 +- packages/react-native-dom/Examples/index.html | 30 - .../Components/Clipboard/Clipboard.dom.js | 9 + .../TextInput/TextInputState.dom.js | 129 +- .../Components/WebView/WebView.dom.js | 5 +- .../Libraries/Components/button.dom.js | 40 +- .../UI/YellowBoxInspectorHeader.dom.js | 120 + packages/react-native-dom/RNTester | 2 +- .../ReactDom/DevSupport/RCTDevLoadingView.js | 37 +- .../ReactDom/DevSupport/RCTDevMenu.js | 16 +- .../ReactDom/{index.js => ReactDom.js} | 115 +- .../ReactDom/base/NotificationCenter.js | 5 +- .../ReactDom/base/UIBorderView.js | 203 +- .../ReactDom/base/UIChildContainerView.js | 29 + .../ReactDom/base/UIHitSlopView.js | 60 + .../react-native-dom/ReactDom/base/UIView.js | 135 +- .../ReactDom/bridge/RCTBridge.js | 205 +- .../ReactDom/bridge/RCTBridgeMethod.js | 5 +- .../ReactDom/bridge/RCTEventDispatcher.js | 23 +- .../ReactDom/bridge/RCTModule.js | 128 +- .../ReactDom/bridge/RCTModuleConfig.js | 23 +- .../ReactDom/bridge/RCTRootView.js | 43 +- .../defs/{internal.js => InternalLib.js} | 5 +- ...meGenerator.js => RCTKeyframeGenerator.js} | 13 +- .../RCTLayoutAnimationManager.js | 15 +- .../keyframeGenerator.test.js.snap | 232 +- .../Drivers/RCTAnimationDriver.js | 5 +- .../Drivers/RCTDecayAnimation.js | 8 +- .../Drivers/RCTEventAnimation.js | 5 +- .../Drivers/RCTFrameAnimation.js | 16 +- .../Drivers/RCTSpringAnimation.js | 9 +- .../Nodes/RCTAdditionAnimatedNode.js | 5 +- .../NativeAnimation/Nodes/RCTAnimatedNode.js | 5 +- .../Nodes/RCTDiffClampAnimatedNode.js | 5 +- .../Nodes/RCTDivisionAnimatedNode.js | 5 +- .../Nodes/RCTInterpolationAnimatedNode.js | 5 +- .../Nodes/RCTModuloAnimatedNode.js | 5 +- .../Nodes/RCTMultiplicationAnimatedNode.js | 5 +- .../Nodes/RCTPropsAnimatedNode.js | 5 +- .../Nodes/RCTStyleAnimatedNode.js | 5 +- .../Nodes/RCTTrackingAnimatedNode.js | 5 +- .../Nodes/RCTTransformAnimatedNode.js | 5 +- .../Nodes/RCTValueAnimatedNode.js | 5 +- .../NativeAnimation/RCTAnimationUtils.js | 7 +- .../RCTNativeAnimatedModule.js | 62 +- .../RCTNativeAnimatedNodesManager.js | 5 +- .../ReactDom/modules/RCTAppState.js | 17 +- .../ReactDom/modules/RCTAsyncLocalStorage.js | 45 +- .../ReactDom/modules/RCTBlobManager.js | 26 +- .../ReactDom/modules/RCTDevSettings.js | 28 +- .../ReactDom/modules/RCTDeviceEventManager.js | 48 +- .../ReactDom/modules/RCTDeviceInfo.js | 10 +- .../ReactDom/modules/RCTExceptionsManager.js | 35 +- .../ReactDom/modules/RCTHistory.js | 69 + .../ReactDom/modules/RCTI18nManager.js | 87 + .../ReactDom/modules/RCTKeyboardObserver.js | 12 +- .../ReactDom/modules/RCTLinkingManager.js | 117 +- ...entEmitter.js => RCTNativeEventEmitter.js} | 51 +- .../RCTNativeViewHierarchyOptimizer.js | 385 ++ ...CTNetworking.js => RCTNetworkingNative.js} | 53 +- .../ReactDom/modules/RCTPlatform.js | 18 +- .../ReactDom/modules/RCTSourceCode.js | 17 +- .../ReactDom/modules/RCTStatusBarManager.js | 34 +- .../ReactDom/modules/RCTTiming.js | 30 +- .../ReactDom/modules/RCTTouchEvent.js | 5 +- .../ReactDom/modules/RCTTouchHandler.js | 10 +- .../ReactDom/modules/RCTUIManager.js | 1330 ++--- ....js => RCTUIManagerObserverCoordinator.js} | 5 +- .../ReactDom/modules/RCTVibration.js | 28 +- .../ReactDom/modules/RCTWebSocketModule.js | 30 +- .../ReactDom/modules/RedBox/RCTRedBox.js | 20 +- .../ReactDom/utils/BundleFromRoot.js | 5 +- .../react-native-dom/ReactDom/utils/CanUse.js | 5 +- .../ReactDom/utils/ColorArrayFromHexARGB.js | 5 +- .../ReactDom/utils/CustomElement.js | 10 - .../react-native-dom/ReactDom/utils/Guid.js | 5 +- .../ReactDom/utils/Instrument.js | 5 +- ...{MatrixMath.dom.js => NativeMatrixMath.js} | 7 +- .../react-native-dom/ReactDom/utils/isIOS.js | 5 +- .../ReactDom/utils/prefixInlineStyles.js | 5 +- .../ReactDom/views/Image/RCTImageLoader.js | 25 +- .../ReactDom/views/Image/RCTImageSource.js | 5 +- .../ReactDom/views/Image/RCTImageView.js | 46 +- .../views/Image/RCTImageViewManager.js | 195 +- .../views/RCTActivityIndicatorView.js | 19 +- .../views/RCTActivityIndicatorViewManager.js | 68 +- .../ReactDom/views/RCTComponent.js | 7 +- .../ReactDom/views/RCTComponentData.js | 60 +- .../ReactDom/views/RCTPropDescription.js | 150 + .../ReactDom/views/RCTPropTypes.js | 12 + .../ReactDom/views/RCTRootShadowView.js | 83 +- .../views/RCTScrollContentViewManager.js | 24 +- .../ReactDom/views/RCTScrollView.js | 30 +- .../ReactDom/views/RCTScrollViewLocalData.js | 5 +- .../ReactDom/views/RCTScrollViewManager.js | 215 +- .../ReactDom/views/RCTShadowScrollView.js | 48 +- .../ReactDom/views/RCTShadowView.js | 533 +- .../ReactDom/views/RCTView.js | 44 +- .../ReactDom/views/RCTViewManager.js | 484 +- .../SafeAreaView/RCTSafeAreaViewManager.js | 19 +- .../ReactDom/views/Switch/RCTSwitch.js | 25 +- .../ReactDom/views/Switch/RCTSwitchManager.js | 96 +- .../views/Text/Metrics/TextMetrics.js | 581 ++ .../ReactDom/views/Text/Metrics/TextStyle.js | 230 + .../views/Text/Metrics/deepCopyProperties.js | 46 + .../ReactDom/views/Text/RCTRawText.js | 15 +- .../ReactDom/views/Text/RCTRawTextManager.js | 53 +- .../ReactDom/views/Text/RCTShadowRawText.js | 72 +- .../ReactDom/views/Text/RCTShadowText.js | 488 +- .../views/Text/RCTSharedTextValues.js | 17 +- .../ReactDom/views/Text/RCTText.js | 44 +- .../ReactDom/views/Text/RCTTextInput.js | 91 +- .../views/Text/RCTTextInputManager.js | 103 +- .../ReactDom/views/Text/RCTTextManager.js | 242 +- .../ReactDom/views/WebView/RCTWebView.js | 9 +- .../views/WebView/RCTWebViewManager.js | 128 +- .../flow-typed/npm/history_v4.x.x.js | 125 + .../flow-typed/npm/idb-keyval_vx.x.x.js | 60 + .../flow-typed/npm/rndom-switch.js | 6 +- .../flow-typed/npm/yoga-dom.js | 5 +- packages/react-native-dom/jest/hasteImpl.js | 82 + .../react-native-dom/local-cli/constants.js | 2 + .../local-cli/core/dom/findDepConfigPath.js | 36 + .../core/dom/findVendorModulePath.js | 28 + .../local-cli/core/dom/getDomRequirePath.js | 34 + .../local-cli/core/dom/index.js | 29 + .../generator-dom/cli-config-updater.js | 135 - .../local-cli/generator-dom/index.js | 14 - .../generator-dom/templates/rn-cli.config.js | 12 - .../local-cli/link/dom/getDependencyConfig.js | 6 + .../local-cli/link/dom/isInstalled.js | 22 + .../link/dom/registerNativeModule.js | 26 + .../link/dom/unregisterNativeModule.js | 15 + .../link/dom/updateDependencyConfig.js | 5 + .../link/dom/updateVendorModuleFile.js | 39 + .../react-native-dom/local-cli/link/index.js | 7 + .../react-native-dom/local-cli/platform.js | 6 + packages/react-native-dom/metro.config.js | 18 + packages/react-native-dom/package.json | 99 +- packages/react-native-dom/rn-cli.config.js | 33 - .../scripts/babel-plugin-haste-require.js | 7 +- .../scripts/eslint-module-resolver-haste.js | 18 +- packages/rndom-redbox/.babelrc | 19 - packages/rndom-redbox/package.json | 21 +- packages/rndom-redbox/rollup.config.js | 17 +- packages/rndom-switch/.babelrc | 19 - packages/rndom-switch/package.json | 21 +- packages/rndom-switch/rollup.config.js | 17 +- website/blog/2016-03-11-blog-post.md | 57 + website/blog/2017-04-10-blog-post-two.md | 57 + website/blog/2017-09-25-testing-rss.md | 14 + website/blog/2017-09-26-adding-rss.md | 10 + website/blog/2017-10-24-new-version-1.0.0.md | 8 + website/core/Footer.js | 106 + website/package.json | 17 + website/pages/en/help.js | 57 + website/pages/en/index.js | 340 ++ website/pages/en/users.js | 49 + website/sidebars.json | 10 + website/siteConfig.js | 112 + website/static/css/custom.css | 154 + website/static/img/docusaurus.svg | 1 + website/static/img/favicon.png | Bin 0 -> 984 bytes .../img/favicon/apple-touch-icon-114x114.png | Bin 0 -> 8910 bytes .../img/favicon/apple-touch-icon-120x120.png | Bin 0 -> 9361 bytes .../img/favicon/apple-touch-icon-144x144.png | Bin 0 -> 11378 bytes .../img/favicon/apple-touch-icon-152x152.png | Bin 0 -> 12124 bytes .../img/favicon/apple-touch-icon-180x180.png | Bin 0 -> 15445 bytes .../img/favicon/apple-touch-icon-57x57.png | Bin 0 -> 3842 bytes .../img/favicon/apple-touch-icon-60x60.png | Bin 0 -> 4053 bytes .../img/favicon/apple-touch-icon-72x72.png | Bin 0 -> 4982 bytes .../img/favicon/apple-touch-icon-76x76.png | Bin 0 -> 5481 bytes .../static/img/favicon/apple-touch-icon.png | Bin 0 -> 15445 bytes website/static/img/favicon/favicon-16x16.png | Bin 0 -> 908 bytes website/static/img/favicon/favicon-32x32.png | Bin 0 -> 1787 bytes website/static/img/favicon/favicon.ico | Bin 0 -> 13094 bytes .../img/favicon/launcher-icon-0-75x.png | Bin 0 -> 1787 bytes .../static/img/favicon/launcher-icon-1-5x.png | Bin 0 -> 4982 bytes .../static/img/favicon/launcher-icon-1x.png | Bin 0 -> 3058 bytes .../static/img/favicon/launcher-icon-2x.png | Bin 0 -> 6923 bytes .../static/img/favicon/launcher-icon-3x.png | Bin 0 -> 11378 bytes .../static/img/favicon/launcher-icon-4x.png | Bin 0 -> 16842 bytes website/static/img/favicon/manifest.json | 42 + website/static/img/favicon/readme.txt | 22 + website/static/img/metro.svg | 15 + website/static/img/oss_logo.png | Bin 0 -> 4370 bytes website/static/img/react-native-logo.png | Bin 0 -> 51602 bytes website/static/img/react-native-logo@2x.png | Bin 0 -> 120451 bytes website/static/img/react-native-logo@svg.svg | 16 + website/static/img/react.svg | 9 + website/static/img/rn-dom-logo-favicon.png | Bin 0 -> 1307 bytes website/static/img/rn-dom-logo-large.svg | 12 + website/static/img/rn-dom-logo.sketch | Bin 0 -> 30556 bytes website/static/img/rn-dom-logo.svg | 11 + website/static/img/yoga.svg | 17 + yarn.lock | 4860 +++++++++++------ 205 files changed, 10579 insertions(+), 5358 deletions(-) create mode 100644 Examples/index.html create mode 100644 docs/doc1.md create mode 100644 docs/doc2.md create mode 100644 docs/doc3.md create mode 100644 docs/exampledoc4.md create mode 100644 docs/exampledoc5.md delete mode 100644 packages/react-native-dom/Examples/index.html create mode 100644 packages/react-native-dom/Libraries/Components/Clipboard/Clipboard.dom.js create mode 100644 packages/react-native-dom/Libraries/YellowBox/UI/YellowBoxInspectorHeader.dom.js rename packages/react-native-dom/ReactDom/{index.js => ReactDom.js} (50%) create mode 100644 packages/react-native-dom/ReactDom/base/UIChildContainerView.js create mode 100644 packages/react-native-dom/ReactDom/base/UIHitSlopView.js rename packages/react-native-dom/ReactDom/defs/{internal.js => InternalLib.js} (86%) rename packages/react-native-dom/ReactDom/modules/LayoutAnimation/{RTCKeyframeGenerator.js => RCTKeyframeGenerator.js} (96%) create mode 100644 packages/react-native-dom/ReactDom/modules/RCTHistory.js create mode 100644 packages/react-native-dom/ReactDom/modules/RCTI18nManager.js rename packages/react-native-dom/ReactDom/modules/{RCTEventEmitter.js => RCTNativeEventEmitter.js} (57%) create mode 100644 packages/react-native-dom/ReactDom/modules/RCTNativeViewHierarchyOptimizer.js rename packages/react-native-dom/ReactDom/modules/{RCTNetworking.js => RCTNetworkingNative.js} (86%) rename packages/react-native-dom/ReactDom/modules/{RCTUIManagerObserver.js => RCTUIManagerObserverCoordinator.js} (97%) delete mode 100644 packages/react-native-dom/ReactDom/utils/CustomElement.js rename packages/react-native-dom/ReactDom/utils/{MatrixMath.dom.js => NativeMatrixMath.js} (99%) create mode 100644 packages/react-native-dom/ReactDom/views/RCTPropDescription.js create mode 100644 packages/react-native-dom/ReactDom/views/RCTPropTypes.js create mode 100644 packages/react-native-dom/ReactDom/views/Text/Metrics/TextMetrics.js create mode 100644 packages/react-native-dom/ReactDom/views/Text/Metrics/TextStyle.js create mode 100644 packages/react-native-dom/ReactDom/views/Text/Metrics/deepCopyProperties.js create mode 100644 packages/react-native-dom/flow-typed/npm/history_v4.x.x.js create mode 100644 packages/react-native-dom/flow-typed/npm/idb-keyval_vx.x.x.js create mode 100644 packages/react-native-dom/jest/hasteImpl.js create mode 100644 packages/react-native-dom/local-cli/constants.js create mode 100644 packages/react-native-dom/local-cli/core/dom/findDepConfigPath.js create mode 100644 packages/react-native-dom/local-cli/core/dom/findVendorModulePath.js create mode 100644 packages/react-native-dom/local-cli/core/dom/getDomRequirePath.js create mode 100644 packages/react-native-dom/local-cli/core/dom/index.js delete mode 100644 packages/react-native-dom/local-cli/generator-dom/cli-config-updater.js delete mode 100644 packages/react-native-dom/local-cli/generator-dom/templates/rn-cli.config.js create mode 100644 packages/react-native-dom/local-cli/link/dom/getDependencyConfig.js create mode 100644 packages/react-native-dom/local-cli/link/dom/isInstalled.js create mode 100644 packages/react-native-dom/local-cli/link/dom/registerNativeModule.js create mode 100644 packages/react-native-dom/local-cli/link/dom/unregisterNativeModule.js create mode 100644 packages/react-native-dom/local-cli/link/dom/updateDependencyConfig.js create mode 100644 packages/react-native-dom/local-cli/link/dom/updateVendorModuleFile.js create mode 100644 packages/react-native-dom/local-cli/link/index.js create mode 100644 packages/react-native-dom/local-cli/platform.js create mode 100644 packages/react-native-dom/metro.config.js delete mode 100644 packages/react-native-dom/rn-cli.config.js delete mode 100644 packages/rndom-redbox/.babelrc delete mode 100644 packages/rndom-switch/.babelrc create mode 100755 website/blog/2016-03-11-blog-post.md create mode 100644 website/blog/2017-04-10-blog-post-two.md create mode 100644 website/blog/2017-09-25-testing-rss.md create mode 100644 website/blog/2017-09-26-adding-rss.md create mode 100644 website/blog/2017-10-24-new-version-1.0.0.md create mode 100644 website/core/Footer.js create mode 100644 website/package.json create mode 100755 website/pages/en/help.js create mode 100755 website/pages/en/index.js create mode 100644 website/pages/en/users.js create mode 100644 website/sidebars.json create mode 100644 website/siteConfig.js create mode 100644 website/static/css/custom.css create mode 100755 website/static/img/docusaurus.svg create mode 100755 website/static/img/favicon.png create mode 100755 website/static/img/favicon/apple-touch-icon-114x114.png create mode 100755 website/static/img/favicon/apple-touch-icon-120x120.png create mode 100755 website/static/img/favicon/apple-touch-icon-144x144.png create mode 100755 website/static/img/favicon/apple-touch-icon-152x152.png create mode 100755 website/static/img/favicon/apple-touch-icon-180x180.png create mode 100755 website/static/img/favicon/apple-touch-icon-57x57.png create mode 100755 website/static/img/favicon/apple-touch-icon-60x60.png create mode 100755 website/static/img/favicon/apple-touch-icon-72x72.png create mode 100755 website/static/img/favicon/apple-touch-icon-76x76.png create mode 100755 website/static/img/favicon/apple-touch-icon.png create mode 100755 website/static/img/favicon/favicon-16x16.png create mode 100755 website/static/img/favicon/favicon-32x32.png create mode 100755 website/static/img/favicon/favicon.ico create mode 100755 website/static/img/favicon/launcher-icon-0-75x.png create mode 100755 website/static/img/favicon/launcher-icon-1-5x.png create mode 100755 website/static/img/favicon/launcher-icon-1x.png create mode 100755 website/static/img/favicon/launcher-icon-2x.png create mode 100755 website/static/img/favicon/launcher-icon-3x.png create mode 100755 website/static/img/favicon/launcher-icon-4x.png create mode 100755 website/static/img/favicon/manifest.json create mode 100755 website/static/img/favicon/readme.txt create mode 100644 website/static/img/metro.svg create mode 100755 website/static/img/oss_logo.png create mode 100644 website/static/img/react-native-logo.png create mode 100644 website/static/img/react-native-logo@2x.png create mode 100644 website/static/img/react-native-logo@svg.svg create mode 100755 website/static/img/react.svg create mode 100755 website/static/img/rn-dom-logo-favicon.png create mode 100755 website/static/img/rn-dom-logo-large.svg create mode 100755 website/static/img/rn-dom-logo.sketch create mode 100755 website/static/img/rn-dom-logo.svg create mode 100644 website/static/img/yoga.svg diff --git a/.flowconfig b/.flowconfig index f9805d50c..19252f320 100644 --- a/.flowconfig +++ b/.flowconfig @@ -28,6 +28,20 @@ packages/react-native-dom/flow-typed [options] module.system.node.resolve_dirname=node_modules module.system.node.resolve_dirname=packages/react-native-dom/node_modules -esproposal.decorators=ignore module.system=haste +module.system.haste.use_name_reducers=true + +# keep the following in sync with server/haste/hasteImpl.js +# get basename +module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1' +# strip .js or .js.flow suffix +module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1' +# strip .dom suffix +module.system.haste.name_reducers='^\(.*\)\.dom$' -> '\1' +module.system.haste.paths.whitelist=/packages/react-native-dom/Libraries/.* +module.system.haste.paths.whitelist=/packages/react-native-dom/RNTester/.* +module.system.haste.paths.whitelist=/packages/react-native-dom/ReactDom/.* + +[version] +^0.75.0 \ No newline at end of file diff --git a/.gitignore b/.gitignore index bcde016b1..2bf9ff300 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,14 @@ +.DS_Store + node_modules lerna-debug.log -TestApp \ No newline at end of file +TestApp + +lib/core/metadata.js +lib/core/MetadataBlog.js + +website/translated_docs +website/build/ +website/yarn.lock +website/node_modules +website/i18n/* \ No newline at end of file diff --git a/Examples/index.html b/Examples/index.html new file mode 100644 index 000000000..b544ff4a8 --- /dev/null +++ b/Examples/index.html @@ -0,0 +1,30 @@ + + + + React Native DOM Examples + + + + +

React Native DOM Examples

+ + \ No newline at end of file diff --git a/docs/doc1.md b/docs/doc1.md new file mode 100644 index 000000000..c0db478e6 --- /dev/null +++ b/docs/doc1.md @@ -0,0 +1,93 @@ +--- +id: doc1 +title: Latin-ish +sidebar_label: Example Page +--- + +Check the [documentation](https://docusaurus.io) for how to use Docusaurus. + +## Lorem + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum +dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem +ipsum dolor sit amet, consectetur adipiscing elit. Vivamus elementum massa eget +nulla aliquet sagittis. Proin odio tortor, vulputate ut odio in, ultrices +ultricies augue. Cras ornare ultrices lorem malesuada iaculis. Etiam sit amet +libero tempor, pulvinar mauris sed, sollicitudin sapien. + +## Mauris In Code + +```js +// Expression bodies +var odds = evens.map((v) => v + 1); +var nums = evens.map((v, i) => v + i); + +// Statement bodies +nums.forEach((v) => { + if (v % 5 === 0) fives.push(v); +}); + +// Lexical this +var bob = { + _name: "Bob", + _friends: [], + printFriends() { + this._friends.forEach((f) => console.log(this._name + " knows " + f)); + } +}; + +// Lexical arguments +function square() { + let example = () => { + let numbers = []; + for (let number of arguments) { + numbers.push(number * number); + } + + return numbers; + }; + + return example(); +} + +square(2, 4, 7.5, 8, 11.5, 21); // returns: [4, 16, 56.25, 64, 132.25, 441] +``` + +## Nulla + +Nulla facilisi. Maecenas sodales nec purus eget posuere. Sed sapien quam, +pretium a risus in, porttitor dapibus erat. Sed sit amet fringilla ipsum, eget +iaculis augue. Integer sollicitudin tortor quis ultricies aliquam. Suspendisse +fringilla nunc in tellus cursus, at placerat tellus scelerisque. Sed tempus elit +a sollicitudin rhoncus. Nulla facilisi. Morbi nec dolor dolor. Orci varius +natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras +et aliquet lectus. Pellentesque sit amet eros nisi. Quisque ac sapien in sapien +congue accumsan. Nullam in posuere ante. Vestibulum ante ipsum primis in +faucibus orci luctus et ultrices posuere cubilia Curae; Proin lacinia leo a nibh +fringilla pharetra. + +## Orci + +Orci varius natoque penatibus et magnis dis parturient montes, nascetur +ridiculus mus. Proin venenatis lectus dui, vel ultrices ante bibendum hendrerit. +Aenean egestas feugiat dui id hendrerit. Orci varius natoque penatibus et magnis +dis parturient montes, nascetur ridiculus mus. Curabitur in tellus laoreet, +eleifend nunc id, viverra leo. Proin vulputate non dolor vel vulputate. +Curabitur pretium lobortis felis, sit amet finibus lorem suscipit ut. Sed non +mollis risus. Duis sagittis, mi in euismod tincidunt, nunc mauris vestibulum +urna, at euismod est elit quis erat. Phasellus accumsan vitae neque eu placerat. +In elementum arcu nec tellus imperdiet, eget maximus nulla sodales. Curabitur eu +sapien eget nisl sodales fermentum. + +## Phasellus + +Phasellus pulvinar ex id commodo imperdiet. Praesent odio nibh, sollicitudin sit +amet faucibus id, placerat at metus. Donec vitae eros vitae tortor hendrerit +finibus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Quisque +vitae purus dolor. Duis suscipit ac nulla et finibus. Phasellus ac sem sed dui +dictum gravida. Phasellus eleifend vestibulum facilisis. Integer pharetra nec +enim vitae mattis. Duis auctor, lectus quis condimentum bibendum, nunc dolor +aliquam massa, id bibendum orci velit quis magna. Ut volutpat nulla nunc, sed +interdum magna condimentum non. Sed urna metus, scelerisque vitae consectetur a, +feugiat quis magna. Donec dignissim ornare nisl, eget tempor risus malesuada +quis. diff --git a/docs/doc2.md b/docs/doc2.md new file mode 100644 index 000000000..20c0c95a6 --- /dev/null +++ b/docs/doc2.md @@ -0,0 +1,7 @@ +--- +id: doc2 +title: document number 2 +--- + +This is a link to [another document.](doc3.md) +This is a link to an [external page.](http://www.example.com) diff --git a/docs/doc3.md b/docs/doc3.md new file mode 100644 index 000000000..8d36aa618 --- /dev/null +++ b/docs/doc3.md @@ -0,0 +1,37 @@ +--- +id: doc3 +title: This is document number 3 +--- + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ac euismod odio, eu +consequat dui. Nullam molestie consectetur risus id imperdiet. Proin sodales +ornare turpis, non mollis massa ultricies id. Nam at nibh scelerisque, feugiat +ante non, dapibus tortor. Vivamus volutpat diam quis tellus elementum bibendum. +Praesent semper gravida velit quis aliquam. Etiam in cursus neque. Nam lectus +ligula, malesuada et mauris a, bibendum faucibus mi. Phasellus ut interdum +felis. Phasellus in odio pulvinar, porttitor urna eget, fringilla lectus. +Aliquam sollicitudin est eros. Mauris consectetur quam vitae mauris interdum +hendrerit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. + +Duis et egestas libero, imperdiet faucibus ipsum. Sed posuere eget urna vel +feugiat. Vivamus a arcu sagittis, fermentum urna dapibus, congue lectus. Fusce +vulputate porttitor nisl, ac cursus elit volutpat vitae. Nullam vitae ipsum +egestas, convallis quam non, porta nibh. Morbi gravida erat nec neque bibendum, +eu pellentesque velit posuere. Fusce aliquam erat eu massa eleifend tristique. + +Sed consequat sollicitudin ipsum eget tempus. Integer a aliquet velit. In justo +nibh, pellentesque non suscipit eget, gravida vel lacus. Donec odio ante, +malesuada in massa quis, pharetra tristique ligula. Donec eros est, tristique +eget finibus quis, semper non nisl. Vivamus et elit nec enim ornare placerat. +Sed posuere odio a elit cursus sagittis. + +Phasellus feugiat purus eu tortor ultrices finibus. Ut libero nibh, lobortis et +libero nec, dapibus posuere eros. Sed sagittis euismod justo at consectetur. +Nulla finibus libero placerat, cursus sapien at, eleifend ligula. Vivamus elit +nisl, hendrerit ac nibh eu, ultrices tempus dui. Nam tellus neque, commodo non +rhoncus eu, gravida in risus. Nullam id iaculis tortor. + +Nullam at odio in sem varius tempor sit amet vel lorem. Etiam eu hendrerit nisl. +Fusce nibh mauris, vulputate sit amet ex vitae, congue rhoncus nisl. Sed eget +tellus purus. Nullam tempus commodo erat ut tristique. Cras accumsan massa sit +amet justo consequat eleifend. Integer scelerisque vitae tellus id consectetur. diff --git a/docs/exampledoc4.md b/docs/exampledoc4.md new file mode 100644 index 000000000..6f94ffe91 --- /dev/null +++ b/docs/exampledoc4.md @@ -0,0 +1,6 @@ +--- +id: doc4 +title: Other Document +--- + +this is another document diff --git a/docs/exampledoc5.md b/docs/exampledoc5.md new file mode 100644 index 000000000..92e2d0d5b --- /dev/null +++ b/docs/exampledoc5.md @@ -0,0 +1,6 @@ +--- +id: doc5 +title: Fifth Document +--- + +Another one diff --git a/package.json b/package.json index e9d23a1f5..a2a1914f7 100644 --- a/package.json +++ b/package.json @@ -8,15 +8,33 @@ "bugs": { "url": "https://github.com/vincentriemer/react-native-dom/issues" }, + "repository": { + "type": "git", + "url": "https://github.com/vincentriemer/react-native-dom.git" + }, "license": "MIT", "author": { "name": "Vincent Riemer", "email": "vincentriemer+rndom@gmail.com", "url": "https://vincentriemer.com" }, - "repository": { - "type": "git", - "url": "https://github.com/vincentriemer/react-native-dom.git" + "workspaces": { + "packages": [ + "packages/*" + ], + "nohoist": [ + "**/react-native", + "**/react-native/**", + "**/@babel/runtime", + "**/@abel/runtime/**", + "**/pepjs", + "**/pepjs/**", + "**/webcomponentsjs", + "**/webcomponentsjs/**", + "**/web-animations-js", + "**/web-animations-js/**", + "**/react-native-dom/**" + ] }, "scripts": { "clean": "shx rm -rf packages/*/lib", @@ -42,13 +60,14 @@ "all-contributors-cli": "^4.11.1", "babel-eslint": "^8.2.3", "cz-conventional-changelog": "^2.1.0", - "eslint": "^4.19.1", + "eslint": "^5.0.1", "eslint-import-resolver-lerna": "^1.0.0", "eslint-plugin-import": "^2.11.0", "eslint-plugin-prettier": "^2.6.0", - "flow-bin": "^0.73.0", + "flow-bin": "^0.75.0", "husky": "^0.14.3", "lerna": "^2.4.0", + "lint-staged": "^7.2.2", "prettier": "^1.12.1", "shelljs": "^0.8.2", "shx": "^0.2.2", @@ -56,15 +75,17 @@ "wait-port": "^0.2.2" }, "lint-staged": { - "package.json": ["sort-package-json", "git add"], - "*.js": ["eslint --fix", "git add"], - "*.{js,json,css,md}": ["prettier --write", "git add"] - }, - "resolutions": { - "react": "^16.3.1" - }, - "workspaces": { - "packages": ["packages/*"], - "nohoist": ["**/react-native", "**/react-native/**"] + "package.json": [ + "sort-package-json", + "git add" + ], + "*.js": [ + "eslint --fix", + "git add" + ], + "*.{js,json,css,md}": [ + "prettier --write", + "git add" + ] } } diff --git a/packages/react-native-dom/.babelrc b/packages/react-native-dom/.babelrc index 76d54e09b..6dfb28ac4 100644 --- a/packages/react-native-dom/.babelrc +++ b/packages/react-native-dom/.babelrc @@ -1,32 +1,23 @@ { - "sourceMaps": "inline", - "presets": ["flow", "react-native"], + "presets": ["@babel/flow", "module:metro-react-native-babel-preset"], "plugins": [ - "syntax-trailing-function-commas", - "transform-object-rest-spread", - "transform-decorators-legacy", - "transform-class-properties", + "@babel/plugin-syntax-dynamic-import", + "@babel/plugin-proposal-object-rest-spread", + ["@babel/plugin-proposal-nullish-coalescing-operator", { "loose": true }], [ - "transform-runtime", + "@babel/plugin-transform-runtime", { "helpers": true, - "polyfill": false, "regenerator": true } ], "transform-inline-environment-variables", "preval", - [ - "babel-plugin-transform-builtin-classes", - { - "globals": ["HTMLElement"] - } - ], "./scripts/babel-plugin-haste-require" ], "env": { "lib": { - "presets": ["flow"] + "presets": ["@babel/flow"] } } } diff --git a/packages/react-native-dom/Examples/index.html b/packages/react-native-dom/Examples/index.html deleted file mode 100644 index c276fab27..000000000 --- a/packages/react-native-dom/Examples/index.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - React Native DOM Examples - - - - -

React Native DOM Examples

- - \ No newline at end of file diff --git a/packages/react-native-dom/Libraries/Components/Clipboard/Clipboard.dom.js b/packages/react-native-dom/Libraries/Components/Clipboard/Clipboard.dom.js new file mode 100644 index 000000000..78ced09d2 --- /dev/null +++ b/packages/react-native-dom/Libraries/Components/Clipboard/Clipboard.dom.js @@ -0,0 +1,9 @@ +// @flow + +// TODO: Replace with real implementation +module.exports = { + getString() { + return Promise.resolve(""); + }, + setString(content: string) {} +}; diff --git a/packages/react-native-dom/Libraries/Components/TextInput/TextInputState.dom.js b/packages/react-native-dom/Libraries/Components/TextInput/TextInputState.dom.js index 999cd8bc0..8b273a2ce 100644 --- a/packages/react-native-dom/Libraries/Components/TextInput/TextInputState.dom.js +++ b/packages/react-native-dom/Libraries/Components/TextInput/TextInputState.dom.js @@ -1,76 +1,91 @@ /** * 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. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. * - * @providesModule TextInputState - * @flow * * This class is responsible for coordinating the "focused" * state for TextInputs. All calls relating to the keyboard * should be funneled through here + * + * @format + * @flow */ + "use strict"; -var Platform = require("Platform"); -var UIManager = require("UIManager"); +const Platform = require("Platform"); +const UIManager = require("UIManager"); -var TextInputState = { - /** - * Internal state - */ - _currentlyFocusedID: (null: ?number), +let currentlyFocusedID: ?number = null; +const inputs = new Set(); - /** - * Returns the ID of the currently focused text field, if one exists - * If no text field is focused it returns null - */ - currentlyFocusedField: function(): ?number { - return this._currentlyFocusedID; - }, +/** + * Returns the ID of the currently focused text field, if one exists + * If no text field is focused it returns null + */ +function currentlyFocusedField(): ?number { + return currentlyFocusedID; +} - /** - * @param {number} TextInputID id of the text field to focus - * Focuses the specified text field - * noop if the text field was already focused - */ - focusTextInput: function(textFieldID: ?number) { - if (this._currentlyFocusedID !== textFieldID && textFieldID !== null) { - this._currentlyFocusedID = textFieldID; - if (Platform.OS === "ios" || Platform.OS === "web") { - UIManager.focus(textFieldID); - } else if (Platform.OS === "android") { - UIManager.dispatchViewManagerCommand( - textFieldID, - UIManager.AndroidTextInput.Commands.focusTextInput, - null - ); - } +/** + * @param {number} TextInputID id of the text field to focus + * Focuses the specified text field + * noop if the text field was already focused + */ +function focusTextInput(textFieldID: ?number) { + if (currentlyFocusedID !== textFieldID && textFieldID !== null) { + currentlyFocusedID = textFieldID; + if (Platform.OS === "ios" || Platform.OS === "dom") { + UIManager.focus(textFieldID); + } else if (Platform.OS === "android") { + UIManager.dispatchViewManagerCommand( + textFieldID, + UIManager.AndroidTextInput.Commands.focusTextInput, + null + ); } - }, + } +} - /** - * @param {number} textFieldID id of the text field to unfocus - * Unfocuses the specified text field - * noop if it wasn't focused - */ - blurTextInput: function(textFieldID: ?number) { - if (this._currentlyFocusedID === textFieldID && textFieldID !== null) { - this._currentlyFocusedID = null; - if (Platform.OS === "ios" || Platform.OS === "web") { - UIManager.blur(textFieldID); - } else if (Platform.OS === "android") { - UIManager.dispatchViewManagerCommand( - textFieldID, - UIManager.AndroidTextInput.Commands.blurTextInput, - null - ); - } +/** + * @param {number} textFieldID id of the text field to unfocus + * Unfocuses the specified text field + * noop if it wasn't focused + */ +function blurTextInput(textFieldID: ?number) { + if (currentlyFocusedID === textFieldID && textFieldID !== null) { + currentlyFocusedID = null; + if (Platform.OS === "ios" || Platform.OS === "dom") { + UIManager.blur(textFieldID); + } else if (Platform.OS === "android") { + UIManager.dispatchViewManagerCommand( + textFieldID, + UIManager.AndroidTextInput.Commands.blurTextInput, + null + ); } } -}; +} -module.exports = TextInputState; +function registerInput(textFieldID: number) { + inputs.add(textFieldID); +} + +function unregisterInput(textFieldID: number) { + inputs.delete(textFieldID); +} + +function isTextInput(textFieldID: number) { + return inputs.has(textFieldID); +} + +module.exports = { + currentlyFocusedField, + focusTextInput, + blurTextInput, + registerInput, + unregisterInput, + isTextInput +}; diff --git a/packages/react-native-dom/Libraries/Components/WebView/WebView.dom.js b/packages/react-native-dom/Libraries/Components/WebView/WebView.dom.js index ef3cb0385..5a20ccfc2 100644 --- a/packages/react-native-dom/Libraries/Components/WebView/WebView.dom.js +++ b/packages/react-native-dom/Libraries/Components/WebView/WebView.dom.js @@ -212,7 +212,10 @@ class WebView extends React.Component { * - fast: 0.99 (the default for iOS web view) * @platform ios */ - decelerationRate: ScrollView.propTypes.decelerationRate, + decelerationRate: PropTypes.oneOfType([ + PropTypes.oneOf(["fast", "normal"]), + PropTypes.number + ]), /** * Boolean value that determines whether scrolling is enabled in the * `WebView`. The default value is `true`. diff --git a/packages/react-native-dom/Libraries/Components/button.dom.js b/packages/react-native-dom/Libraries/Components/button.dom.js index 4201d4e7a..e17d9c881 100644 --- a/packages/react-native-dom/Libraries/Components/button.dom.js +++ b/packages/react-native-dom/Libraries/Components/button.dom.js @@ -1,14 +1,13 @@ /** * 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. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. * - * @providesModule Button + * @format * @flow */ + "use strict"; const ColorPropType = require("ColorPropType"); @@ -38,6 +37,9 @@ const invariant = require("fbjs/lib/invariant"); * Example usage: * * ``` + * import { Button } from 'react-native'; + * ... + * *