forked from rob-race/react-trix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d59a96f
Showing
12 changed files
with
228 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Mac OSX Files | ||
.DS_Store | ||
.Trashes | ||
.Spotlight-V100 | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Bower & Node Modules | ||
node_modules | ||
npm-debug.log | ||
bower_components | ||
|
||
# General Files | ||
.sass-cache | ||
.hg | ||
.idea | ||
.svn | ||
.cache | ||
.project | ||
.tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Copyright (c) 2015, Travis Arnold <[email protected]> | ||
|
||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted, provided that the above | ||
copyright notice and this permission notice appear in all copies. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## React Trix 0.0.1 | ||
|
||
React wrapper around [Trix](https://github.com/basecamp/trix) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "react-trix", | ||
"version": "0.0.1", | ||
"homepage": "https://github.com/souporserious/react-trix", | ||
"authors": [ | ||
"Travis Arnold <[email protected]>" | ||
], | ||
"description": "Build flexible WYSIWYG editors with ease.", | ||
"main": ["./dist/react-trix.js"], | ||
"keywords": [ | ||
"react", | ||
"component", | ||
"edit", | ||
"editable", | ||
"wysiwyg", | ||
"trix", | ||
"editor", | ||
"trix-editor" | ||
], | ||
"license": "MIT", | ||
"ignore": [ | ||
"**/.*", | ||
"node_modules", | ||
"bower_components", | ||
"test", | ||
"tests" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Component</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script src="http://localhost:8080/webpack-dev-server.js"></script> | ||
<script src="bundle.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React, { Component } from 'react' | ||
import Trix from '../src/react-trix' | ||
|
||
class App extends Component { | ||
render() { | ||
return <Trix /> | ||
} | ||
} | ||
|
||
React.render(<App />, document.getElementById('app')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
* { | ||
box-sizing: border-box; | ||
} | ||
|
||
body { | ||
font-family: 'Helvetica', sans-serif; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"name": "react-trix", | ||
"version": "0.0.1", | ||
"description": "Build flexible WYSIWYG editors with ease.", | ||
"main": "lib/react-trix.js", | ||
"scripts": { | ||
"build": "npm run build:lib && NODE_ENV=production webpack --config webpack.prod.config.js", | ||
"build:lib": "babel src --out-dir lib --stage 0", | ||
"dev": "webpack-dev-server --devtool eval --hot --progress --colors", | ||
"prebuild": "rm -rf dist && mkdir dist", | ||
"prepublish": "npm run build", | ||
"postbuild": "NODE_ENV=production TARGET=minify webpack --config webpack.prod.config.js", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/souporserious/react-trix" | ||
}, | ||
"keywords": [ | ||
"react", | ||
"component", | ||
"edit", | ||
"editable", | ||
"wysiwyg", | ||
"trix", | ||
"editor", | ||
"trix-editor" | ||
], | ||
"author": "Travis Arnold <[email protected]> (http://souporserious.com)", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/souporserious/react-trix/issues" | ||
}, | ||
"homepage": "https://github.com/souporserious/react-trix", | ||
"peerDependencies": { | ||
"react": ">=0.13.2 || ^0.14.0-beta1" | ||
}, | ||
"devDependencies": { | ||
"autoprefixer-loader": "^2.0.0", | ||
"babel": "^5.8.23", | ||
"babel-core": "^5.6.15", | ||
"babel-loader": "^5.2.2", | ||
"css-loader": "^0.15.1", | ||
"http-server": "^0.8.0", | ||
"node-sass": "^3.2.0", | ||
"react": "^0.13.3 || ^0.14.0-beta1", | ||
"sass-loader": "^1.0.2", | ||
"style-loader": "^0.12.3", | ||
"webpack": "^1.9.12", | ||
"webpack-dev-server": "^1.9.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React, { Component, PropTypes } from 'react' | ||
|
||
class Trix extends React.Component { | ||
static propTypes = { | ||
} | ||
static defaultProps = { | ||
} | ||
render() { | ||
return <div></div> | ||
} | ||
} | ||
|
||
export default Trix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default from './Trix' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
var path = require('path'); | ||
var nodeModulesDir = path.resolve(__dirname, 'node_modules'); | ||
|
||
module.exports = { | ||
entry: { | ||
index: ['webpack/hot/dev-server', './example/index.jsx'] | ||
}, | ||
output: { | ||
path: './example', | ||
filename: 'bundle.js' | ||
}, | ||
module: { | ||
loaders: [ | ||
{test: /\.(js|jsx)/, exclude: /node_modules/, loader: 'babel?stage=0'}, | ||
{test: /\.scss$/, loader: 'style!css!autoprefixer!sass?sourceMap'} | ||
] | ||
}, | ||
resolve: { | ||
extensions: ['', '.js', '.jsx'] | ||
}, | ||
devServer: { | ||
contentBase: './example', | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
var path = require('path'); | ||
var webpack = require('webpack'); | ||
var TARGET = process.env.TARGET || null; | ||
|
||
var config = { | ||
entry: { | ||
index: './src/react-trix.js', | ||
}, | ||
output: { | ||
path: path.join(__dirname, 'dist'), | ||
publicPath: 'dist/', | ||
filename: 'react-trix.js', | ||
sourceMapFilename: 'react-trix.sourcemap.js', | ||
library: 'Trix', | ||
libraryTarget: 'umd' | ||
}, | ||
module: { | ||
loaders: [ | ||
{test: /\.(js|jsx)/, loader: 'babel?stage=0'} | ||
] | ||
}, | ||
plugins: [], | ||
resolve: { | ||
extensions: ['', '.js', '.jsx'] | ||
}, | ||
externals: { | ||
'react': 'React' | ||
}, | ||
}; | ||
|
||
if(TARGET === 'minify') { | ||
config.output.filename = 'react-trix.min.js'; | ||
config.output.sourceMapFilename = 'react-trix.min.js'; | ||
config.plugins.push(new webpack.optimize.UglifyJsPlugin({ | ||
compress: { | ||
warnings: false | ||
}, | ||
mangle: { | ||
except: ['React', 'Trix'] | ||
} | ||
})); | ||
} | ||
|
||
module.exports = config; |