Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Slider from react-native-community lib #1620

Merged
merged 22 commits into from
Dec 5, 2019
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ repositories {


dependencies {
implementation project(':@react-native-community_slider')
implementation project(':react-native-video')
implementation project(':react-native-svg')
implementation project(':react-native-aztec')
Expand Down
2 changes: 2 additions & 0 deletions android/app/src/main/java/com/gutenberg/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import androidx.core.util.Consumer;

import com.facebook.react.ReactApplication;
import com.reactnativecommunity.slider.ReactSliderPackage;
import com.brentvatne.react.ReactVideoPackage;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.devsupport.interfaces.DevOptionHandler;
Expand Down Expand Up @@ -126,6 +127,7 @@ public boolean getUseDeveloperSupport() {
protected List<ReactPackage> getPackages() {
return Arrays.asList(
new MainReactPackage(),
new ReactSliderPackage(),
new ReactVideoPackage(),
new SvgPackage(),
new ReactAztecPackage(),
Expand Down
2 changes: 2 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
rootProject.name = 'gutenberg'
include ':@react-native-community_slider'
project(':@react-native-community_slider').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/slider/src/android')
include ':react-native-video'
project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android-exoplayer')
include ':react-native-svg'
Expand Down
4 changes: 2 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = function( api ) {
},
],
],
exclude: /node_modules\/react-native/,
exclude: /node_modules\/(react-native|@react-native-community)/,
},
{
// Auto-add `import { createElement } from '@wordpress/element';` when JSX is found
Expand All @@ -41,7 +41,7 @@ module.exports = function( api ) {
},
],
],
exclude: /node_modules\/react-native/,
exclude: /node_modules\/(react-native|@react-native-community)/,
},
],
env: {
Expand Down
46 changes: 46 additions & 0 deletions ios/gutenberg.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
2D16E6881FA4F8E400B85C8A /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D16E6891FA4F8E400B85C8A /* libReact.a */; };
2DCD954D1E0B4F2C00145EB5 /* gutenbergTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* gutenbergTests.m */; };
2DF0FFEE2056DD460020B375 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3EA31DF850E9000B6D8A /* libReact.a */; };
40E54E0E0C4243D1947A9498 /* libRNCSlider.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D7F3ECD6334A43BCA1028B5D /* libRNCSlider.a */; };
5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; };
7E45CC5B218B42E000C0B2AB /* libRNReactNativeGutenbergBridge.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E45CC5A218B42C000C0B2AB /* libRNReactNativeGutenbergBridge.a */; };
7E8FA9582301CAB000D007F0 /* libRNDarkMode.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E8FA9522301CA9E00D007F0 /* libRNDarkMode.a */; };
Expand Down Expand Up @@ -113,6 +114,13 @@
remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192;
remoteInfo = React;
};
21EE9A4F238E72DC0017A14C /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 32A2662FE92B40E281A5CB2A /* RNCSlider.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 28C79A09220DC4CC0061DE82;
remoteInfo = RNCSlider;
};
2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
Expand Down Expand Up @@ -415,6 +423,7 @@
2D02E47B1E0B4A5D006451C7 /* gutenberg-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "gutenberg-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
2D02E4901E0B4A5D006451C7 /* gutenberg-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "gutenberg-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
2D16E6891FA4F8E400B85C8A /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; };
32A2662FE92B40E281A5CB2A /* RNCSlider.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNCSlider.xcodeproj; path = "../node_modules/@react-native-community/slider/src/ios/RNCSlider.xcodeproj"; sourceTree = "<group>"; };
3ADEFEC092CF4D00BEF1019E /* libRNTAztecView.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNTAztecView.a; sourceTree = "<group>"; };
3D53EF8FEF024C98A7AC9A56 /* libRCTVideo.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRCTVideo.a; sourceTree = "<group>"; };
5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = "<group>"; };
Expand All @@ -431,6 +440,7 @@
9B18D59B9364468890D0E546 /* RNSVG.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNSVG.xcodeproj; path = "../node_modules/react-native-svg/ios/RNSVG.xcodeproj"; sourceTree = "<group>"; };
9BFAFEB337654221B2F14D03 /* libRNSVG-tvOS.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = "libRNSVG-tvOS.a"; sourceTree = "<group>"; };
ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTBlob.xcodeproj; path = "../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj"; sourceTree = "<group>"; };
D7F3ECD6334A43BCA1028B5D /* libRNCSlider.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNCSlider.a; sourceTree = "<group>"; };
E74B8C5507C34F8DBD70AECC /* RNSafeArea.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNSafeArea.xcodeproj; path = "../node_modules/react-native-safe-area/ios/RNSafeArea.xcodeproj"; sourceTree = "<group>"; };
F1289ECA2100E4320091E81D /* Aztec.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Aztec.framework; sourceTree = BUILT_PRODUCTS_DIR; };
F15198372100DC3C000F6E97 /* gutenberg-Bridging-Header.h */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = "gutenberg-Bridging-Header.h"; sourceTree = "<group>"; tabWidth = 1; };
Expand Down Expand Up @@ -481,6 +491,7 @@
7E45CC5B218B42E000C0B2AB /* libRNReactNativeGutenbergBridge.a in Frameworks */,
16AEBAC87CB24520ADA106D7 /* libRNSafeArea.a in Frameworks */,
E7502A18084B44E7AB172B10 /* libRCTVideo.a in Frameworks */,
40E54E0E0C4243D1947A9498 /* libRNCSlider.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -621,6 +632,14 @@
name = Products;
sourceTree = "<group>";
};
21EE9A4C238E72DC0017A14C /* Products */ = {
isa = PBXGroup;
children = (
21EE9A50238E72DC0017A14C /* libRNCSlider.a */,
);
name = Products;
sourceTree = "<group>";
};
2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -689,6 +708,7 @@
9B18D59B9364468890D0E546 /* RNSVG.xcodeproj */,
E74B8C5507C34F8DBD70AECC /* RNSafeArea.xcodeproj */,
24AEC4495B174D4C9E96E630 /* RCTVideo.xcodeproj */,
32A2662FE92B40E281A5CB2A /* RNCSlider.xcodeproj */,
);
name = Libraries;
sourceTree = "<group>";
Expand Down Expand Up @@ -771,6 +791,7 @@
9BFAFEB337654221B2F14D03 /* libRNSVG-tvOS.a */,
69F3DF692A7C4E5994CD3CBB /* libRNSafeArea.a */,
3D53EF8FEF024C98A7AC9A56 /* libRCTVideo.a */,
D7F3ECD6334A43BCA1028B5D /* libRNCSlider.a */,
);
name = "Recovered References";
sourceTree = "<group>";
Expand Down Expand Up @@ -978,6 +999,10 @@
ProductGroup = 146834001AC3E56700842450 /* Products */;
ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;
},
{
ProductGroup = 21EE9A4C238E72DC0017A14C /* Products */;
ProjectRef = 32A2662FE92B40E281A5CB2A /* RNCSlider.xcodeproj */;
},
{
ProductGroup = 7E8FA92A2301CA9E00D007F0 /* Products */;
ProjectRef = 7E8FA9292301CA9E00D007F0 /* RNDarkMode.xcodeproj */;
Expand Down Expand Up @@ -1063,6 +1088,13 @@
remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
21EE9A50238E72DC0017A14C /* libRNCSlider.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libRNCSlider.a;
remoteRef = 21EE9A4F238E72DC0017A14C /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
2D16E6721FA4F8DC00B85C8A /* libRCTBlob-tvOS.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
Expand Down Expand Up @@ -1471,6 +1503,7 @@
"$(SRCROOT)/../node_modules/react-native-svg/ios/**",
"$(SRCROOT)/../node_modules/react-native-safe-area/ios/RNSafeArea",
"$(SRCROOT)/../node_modules/react-native-video/ios/**",
"$(SRCROOT)/../node_modules/@react-native-community/slider/src/ios",
);
INFOPLIST_FILE = gutenbergTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
Expand All @@ -1482,6 +1515,7 @@
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
OTHER_LDFLAGS = (
"-ObjC",
Expand All @@ -1504,6 +1538,7 @@
"$(SRCROOT)/../node_modules/react-native-svg/ios/**",
"$(SRCROOT)/../node_modules/react-native-safe-area/ios/RNSafeArea",
"$(SRCROOT)/../node_modules/react-native-video/ios/**",
"$(SRCROOT)/../node_modules/@react-native-community/slider/src/ios",
);
INFOPLIST_FILE = gutenbergTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
Expand All @@ -1515,6 +1550,7 @@
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
OTHER_LDFLAGS = (
"-ObjC",
Expand Down Expand Up @@ -1542,6 +1578,7 @@
"$(SRCROOT)/../react-native-aztec/ios/**",
"$(SRCROOT)/../node_modules/react-native-safe-area/ios/RNSafeArea",
"$(SRCROOT)/../node_modules/react-native-video/ios/**",
"$(SRCROOT)/../node_modules/@react-native-community/slider/src/ios",
);
INFOPLIST_FILE = gutenberg/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
Expand Down Expand Up @@ -1580,6 +1617,7 @@
"$(SRCROOT)/../react-native-aztec/ios/**",
"$(SRCROOT)/../node_modules/react-native-safe-area/ios/RNSafeArea",
"$(SRCROOT)/../node_modules/react-native-video/ios/**",
"$(SRCROOT)/../node_modules/@react-native-community/slider/src/ios",
);
INFOPLIST_FILE = gutenberg/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
Expand Down Expand Up @@ -1619,6 +1657,7 @@
"$(SRCROOT)/../node_modules/react-native-svg/ios/**",
"$(SRCROOT)/../node_modules/react-native-safe-area/ios/RNSafeArea",
"$(SRCROOT)/../node_modules/react-native-video/ios/**",
"$(SRCROOT)/../node_modules/@react-native-community/slider/src/ios",
);
INFOPLIST_FILE = "gutenberg-tvOS/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -1629,6 +1668,7 @@
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
OTHER_LDFLAGS = (
"-ObjC",
Expand Down Expand Up @@ -1660,6 +1700,7 @@
"$(SRCROOT)/../node_modules/react-native-svg/ios/**",
"$(SRCROOT)/../node_modules/react-native-safe-area/ios/RNSafeArea",
"$(SRCROOT)/../node_modules/react-native-video/ios/**",
"$(SRCROOT)/../node_modules/@react-native-community/slider/src/ios",
);
INFOPLIST_FILE = "gutenberg-tvOS/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -1670,6 +1711,7 @@
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
OTHER_LDFLAGS = (
"-ObjC",
Expand Down Expand Up @@ -1700,6 +1742,7 @@
"$(SRCROOT)/../node_modules/react-native-svg/ios/**",
"$(SRCROOT)/../node_modules/react-native-safe-area/ios/RNSafeArea",
"$(SRCROOT)/../node_modules/react-native-video/ios/**",
"$(SRCROOT)/../node_modules/@react-native-community/slider/src/ios",
);
INFOPLIST_FILE = "gutenberg-tvOSTests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
Expand All @@ -1710,6 +1753,7 @@
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
OTHER_LDFLAGS = (
"-ObjC",
Expand Down Expand Up @@ -1740,6 +1784,7 @@
"$(SRCROOT)/../node_modules/react-native-svg/ios/**",
"$(SRCROOT)/../node_modules/react-native-safe-area/ios/RNSafeArea",
"$(SRCROOT)/../node_modules/react-native-video/ios/**",
"$(SRCROOT)/../node_modules/@react-native-community/slider/src/ios",
);
INFOPLIST_FILE = "gutenberg-tvOSTests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
Expand All @@ -1750,6 +1795,7 @@
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
OTHER_LDFLAGS = (
"-ObjC",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
"dependencies": {
"@babel/runtime": "^7.3.1",
"@react-native-community/cli": "^1.5.2",
"@react-native-community/slider": "git+https://github.com/wordpress-mobile/react-native-slider.git#e20f268e61327321a5bbd66afc5238388d65f2a4",
"classnames": "^2.2.5",
"dom-react": "^2.2.1",
"domutils": "^1.7.0",
Expand Down
4 changes: 3 additions & 1 deletion react-native-gutenberg-bridge/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if (isJitPack) {

node {
// Version of node to use.
version = '8.11.3'
version = '12.13.1'

// Version of npm to use.
npmVersion = '6.3.0'
Expand Down Expand Up @@ -130,12 +130,14 @@ dependencies {
implementation project(':react-native-svg')
implementation project(':react-native-recyclerview-list')
implementation project(':react-native-video')
implementation project(':@react-native-community_slider')

implementation 'com.facebook.react:react-native:+'
} else {
implementation (waitJitpack('com.github.wordpress-mobile', 'react-native-svg', readHashedVersion('../../package.json', 'react-native-svg', 'dependencies')))
implementation (waitJitpack('com.github.wordpress-mobile', 'react-native-recyclerview-list', 'f845b3c2c4411b8e97db23724bf1a535530c5435'))
implementation (waitJitpack('com.github.wordpress-mobile', 'react-native-video', readHashedVersion('../../package.json', 'react-native-video', 'dependencies')))
implementation (waitJitpack('com.github.wordpress-mobile', 'react-native-slider', readHashedVersion('../../package.json', '@react-native-community/slider', 'dependencies')))

def rnVersion = readReactNativeVersion('../package.json', 'peerDependencies')
implementation "com.facebook.react:react-native:${rnVersion}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import com.facebook.soloader.SoLoader;
import com.github.godness84.RNRecyclerViewList.RNRecyclerviewListPackage;
import com.horcrux.svg.SvgPackage;
import com.reactnativecommunity.slider.ReactSliderPackage;

import org.wordpress.android.util.AppLog;
import org.wordpress.mobile.ReactNativeAztec.ReactAztecPackage;
Expand Down Expand Up @@ -312,6 +313,7 @@ public void requestImageFullscreenPreview(String mediaUrl) {
new ReactAztecPackage(),
new RNRecyclerviewListPackage(),
new ReactVideoPackage(),
new ReactSliderPackage(),
mRnReactNativeGutenbergBridgePackage);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "react-native-slider",
"version": "2.0.7",
"summary": "A <Slider /> component for react-native",
"description": "A <Slider /> component for react-native",
"license": "MIT",
"authors": "react-native-community",
"homepage": "https://github.com/react-native-community/react-native-slider",
"source": {
"git": "https://github.com/react-native-community/react-native-slider",
"tag": "v2.0.7"
},
"source_files": "src/ios/**/*.{h,m}",
"preserve_paths": "**/*.js",
"platforms": {
"ios": "8.0"
},
"dependencies": {
"React": [

]
}
}
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1645,6 +1645,10 @@
xcode "^2.0.0"
xmldoc "^0.4.0"

"@react-native-community/slider@git+https://github.com/wordpress-mobile/react-native-slider.git#e20f268e61327321a5bbd66afc5238388d65f2a4":
version "2.0.7"
resolved "git+https://github.com/wordpress-mobile/react-native-slider.git#e20f268e61327321a5bbd66afc5238388d65f2a4"

"@tannin/compile@^1.0.3":
version "1.0.3"
resolved "https://registry.yarnpkg.com/@tannin/compile/-/compile-1.0.3.tgz#812af915e2ac6ecc6d7518680b40ec275db7670d"
Expand Down