dante2-editor 0.2.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.babelrc +20 -0
- data/.eslint +13 -0
- data/.gitignore +15 -0
- data/README.md +5 -1
- data/dante2.gemspec +2 -4
- data/{app → demo}/assets/index.html +2 -2
- data/{app → demo}/assets/license.html +1 -1
- data/{app → demo}/assets/options.html +1 -5
- data/{app → demo}/assets/store.json +0 -0
- data/demo/data/poc.js +9 -0
- data/demo/demo.js +9 -0
- data/demo/initialize.js +7 -0
- data/{app → demo}/styles/layout/layout.scss +0 -0
- data/{app → demo}/styles/layout/normalize.css +0 -0
- data/{app → demo}/styles/layout/scaffold.scss +0 -0
- data/{app → demo}/styles/layout/tooltips.scss +0 -0
- data/dist/Dante2.js +2995 -0
- data/dist/Dante2.min.js +3 -0
- data/dist/Dante2.min.js.map +1 -0
- data/dist/DanteStyles.css +2 -0
- data/dist/DanteStyles.css.map +1 -0
- data/dist/DanteStyles.js +102 -0
- data/dist/DanteStyles.min.js +2 -0
- data/dist/DanteStyles.min.js.map +1 -0
- data/dist/dante-vendors.js +48316 -0
- data/dist/dante-vendors.min.js +29 -0
- data/dist/dante-vendors.min.js.map +1 -0
- data/{app/styles/fonts/dante → dist/fonts}/dante.eot +0 -0
- data/{app/styles/fonts/dante → dist/fonts}/dante.svg +0 -0
- data/{app/styles/fonts/dante → dist/fonts}/dante.ttf +0 -0
- data/{app/styles/fonts/dante → dist/fonts}/dante.woff +0 -0
- data/{app/styles/fonts/dante → dist/fonts}/fontello.eot +0 -0
- data/{app/styles/fonts/dante → dist/fonts}/fontello.svg +0 -0
- data/{app/styles/fonts/dante → dist/fonts}/fontello.ttf +0 -0
- data/{app/styles/fonts/dante → dist/fonts}/fontello.woff +0 -0
- data/docs/app.css +430 -1
- data/docs/app.css.map +1 -1
- data/docs/app.js +62 -2
- data/docs/app.js.map +1 -1
- data/docs/dante-vendors.js +49513 -22
- data/docs/dante-vendors.js.map +1 -1
- data/docs/dante.css +1602 -1
- data/docs/dante.css.map +1 -1
- data/docs/dante.js +3310 -3
- data/docs/dante.js.map +1 -1
- data/docs/doc.html +3 -7
- data/docs/index.html +4 -4
- data/docs/license.html +3 -3
- data/docs/options.html +53 -0
- data/package.json +47 -17
- data/rb_lib/dante2-editor/rails.rb +15 -0
- data/{lib → rb_lib}/dante2-editor/version.rb +1 -1
- data/{lib → rb_lib}/dante2-editor.rb +0 -0
- data/src/components/blocks/embed.js +126 -0
- data/src/components/blocks/image.js +377 -0
- data/src/components/blocks/placeholder.js +68 -0
- data/src/components/blocks/video.js +80 -0
- data/src/components/dante.js +291 -0
- data/src/components/dante_editor.js +928 -0
- data/src/components/debug.js +104 -0
- data/src/components/decorators/link.js +64 -0
- data/src/components/popovers/addButton.js +318 -0
- data/src/components/popovers/image.js +188 -0
- data/src/components/popovers/link.js +107 -0
- data/src/components/popovers/toolTip.js +402 -0
- data/{app/utils/logger.coffee → src/components/wrapper.js} +0 -0
- data/{app → src}/images/dante/media-loading-placeholder.png +0 -0
- data/{app → src}/images/site/dante-demo.png +0 -0
- data/{app → src}/images/site/dante-editor-logo.png +0 -0
- data/{app → src}/images/site/github-logo.png +0 -0
- data/src/index.js +9 -0
- data/{app → src}/model/index.js +0 -0
- data/src/style.js +3 -0
- data/{app → src}/styles/dante/_animations.scss +0 -0
- data/{app → src}/styles/dante/_caption.scss +0 -0
- data/{app → src}/styles/dante/_debug.scss +0 -0
- data/{app → src}/styles/dante/_fonts.scss +0 -0
- data/{app → src}/styles/dante/_graf.scss +0 -0
- data/{app → src}/styles/dante/_icons.scss +0 -0
- data/{app → src}/styles/dante/_media.scss +0 -0
- data/{app → src}/styles/dante/_menu.scss +0 -0
- data/{app → src}/styles/dante/_needsorder.scss +0 -0
- data/{app → src}/styles/dante/_popover.scss +0 -0
- data/{app → src}/styles/dante/_post.scss +0 -0
- data/{app → src}/styles/dante/_scaffold.scss +0 -0
- data/{app → src}/styles/dante/_tooltip.scss +0 -0
- data/{app → src}/styles/dante/_utilities.scss +0 -0
- data/{app → src}/styles/dante/_variables.scss +0 -0
- data/{app → src}/styles/dante/blame.scss +0 -0
- data/{app → src}/styles/dante.scss +0 -0
- data/{app → src}/styles/draft.css +0 -0
- data/src/styles/fonts/dante/dante.eot +0 -0
- data/src/styles/fonts/dante/dante.svg +18 -0
- data/src/styles/fonts/dante/dante.ttf +0 -0
- data/src/styles/fonts/dante/dante.woff +0 -0
- data/src/styles/fonts/dante/fontello.eot +0 -0
- data/src/styles/fonts/dante/fontello.svg +36 -0
- data/src/styles/fonts/dante/fontello.ttf +0 -0
- data/src/styles/fonts/dante/fontello.woff +0 -0
- data/src/utils/find_entities.js +17 -0
- data/src/utils/html2content.js +127 -0
- data/src/utils/save_content.js +80 -0
- data/{app → src}/utils/selection.js +0 -0
- data/tools/.eslintrc +9 -0
- data/tools/amd/README.md +7 -0
- data/tools/amd/bower.json +19 -0
- data/tools/amd/build.js +36 -0
- data/tools/build-cli.js +46 -0
- data/tools/build.js +30 -0
- data/tools/buildBabel.js +32 -0
- data/tools/constants.js +10 -0
- data/tools/dist/build.js +13 -0
- data/tools/docs/build.js +12 -0
- data/tools/es/build.js +27 -0
- data/tools/exec.js +50 -0
- data/tools/fs-utils.js +35 -0
- data/tools/lib/build.js +14 -0
- data/tools/promisify.js +14 -0
- data/webpack/base.config.js +89 -0
- data/webpack/docs.config.js +147 -0
- data/webpack/webpack.config.js +78 -0
- data/webpack.config-doc.js +5 -0
- data/webpack.config.js +3 -147
- data/yarn.lock +973 -718
- metadata +108 -64
- data/app/components/App.cjsx +0 -1083
- data/app/components/blocks/embed.cjsx +0 -109
- data/app/components/blocks/image.cjsx +0 -316
- data/app/components/blocks/placeholder.cjsx +0 -60
- data/app/components/blocks/video.cjsx +0 -75
- data/app/components/debug.cjsx +0 -96
- data/app/components/decorators/link.cjsx +0 -61
- data/app/components/popovers/addButton.cjsx +0 -247
- data/app/components/popovers/image.cjsx +0 -160
- data/app/components/popovers/link.cjsx +0 -87
- data/app/components/popovers/toolTip.cjsx +0 -326
- data/app/data/poc.js +0 -15
- data/app/demo.js +0 -7
- data/app/initialize.js +0 -4
- data/app/utils/find_entities.coffee +0 -20
- data/app/utils/html2content.coffee +0 -120
- data/app/utils/save_content.coffee +0 -63
- data/lib/dante2-editor/rails.rb +0 -16
@@ -0,0 +1,147 @@
|
|
1
|
+
var webpack = require('webpack');
|
2
|
+
var UglifyJsPlugin = webpack.optimize.UglifyJsPlugin;
|
3
|
+
var path = require('path');
|
4
|
+
var env = require('yargs').argv.mode;
|
5
|
+
|
6
|
+
var ExtractTextPlugin = require("extract-text-webpack-plugin");
|
7
|
+
var HtmlWebpackPlugin = require('html-webpack-plugin');
|
8
|
+
var CommonsChunkPlugin = require("webpack/lib/optimize/CommonsChunkPlugin");
|
9
|
+
|
10
|
+
|
11
|
+
var libraryName = 'Dante2';
|
12
|
+
|
13
|
+
function isExternal(module) {
|
14
|
+
var userRequest = module.userRequest;
|
15
|
+
|
16
|
+
if (typeof userRequest !== 'string') {
|
17
|
+
return false;
|
18
|
+
}
|
19
|
+
|
20
|
+
return userRequest.indexOf('bower_components') >= 0 ||
|
21
|
+
userRequest.indexOf('node_modules') >= 0 ||
|
22
|
+
userRequest.indexOf('libraries') >= 0;
|
23
|
+
}
|
24
|
+
|
25
|
+
|
26
|
+
var plugins = [
|
27
|
+
// Use the plugin to specify the resulting filename (and add needed behavior to the compiler)
|
28
|
+
new ExtractTextPlugin("[name].css"),
|
29
|
+
|
30
|
+
new HtmlWebpackPlugin({
|
31
|
+
title: 'Dante Demo',
|
32
|
+
template: 'demo/assets/index.html',
|
33
|
+
scripts: [
|
34
|
+
{
|
35
|
+
src: '/initialize.js',
|
36
|
+
type: 'module'
|
37
|
+
}
|
38
|
+
],
|
39
|
+
}),
|
40
|
+
|
41
|
+
new HtmlWebpackPlugin({
|
42
|
+
title: 'Dante Demo',
|
43
|
+
template: 'demo/assets/license.html',
|
44
|
+
filename: 'license.html',
|
45
|
+
scripts: [
|
46
|
+
{
|
47
|
+
src: '/initialize.js',
|
48
|
+
type: 'module'
|
49
|
+
}
|
50
|
+
],
|
51
|
+
}),
|
52
|
+
|
53
|
+
new HtmlWebpackPlugin({
|
54
|
+
title: 'Dante Demo',
|
55
|
+
template: 'demo/assets/options.html',
|
56
|
+
filename: 'doc.html',
|
57
|
+
scripts: [
|
58
|
+
{
|
59
|
+
src: '/initialize.js',
|
60
|
+
type: 'module'
|
61
|
+
}
|
62
|
+
],
|
63
|
+
}),
|
64
|
+
|
65
|
+
new CommonsChunkPlugin({
|
66
|
+
name: 'dante-vendors',
|
67
|
+
minChunks: function(module) {
|
68
|
+
return isExternal(module);
|
69
|
+
}
|
70
|
+
}),
|
71
|
+
|
72
|
+
new webpack.DefinePlugin({
|
73
|
+
'process.env': {
|
74
|
+
'NODE_ENV': JSON.stringify('production')
|
75
|
+
}
|
76
|
+
})
|
77
|
+
|
78
|
+
], outputFile;
|
79
|
+
|
80
|
+
if (env === 'build') {
|
81
|
+
plugins.push(new UglifyJsPlugin({ minimize: true }));
|
82
|
+
outputFile = libraryName + '.min.js';
|
83
|
+
} else {
|
84
|
+
outputFile = libraryName + '.js';
|
85
|
+
}
|
86
|
+
|
87
|
+
var config = {
|
88
|
+
|
89
|
+
entry: {
|
90
|
+
'app': './demo/demo.js',
|
91
|
+
'dante': './demo/initialize.js',
|
92
|
+
},
|
93
|
+
|
94
|
+
devtool: 'cheap-module-source-map',
|
95
|
+
output: {
|
96
|
+
path: './docs',
|
97
|
+
filename: '[name].js',
|
98
|
+
chunkFilename: "[id].js"
|
99
|
+
//filename: outputFile,
|
100
|
+
//library: libraryName,
|
101
|
+
//libraryTarget: 'umd',
|
102
|
+
//umdNamedDefine: true
|
103
|
+
},
|
104
|
+
resolve: {
|
105
|
+
root: path.resolve('./src'),
|
106
|
+
extensions: ['', '.js', '.jsx', '.es6', '.cjsx', '.coffee', '.css', '.scss']
|
107
|
+
},
|
108
|
+
module: {
|
109
|
+
loaders: [
|
110
|
+
{
|
111
|
+
test: /(\.jsx|\.js|\.es6)$/,
|
112
|
+
loader: 'babel-loader',
|
113
|
+
exclude: /(node_modules|bower_components)/,
|
114
|
+
query: {
|
115
|
+
presets: ['es2015'],
|
116
|
+
"plugins": ["transform-react-jsx"]
|
117
|
+
}
|
118
|
+
},
|
119
|
+
|
120
|
+
{ test: path.resolve("./src/components/dante_editor.js"),
|
121
|
+
loaders: ["expose?DanteEditor", "babel-loader?presets[]=es2015"]},
|
122
|
+
{ test: path.resolve("./src/components/dante.js"),
|
123
|
+
loaders: ["expose?Dante", "babel-loader?presets[]=es2015"]},
|
124
|
+
|
125
|
+
{
|
126
|
+
test: /\.css$/,
|
127
|
+
loader: ExtractTextPlugin.extract("style-loader", "css-loader")
|
128
|
+
},
|
129
|
+
{
|
130
|
+
test: /\.scss$/,
|
131
|
+
loader: ExtractTextPlugin.extract("style-loader", "css-loader!sass-loader")
|
132
|
+
},
|
133
|
+
{
|
134
|
+
test: /\.(eot|svg|ttf|woff|woff2)$/,
|
135
|
+
loader: 'file?name=fonts/[name].[ext]',
|
136
|
+
exclude: /node_modules/
|
137
|
+
},
|
138
|
+
{
|
139
|
+
test: /\.(png|jpg)$/,
|
140
|
+
loader:'file?limit=1024&name=images/[name].[ext]'
|
141
|
+
}
|
142
|
+
]
|
143
|
+
},
|
144
|
+
plugins: plugins
|
145
|
+
};
|
146
|
+
|
147
|
+
module.exports = config;
|
@@ -0,0 +1,78 @@
|
|
1
|
+
import baseConfig, { options } from './base.config';
|
2
|
+
import webpack from 'webpack';
|
3
|
+
|
4
|
+
var ExtractTextPlugin = require("extract-text-webpack-plugin");
|
5
|
+
var HtmlWebpackPlugin = require('html-webpack-plugin');
|
6
|
+
var CommonsChunkPlugin = require("webpack/lib/optimize/CommonsChunkPlugin");
|
7
|
+
|
8
|
+
function isExternal(module) {
|
9
|
+
var userRequest = module.userRequest;
|
10
|
+
|
11
|
+
if (typeof userRequest !== 'string') {
|
12
|
+
return false;
|
13
|
+
}
|
14
|
+
|
15
|
+
return userRequest.indexOf('bower_components') >= 0 ||
|
16
|
+
userRequest.indexOf('node_modules') >= 0 ||
|
17
|
+
userRequest.indexOf('libraries') >= 0;
|
18
|
+
}
|
19
|
+
|
20
|
+
var plugins = [
|
21
|
+
// Use the plugin to specify the resulting filename (and add needed behavior to the compiler)
|
22
|
+
|
23
|
+
new ExtractTextPlugin("[name].css"),
|
24
|
+
|
25
|
+
new CommonsChunkPlugin({
|
26
|
+
name: 'dante-vendors',
|
27
|
+
minChunks: function(module) {
|
28
|
+
return isExternal(module);
|
29
|
+
}
|
30
|
+
}),
|
31
|
+
|
32
|
+
new webpack.DefinePlugin({
|
33
|
+
'process.env': {
|
34
|
+
'NODE_ENV': JSON.stringify('production')
|
35
|
+
}
|
36
|
+
})
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
], outputFile;
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
export default {
|
45
|
+
...baseConfig,
|
46
|
+
|
47
|
+
entry: {
|
48
|
+
'Dante2': './src/index.js',
|
49
|
+
'DanteStyles': './src/style.js',
|
50
|
+
},
|
51
|
+
|
52
|
+
output: {
|
53
|
+
path: './dist',
|
54
|
+
filename: options.optimizeMinimize ? '[name].min.js' : '[name].js',
|
55
|
+
library: 'Dante2',
|
56
|
+
libraryTarget: 'umd',
|
57
|
+
},
|
58
|
+
|
59
|
+
externals: [
|
60
|
+
{
|
61
|
+
react: {
|
62
|
+
root: 'React',
|
63
|
+
commonjs2: 'react',
|
64
|
+
commonjs: 'react',
|
65
|
+
amd: 'react',
|
66
|
+
},
|
67
|
+
},
|
68
|
+
{
|
69
|
+
'react-dom': {
|
70
|
+
root: 'ReactDOM',
|
71
|
+
commonjs2: 'react-dom',
|
72
|
+
commonjs: 'react-dom',
|
73
|
+
amd: 'react-dom',
|
74
|
+
},
|
75
|
+
},
|
76
|
+
],
|
77
|
+
plugins: plugins
|
78
|
+
};
|
data/webpack.config.js
CHANGED
@@ -1,148 +1,4 @@
|
|
1
|
-
var
|
2
|
-
|
3
|
-
var
|
4
|
-
var env = require('yargs').argv.mode;
|
5
|
-
|
6
|
-
var ExtractTextPlugin = require("extract-text-webpack-plugin");
|
7
|
-
var HtmlWebpackPlugin = require('html-webpack-plugin');
|
8
|
-
var CommonsChunkPlugin = require("webpack/lib/optimize/CommonsChunkPlugin");
|
9
|
-
|
10
|
-
|
11
|
-
var libraryName = 'Dante2';
|
12
|
-
|
13
|
-
function isExternal(module) {
|
14
|
-
var userRequest = module.userRequest;
|
15
|
-
|
16
|
-
if (typeof userRequest !== 'string') {
|
17
|
-
return false;
|
18
|
-
}
|
19
|
-
|
20
|
-
return userRequest.indexOf('bower_components') >= 0 ||
|
21
|
-
userRequest.indexOf('node_modules') >= 0 ||
|
22
|
-
userRequest.indexOf('libraries') >= 0;
|
23
|
-
}
|
24
|
-
|
25
|
-
|
26
|
-
var plugins = [
|
27
|
-
// Use the plugin to specify the resulting filename (and add needed behavior to the compiler)
|
28
|
-
new ExtractTextPlugin("[name].css"),
|
29
|
-
|
30
|
-
new HtmlWebpackPlugin({
|
31
|
-
title: 'Dante Demo',
|
32
|
-
template: 'app/assets/index.html',
|
33
|
-
scripts: [
|
34
|
-
{
|
35
|
-
src: '/initialize.js',
|
36
|
-
type: 'module'
|
37
|
-
}
|
38
|
-
],
|
39
|
-
}),
|
40
|
-
|
41
|
-
new HtmlWebpackPlugin({
|
42
|
-
title: 'Dante Demo',
|
43
|
-
template: 'app/assets/license.html',
|
44
|
-
filename: 'license.html',
|
45
|
-
scripts: [
|
46
|
-
{
|
47
|
-
src: '/initialize.js',
|
48
|
-
type: 'module'
|
49
|
-
}
|
50
|
-
],
|
51
|
-
}),
|
52
|
-
|
53
|
-
new HtmlWebpackPlugin({
|
54
|
-
title: 'Dante Demo',
|
55
|
-
template: 'app/assets/options.html',
|
56
|
-
filename: 'doc.html',
|
57
|
-
scripts: [
|
58
|
-
{
|
59
|
-
src: '/initialize.js',
|
60
|
-
type: 'module'
|
61
|
-
}
|
62
|
-
],
|
63
|
-
}),
|
64
|
-
|
65
|
-
new CommonsChunkPlugin({
|
66
|
-
name: 'dante-vendors',
|
67
|
-
minChunks: function(module) {
|
68
|
-
return isExternal(module);
|
69
|
-
}
|
70
|
-
}),
|
71
|
-
|
72
|
-
new webpack.DefinePlugin({
|
73
|
-
'process.env': {
|
74
|
-
'NODE_ENV': JSON.stringify('production')
|
75
|
-
}
|
76
|
-
})
|
77
|
-
|
78
|
-
], outputFile;
|
79
|
-
|
80
|
-
if (env === 'build') {
|
81
|
-
plugins.push(new UglifyJsPlugin({ minimize: true }));
|
82
|
-
outputFile = libraryName + '.min.js';
|
83
|
-
} else {
|
84
|
-
outputFile = libraryName + '.js';
|
85
|
-
}
|
86
|
-
|
87
|
-
var config = {
|
88
|
-
//entry: __dirname + '/app/initialize.js',
|
89
|
-
|
90
|
-
entry: {
|
91
|
-
'app': './app/demo.js',
|
92
|
-
'dante': './app/initialize.js',
|
93
|
-
},
|
94
|
-
|
95
|
-
devtool: 'cheap-module-source-map',
|
96
|
-
output: {
|
97
|
-
path: __dirname + '/docs',
|
98
|
-
filename: '[name].js',
|
99
|
-
chunkFilename: "[id].js"
|
100
|
-
//filename: outputFile,
|
101
|
-
//library: libraryName,
|
102
|
-
//libraryTarget: 'umd',
|
103
|
-
//umdNamedDefine: true
|
104
|
-
},
|
105
|
-
resolve: {
|
106
|
-
root: path.resolve('./app'),
|
107
|
-
extensions: ['', '.js','.es6', '.cjsx', '.coffee', '.css', '.scss']
|
108
|
-
},
|
109
|
-
module: {
|
110
|
-
loaders: [
|
111
|
-
{ test: /\.cjsx$/,
|
112
|
-
loaders: ['coffee', 'cjsx'],
|
113
|
-
exclude: /(node_modules|bower_components)/
|
114
|
-
},
|
115
|
-
{ test: /\.coffee$/,
|
116
|
-
loader: 'coffee',
|
117
|
-
exclude: /(node_modules|bower_components)/ },
|
118
|
-
{
|
119
|
-
test: /(\.jsx|\.js|\.es6)$/,
|
120
|
-
loader: 'babel-loader',
|
121
|
-
exclude: /(node_modules|bower_components)/,
|
122
|
-
query: {
|
123
|
-
presets: ['es2015']
|
124
|
-
}
|
125
|
-
},
|
126
|
-
{
|
127
|
-
test: /\.css$/,
|
128
|
-
loader: ExtractTextPlugin.extract("style-loader", "css-loader")
|
129
|
-
},
|
130
|
-
{
|
131
|
-
test: /\.scss$/,
|
132
|
-
loader: ExtractTextPlugin.extract("style-loader", "css-loader!sass-loader")
|
133
|
-
},
|
134
|
-
{
|
135
|
-
test: /\.(eot|svg|ttf|woff|woff2)$/,
|
136
|
-
loader: 'file?name=fonts/[name].[ext]',
|
137
|
-
exclude: /node_modules/
|
138
|
-
},
|
139
|
-
{
|
140
|
-
test: /\.(png|jpg)$/,
|
141
|
-
loader:'file?limit=1024&name=images/[name].[ext]'
|
142
|
-
}
|
143
|
-
]
|
144
|
-
},
|
145
|
-
plugins: plugins
|
146
|
-
};
|
147
|
-
|
1
|
+
/* eslint no-var: 0, vars-on-top: 0 */
|
2
|
+
require('babel-register');
|
3
|
+
var config = require('./webpack/webpack.config');
|
148
4
|
module.exports = config;
|