Skip to content

Commit a87399c

Browse files
committed
Initial commit
0 parents  commit a87399c

File tree

306 files changed

+38780
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

306 files changed

+38780
-0
lines changed

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*.js]
4+
5+
charset = utf-8
6+
indent_size = 2
7+
end_of_line = lf
8+
indent_style = space
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
[Makefile]
13+
14+
indent_size = 2
15+
indent_style = tab

.eslintrc

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
{
2+
"parser": "babel-eslint",
3+
"ecmaFeatures": {
4+
"jsx": true,
5+
"modules": true
6+
},
7+
"env": {
8+
"mocha": true,
9+
"browser": true,
10+
"node": true
11+
},
12+
"globals": {
13+
"__DEV__": true,
14+
"Promise": true,
15+
},
16+
"plugins": [
17+
"babel",
18+
"react",
19+
"react-native"
20+
],
21+
"rules": {
22+
"quotes": [ 2, "single" ],
23+
"semi": [ 2, "never" ],
24+
"no-cond-assign": 0,
25+
"camelcase": [ 2, { "properties": "never" } ],
26+
"curly": [ 2, "all" ],
27+
"no-eq-null": 2,
28+
"eqeqeq": 2,
29+
"no-eval": 0,
30+
"no-extend-native": 2,
31+
"block-scoped-var": 2,
32+
"indent": [ 2, 2, { "SwitchCase": 1 } ],
33+
"wrap-iife": [ 2, "any" ],
34+
"max-depth": [ 2, 3 ],
35+
"max-statements": [ 2, 30 ],
36+
"no-shadow": 2,
37+
"no-multi-spaces": ["error", { "exceptions": { "Property": true } }],
38+
"no-multiple-empty-lines": ["error", { "max": 1, "maxBOF": 0, "maxEOF": 0 }],
39+
"no-unused-vars": 2,
40+
"no-undef": 2,
41+
"no-underscore-dangle": ["error", { "allow": [ "__DEV__" ] }],
42+
"dot-notation": 0,
43+
"no-with": 2,
44+
"brace-style": 2,
45+
"no-mixed-spaces-and-tabs": 2,
46+
"one-var": [ 2, { "uninitialized": "always", "initialized": "never" } ],
47+
"quote-props": [ 2, "as-needed" ],
48+
"key-spacing": [ 2, { "beforeColon": false, "afterColon": true } ],
49+
"space-unary-ops": [ 2, { "nonwords": false, "overrides": {} } ],
50+
"space-before-function-paren": [ 2, "never" ],
51+
"space-in-parens": [ 2, "never" ],
52+
"no-trailing-spaces": 2,
53+
"new-cap": 2,
54+
"keyword-spacing": [ 2, {} ],
55+
"spaced-comment": [ 2, "always" ],
56+
"space-infix-ops": 2,
57+
"space-before-blocks": [ 2, "always" ],
58+
"comma-dangle": 0,
59+
"linebreak-style": [ 2, "unix" ],
60+
"no-mixed-requires": [0],
61+
"eol-last": [0],
62+
63+
"generator-star-spacing": 1,
64+
"object-shorthand": 1,
65+
"arrow-parens": [2, "as-needed"],
66+
"babel/new-cap": 1,
67+
"babel/no-await-in-loop": 1,
68+
69+
"react/jsx-uses-react": 2,
70+
"react/jsx-uses-vars": 2,
71+
"react/react-in-jsx-scope": 2,
72+
"react/prop-types": 2,
73+
74+
"react-native/no-unused-styles": 2,
75+
"react-native/split-platform-components": 2,
76+
"react-native/no-inline-styles": 2,
77+
"react-native/no-color-literals": 2,
78+
}
79+
}

.gitignore

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# Xcode
6+
#
7+
build/
8+
*.pbxuser
9+
!default.pbxuser
10+
*.mode1v3
11+
!default.mode1v3
12+
*.mode2v3
13+
!default.mode2v3
14+
*.perspectivev3
15+
!default.perspectivev3
16+
xcuserdata
17+
*.xccheckout
18+
*.moved-aside
19+
DerivedData
20+
*.hmap
21+
*.ipa
22+
*.xcuserstate
23+
project.xcworkspace
24+
25+
# Android/IJ
26+
#
27+
*.iml
28+
.idea
29+
.gradle
30+
local.properties
31+
32+
# node.js
33+
#
34+
node_modules/
35+
npm-debug.log
36+
37+
# BUCK
38+
buck-out/
39+
\.buckd/
40+
android/app/libs
41+
*.keystore

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "deps/Keyframes"]
2+
path = deps/Keyframes
3+
url = [email protected]:facebookincubator/Keyframes.git

.npmignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Sample app
2+
demo/

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2016 Brent Vatne, Baris Sencan
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
2+
![Keyframes](https://github.com/facebookincubator/Keyframes/raw/master/docs/images/doc-logo.png)
3+
4+
# react-native-facebook-keyframes
5+
6+
A React Native wrapper for the [Facebook Keyframes library](https://github.com/facebookincubator/Keyframes).
7+
8+
Just for *iOS* for now, *Android* is still WIP.
9+
10+
## Getting started
11+
12+
`$ npm install react-native-facebook-keyframes --save`
13+
14+
### Mostly automatic installation
15+
16+
`$ react-native link react-native-facebook-keyframes`
17+
18+
(*) you must follow the ***Keyframes dependency configuration*** section below!
19+
20+
### Manual installation
21+
22+
#### iOS
23+
24+
1. In XCode, in the project navigator, right click `Libraries``Add Files to [your project's name]`
25+
2. Go to `node_modules``react-native-facebook-keyframes` and add `RNFacebookKeyframes.xcodeproj`
26+
3. In XCode, in the project navigator, select your project. Add `libRNFacebookKeyframes.a` to your project's `Build Phases``Link Binary With Libraries`
27+
4. Run your project (`Cmd+R`)<
28+
29+
### Keyframes dependency configuration
30+
31+
1. In XCode, in the project navigator, right click `Libraries``Add Files to [your project's name]`
32+
2. Go to `node_modules``react-native-facebook-keyframes/deps/Keyframes/ios/keyframes/` and add `keyframes.xcodeproj`
33+
3. In XCode, in the project navigator, select your project. Add `keyframes.a` to your project's `Build Phases``Link Binary With Libraries`
34+
4. Run your project (`Cmd+R`)<
35+
36+
## Usage
37+
```JSX
38+
import RNFacebookKeyframes from 'react-native-facebook-keyframes'
39+
40+
<KeyframesView
41+
styles={{ width: 100, height: 100 }} // View styles
42+
seek={1.0} // Seek to a given progress in range [0, 1]
43+
src={require('./keyframe.json')} // Animation file
44+
/>
45+
```
46+
47+
## Running the sample
48+
49+
1. Go to the `demo/KeyframesDemo` folder
50+
- run `npm install`
51+
- run `react-native run-ios`
52+
53+
If it doesn't work, open and run the project in xCode.
54+
55+
## TODOS
56+
57+
- [ ] Add support for Android
58+
59+
---
60+
61+
**MIT Licensed**

android/build.gradle

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
apply plugin: 'com.android.library'
3+
4+
android {
5+
compileSdkVersion 23
6+
buildToolsVersion "23.0.1"
7+
8+
defaultConfig {
9+
minSdkVersion 16
10+
targetSdkVersion 22
11+
versionCode 1
12+
versionName "1.0"
13+
ndk {
14+
abiFilters "armeabi-v7a", "x86"
15+
}
16+
}
17+
lintOptions {
18+
warning 'InvalidPackage'
19+
}
20+
}
21+
22+
dependencies {
23+
compile 'com.facebook.react:react-native:0.20.+'
24+
}
25+

android/src/main/AndroidManifest.xml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.reactlibrary">
4+
5+
</manifest>
6+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
package com.reactlibrary;
3+
4+
import com.facebook.react.bridge.ReactApplicationContext;
5+
import com.facebook.react.bridge.ReactContextBaseJavaModule;
6+
import com.facebook.react.bridge.ReactMethod;
7+
import com.facebook.react.bridge.Callback;
8+
9+
public class RNFacebookKeyframesModule extends ReactContextBaseJavaModule {
10+
11+
private final ReactApplicationContext reactContext;
12+
13+
public RNFacebookKeyframesModule(ReactApplicationContext reactContext) {
14+
super(reactContext);
15+
this.reactContext = reactContext;
16+
}
17+
18+
@Override
19+
public String getName() {
20+
return "RNFacebookKeyframes";
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
package com.reactlibrary;
3+
4+
import java.util.Arrays;
5+
import java.util.Collections;
6+
import java.util.List;
7+
8+
import com.facebook.react.ReactPackage;
9+
import com.facebook.react.bridge.NativeModule;
10+
import com.facebook.react.bridge.ReactApplicationContext;
11+
import com.facebook.react.uimanager.ViewManager;
12+
import com.facebook.react.bridge.JavaScriptModule;
13+
public class RNFacebookKeyframesPackage implements ReactPackage {
14+
@Override
15+
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
16+
return Arrays.<NativeModule>asList(new RNFacebookKeyframesModule(reactContext));
17+
}
18+
19+
@Override
20+
public List<Class<? extends JavaScriptModule>> createJSModules() {
21+
return Collections.emptyList();
22+
}
23+
24+
@Override
25+
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
26+
return Collections.emptyList();
27+
}
28+
}

demo/KeyframesDemo/.babelrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["react-native"]
3+
}

demo/KeyframesDemo/.buckconfig

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
[android]
3+
target = Google Inc.:Google APIs:23
4+
5+
[maven_repositories]
6+
central = https://repo1.maven.org/maven2

demo/KeyframesDemo/.flowconfig

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
[ignore]
2+
; We fork some components by platform
3+
.*/*[.]android.js
4+
5+
; Ignore "BUCK" generated dirs
6+
<PROJECT_ROOT>/\.buckd/
7+
8+
; Ignore unexpected extra "@providesModule"
9+
.*/node_modules/.*/node_modules/fbjs/.*
10+
11+
; Ignore duplicate module providers
12+
; For RN Apps installed via npm, "Libraries" folder is inside
13+
; "node_modules/react-native" but in the source repo it is in the root
14+
.*/Libraries/react-native/React.js
15+
.*/Libraries/react-native/ReactNative.js
16+
17+
[include]
18+
19+
[libs]
20+
node_modules/react-native/Libraries/react-native/react-native-interface.js
21+
node_modules/react-native/flow
22+
flow/
23+
24+
[options]
25+
module.system=haste
26+
27+
experimental.strict_type_args=true
28+
29+
munge_underscores=true
30+
31+
module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
32+
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
33+
34+
suppress_type=$FlowIssue
35+
suppress_type=$FlowFixMe
36+
suppress_type=$FixMe
37+
38+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-5]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
39+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-5]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
40+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
41+
42+
unsafe.enable_getters_and_setters=true
43+
44+
[version]
45+
^0.35.0

demo/KeyframesDemo/.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.pbxproj -text

0 commit comments

Comments
 (0)