Skip to content

Commit 5501fed

Browse files
committed
Initial commit from boilerplate
0 parents  commit 5501fed

20 files changed

+1262
-0
lines changed

.babelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"presets": ["es2015", "react"],
3+
"plugins": ["transform-object-rest-spread"]
4+
}

.eslintrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"parser": "babel-eslint",
3+
"extends": "blue-hour"
4+
}

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
node_modules
2+
npm-debug.log
3+
4+
# Editor and other tmp files
5+
*.swp
6+
*.un~
7+
*.iml
8+
*.ipr
9+
*.iws
10+
*.sublime-*
11+
.idea/
12+
*.DS_Store
13+
14+
# Build directories (Will be preserved by npm)
15+
dist
16+
build

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
bower.json
2+
src/examples

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
See the GitHub [Releases](https://github.com/fritz-c/react-sortable-tree/releases) for information on updates.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 Chris Fritz
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

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# React Sortable Tree
2+
3+
[DEMO](https://fritz-c.github.io/react-sortable-tree/)
4+
5+
### Features
6+
7+
- Highly flexible
8+
- No external CSS files
9+
10+
## Example
11+
12+
```jsx
13+
import React from 'react';
14+
import ReactSortableTree from 'react-sortable-tree';
15+
16+
export default React.createClass({
17+
render() {
18+
return (
19+
<ReactSortableTree myName="World" />
20+
);
21+
}
22+
});
23+
24+
```
25+
26+
## Options
27+
28+
Property | Type | Default | Required | Description
29+
:-------------------|:------:|:--------------:|:--------:|:----------------------------------------
30+
myName | string | `World` | | Name of person/thing to greet.
31+
32+
## Contributing
33+
34+
After cloning the repository and running `npm install` inside, you can use the following commands to develop and build the project.
35+
36+
```sh
37+
# Starts a webpack dev server that hosts a demo page with the component.
38+
# It uses react-hot-loader so changes are reflected on save.
39+
npm start
40+
41+
# Lints the code with eslint and my custom rules.
42+
npm run lint
43+
44+
# Lints and builds the code, placing the result in the dist directory.
45+
# This build is necessary to reflect changes if you're
46+
# `npm link`-ed to this repository from another local project.
47+
npm run build
48+
```
49+
50+
Pull requests are welcome!
51+
52+
## License
53+
54+
MIT

package.json

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"name": "react-sortable-tree",
3+
"version": "0.0.1",
4+
"description": "Drag-and-drop sortable representation of hierarchical data",
5+
"scripts": {
6+
"build": "npm run lint && npm run build:demo && npm run build:umd",
7+
"build:demo": "npm run clean:demo && cross-env NODE_ENV=production webpack --config webpack.config.demo.babel.js --bail",
8+
"build:umd": "npm run clean:umd && cross-env NODE_ENV=production webpack --config webpack.config.umd.babel.js --bail",
9+
"clean": "npm run clean:demo && npm run clean:umd",
10+
"clean:demo": "rimraf build",
11+
"clean:umd": "rimraf dist/umd",
12+
"start": "cross-env NODE_ENV=development webpack-dev-server --hot --inline --config webpack.config.dev.babel.js",
13+
"test": "webpack",
14+
"lint": "eslint src",
15+
"deploy": "npm run build && gh-pages -d build",
16+
"prepublish": "npm run lint && npm run build:umd"
17+
},
18+
"main": "dist/umd/react-sortable-tree.js",
19+
"files": [
20+
"dist"
21+
],
22+
"repository": {
23+
"type": "git",
24+
"url": "https://github.com/fritz-c/react-sortable-tree"
25+
},
26+
"homepage": "https://fritz-c.github.io/react-sortable-tree",
27+
"bugs": "https://github.com/fritz-c/react-sortable-tree/issues",
28+
"authors": [
29+
"Chris Fritz"
30+
],
31+
"license": "MIT",
32+
"dependencies": {},
33+
"peerDependencies": {
34+
"react": "^15.0.0",
35+
"react-dom": "^15.0.0"
36+
},
37+
"devDependencies": {
38+
"autoprefixer": "^6.3.7",
39+
"babel-cli": "^6.10.1",
40+
"babel-core": "^6.10.4",
41+
"babel-eslint": "^6.1.2",
42+
"babel-loader": "^6.2.4",
43+
"babel-plugin-transform-object-rest-spread": "^6.8.0",
44+
"babel-preset-es2015": "^6.9.0",
45+
"babel-preset-react": "^6.11.1",
46+
"cross-env": "^2.0.0",
47+
"css-loader": "^0.23.1",
48+
"eslint": "^2.9.0",
49+
"eslint-config-blue-hour": "0.x.x",
50+
"eslint-plugin-import": "^1.10.2",
51+
"eslint-plugin-jsx-a11y": "^1.5.5",
52+
"eslint-plugin-react": "^5.2.2",
53+
"file-loader": "^0.9.0",
54+
"gh-pages": "^0.11.0",
55+
"html-webpack-plugin": "^2.22.0",
56+
"node-sass": "^3.8.0",
57+
"postcss-loader": "^0.9.1",
58+
"react": "^15.2.0",
59+
"react-dom": "^15.2.0",
60+
"react-hot-loader": "^1.3.0",
61+
"rimraf": "^2.5.3",
62+
"sass-loader": "^4.0.0",
63+
"style-loader": "^0.13.1",
64+
"webpack": "^1.13.1",
65+
"webpack-dev-server": "^1.14.1"
66+
},
67+
"keywords": [
68+
"react",
69+
"react-component"
70+
]
71+
}

src/examples/basicExample/app.js

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import React from 'react';
2+
import ReactDOM from 'react-dom';
3+
import ReactSortableTree from '../../react-sortable-tree';
4+
import styles from './stylesheets/app.scss';
5+
6+
const App = React.createClass({
7+
getInitialState() {
8+
return {};
9+
},
10+
render() {
11+
const projectName = 'React Sortable Tree';
12+
const authorName = 'Chris Fritz';
13+
const authorUrl = 'https://github.com/fritz-c';
14+
const githubUrl = 'https://github.com/fritz-c/react-sortable-tree';
15+
16+
return (
17+
<div>
18+
<section className={styles['page-header']}>
19+
<h1 className={styles['project-name']}>{projectName}</h1>
20+
21+
<h2 className={styles['project-tagline']}>
22+
Drag-and-drop sortable representation of hierarchical data
23+
</h2>
24+
</section>
25+
26+
<section className={styles['main-content']}>
27+
<h3>Demo</h3>
28+
29+
<ReactSortableTree myName={authorName} />
30+
31+
<h3>Features</h3>
32+
<ul>
33+
<li>Excels at displaying an enthusiastic greeting</li>
34+
<li>No external CSS</li>
35+
</ul>
36+
37+
<a href={githubUrl}>Documentation on Github</a>
38+
39+
<footer className={styles['site-footer']}>
40+
<span className={styles['site-footer-owner']}>
41+
<a href={githubUrl}>{projectName}</a> is maintained by <a href={authorUrl}>{authorName}</a>.
42+
</span>
43+
44+
<span className={styles['site-footer-credits']}>
45+
This page was generated by <a href="https://pages.github.com">GitHub Pages</a> using the <a href="https://github.com/jasonlong/cayman-theme">Cayman theme</a> by <a href="https://twitter.com/jasonlong">Jason Long</a>.
46+
</span>
47+
</footer>
48+
</section>
49+
50+
<a href={githubUrl}>
51+
<img
52+
style={{ position: 'absolute', top: 0, right: 0, border: 0 }}
53+
src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67"
54+
alt="Fork me on GitHub"
55+
data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"
56+
/>
57+
</a>
58+
</div>
59+
);
60+
}
61+
});
62+
63+
ReactDOM.render(<App />, document.getElementById('app'));
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en-us">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>React Sortable Tree</title>
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)