CKEditor components replaced by CKEditor 5.
Remains of the sandboxed CKEditor - will be removed, but the version here may be useful for another editor that is prone to XSS (like Summernote).
This commit is contained in:
parent
213039c141
commit
eacdc74c29
43 changed files with 12499 additions and 1382 deletions
|
@ -1,10 +1,21 @@
|
|||
const webpack = require('webpack');
|
||||
const path = require('path');
|
||||
|
||||
// The CKEditor part comes from https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/advanced-setup.html
|
||||
const CKEditorWebpackPlugin = require( '@ckeditor/ckeditor5-dev-webpack-plugin' );
|
||||
const { styles } = require( '@ckeditor/ckeditor5-dev-utils' );
|
||||
|
||||
module.exports = {
|
||||
plugins: [
|
||||
new CKEditorWebpackPlugin( {
|
||||
// See https://ckeditor.com/docs/ckeditor5/latest/features/ui-language.html
|
||||
language: 'en'
|
||||
} )
|
||||
],
|
||||
entry: {
|
||||
root: ['babel-polyfill', './src/root.js'],
|
||||
mosaico: ['babel-polyfill', './src/lib/mosaico-sandbox-root.js'],
|
||||
mosaico: ['babel-polyfill', './src/lib/sandboxed-mosaico-root.js'],
|
||||
ckeditor: ['babel-polyfill', './src/lib/sandboxed-ckeditor-root.js'],
|
||||
},
|
||||
output: {
|
||||
library: 'MailtrainReactBody',
|
||||
|
@ -15,12 +26,51 @@ module.exports = {
|
|||
rules: [
|
||||
{
|
||||
test: /\.(js|jsx)$/,
|
||||
exclude: /(disposables|react-dnd-touch-backend|attr-accept)/ /* https://github.com/react-dnd/react-dnd/issues/407 */,
|
||||
use: [ 'babel-loader' ]
|
||||
exclude: path.join(__dirname, 'node_modules'),
|
||||
use: [
|
||||
{
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: [
|
||||
['env', {
|
||||
targets: {
|
||||
"chrome": "58",
|
||||
"edge": "15",
|
||||
"firefox": "55",
|
||||
"ios": "10"
|
||||
}
|
||||
}],
|
||||
'stage-1'
|
||||
],
|
||||
plugins: ['transform-react-jsx', 'transform-decorators-legacy', 'transform-function-bind']
|
||||
}
|
||||
}
|
||||
]
|
||||
// exclude: /(disposables|react-dnd-touch-backend|attr-accept)/ /* https://github.com/react-dnd/react-dnd/issues/407 */,
|
||||
// use: [ 'babel-loader' ]
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [ 'style-loader', 'css-loader' ]
|
||||
use: [
|
||||
{
|
||||
loader: 'style-loader',
|
||||
options: {
|
||||
singleton: true
|
||||
}
|
||||
},
|
||||
{
|
||||
loader: 'css-loader'
|
||||
},
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
options: styles.getPostCssConfig( {
|
||||
themeImporter: {
|
||||
themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' )
|
||||
},
|
||||
minify: false
|
||||
} )
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpg|gif)$/,
|
||||
|
@ -32,7 +82,14 @@ module.exports = {
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
},
|
||||
{
|
||||
// Or /ckeditor5-[^/]+\/theme\/icons\/[^/]+\.svg$/ if you want to limit this loader
|
||||
// to CKEditor 5 icons only.
|
||||
test: /\.svg$/,
|
||||
|
||||
use: [ 'raw-loader' ]
|
||||
},
|
||||
{
|
||||
test: /\.scss$/,
|
||||
exclude: path.join(__dirname, 'node_modules'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue