-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #166 from ckeditor/i/165
Feature: Improved Angular integration to handle Context and ContextWatchdog. Closes #165.
- Loading branch information
Showing
26 changed files
with
1,804 additions
and
389 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 |
---|---|---|
|
@@ -27,3 +27,6 @@ testem.log | |
# System Files | ||
.DS_Store | ||
Thumbs.db | ||
|
||
|
||
/ckeditor/build |
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
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,109 @@ | ||
/** | ||
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
*/ | ||
|
||
// The editor creator to use. | ||
import ClassicEditorBase from '@ckeditor/ckeditor5-editor-classic/src/classiceditor'; | ||
|
||
import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials'; | ||
import UploadAdapter from '@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter'; | ||
import Autoformat from '@ckeditor/ckeditor5-autoformat/src/autoformat'; | ||
import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold'; | ||
import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic'; | ||
import BlockQuote from '@ckeditor/ckeditor5-block-quote/src/blockquote'; | ||
import CKFinder from '@ckeditor/ckeditor5-ckfinder/src/ckfinder'; | ||
import EasyImage from '@ckeditor/ckeditor5-easy-image/src/easyimage'; | ||
import Heading from '@ckeditor/ckeditor5-heading/src/heading'; | ||
import Image from '@ckeditor/ckeditor5-image/src/image'; | ||
import ImageCaption from '@ckeditor/ckeditor5-image/src/imagecaption'; | ||
import ImageStyle from '@ckeditor/ckeditor5-image/src/imagestyle'; | ||
import ImageToolbar from '@ckeditor/ckeditor5-image/src/imagetoolbar'; | ||
import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload'; | ||
import Indent from '@ckeditor/ckeditor5-indent/src/indent'; | ||
import Link from '@ckeditor/ckeditor5-link/src/link'; | ||
import List from '@ckeditor/ckeditor5-list/src/list'; | ||
import MediaEmbed from '@ckeditor/ckeditor5-media-embed/src/mediaembed'; | ||
import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph'; | ||
import PasteFromOffice from '@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice'; | ||
import Table from '@ckeditor/ckeditor5-table/src/table'; | ||
import TableToolbar from '@ckeditor/ckeditor5-table/src/tabletoolbar'; | ||
|
||
import Context from '@ckeditor/ckeditor5-core/src/context'; | ||
import ContextWatchdog from '@ckeditor/ckeditor5-watchdog/src/contextwatchdog'; | ||
|
||
class ClassicEditor extends ClassicEditorBase {} | ||
|
||
// Plugins to include in the build. | ||
ClassicEditor.builtinPlugins = [ | ||
Essentials, | ||
UploadAdapter, | ||
Autoformat, | ||
Bold, | ||
Italic, | ||
BlockQuote, | ||
CKFinder, | ||
EasyImage, | ||
Heading, | ||
Image, | ||
ImageCaption, | ||
ImageStyle, | ||
ImageToolbar, | ||
ImageUpload, | ||
Indent, | ||
Link, | ||
List, | ||
MediaEmbed, | ||
Paragraph, | ||
PasteFromOffice, | ||
Table, | ||
TableToolbar | ||
]; | ||
|
||
// Editor configuration. | ||
ClassicEditor.defaultConfig = { | ||
toolbar: { | ||
items: [ | ||
'heading', | ||
'|', | ||
'bold', | ||
'italic', | ||
'link', | ||
'bulletedList', | ||
'numberedList', | ||
'|', | ||
'indent', | ||
'outdent', | ||
'|', | ||
'imageUpload', | ||
'blockQuote', | ||
'insertTable', | ||
'mediaEmbed', | ||
'undo', | ||
'redo' | ||
] | ||
}, | ||
image: { | ||
toolbar: [ | ||
'imageStyle:full', | ||
'imageStyle:side', | ||
'|', | ||
'imageTextAlternative' | ||
] | ||
}, | ||
table: { | ||
contentToolbar: [ | ||
'tableColumn', | ||
'tableRow', | ||
'mergeTableCells' | ||
] | ||
}, | ||
// This value must be kept in sync with the language defined in webpack.config.js. | ||
language: 'en' | ||
}; | ||
|
||
export default { | ||
ClassicEditor, | ||
Context, | ||
ContextWatchdog | ||
}; |
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,88 @@ | ||
/** | ||
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
*/ | ||
|
||
'use strict'; | ||
|
||
/* eslint-env node */ | ||
|
||
const path = require( 'path' ); | ||
const webpack = require( 'webpack' ); | ||
const { bundler, styles } = require( '@ckeditor/ckeditor5-dev-utils' ); | ||
const CKEditorWebpackPlugin = require( '@ckeditor/ckeditor5-dev-webpack-plugin' ); | ||
const TerserPlugin = require( 'terser-webpack-plugin' ); | ||
|
||
module.exports = { | ||
devtool: 'source-map', | ||
performance: { hints: false }, | ||
|
||
entry: path.resolve( __dirname, 'src', 'ckeditor.js' ), | ||
|
||
output: { | ||
// The name under which the editor will be exported. | ||
library: 'CKSource', | ||
|
||
path: path.resolve( __dirname, 'build' ), | ||
filename: 'cksource.js', | ||
libraryTarget: 'umd', | ||
libraryExport: 'default' | ||
}, | ||
|
||
optimization: { | ||
minimizer: [ | ||
new TerserPlugin( { | ||
sourceMap: true, | ||
terserOptions: { | ||
output: { | ||
// Preserve CKEditor 5 license comments. | ||
comments: /^!/ | ||
} | ||
}, | ||
extractComments: false | ||
} ) | ||
] | ||
}, | ||
|
||
plugins: [ | ||
new CKEditorWebpackPlugin( { | ||
// UI language. Language codes follow the https://en.wikipedia.org/wiki/ISO_639-1 format. | ||
// When changing the built-in language, remember to also change it in the editor's configuration (src/ckeditor.js). | ||
language: 'en', | ||
additionalLanguages: 'all' | ||
} ), | ||
new webpack.BannerPlugin( { | ||
banner: bundler.getLicenseBanner(), | ||
raw: true | ||
} ) | ||
], | ||
|
||
module: { | ||
rules: [ | ||
{ | ||
test: /\.svg$/, | ||
use: [ 'raw-loader' ] | ||
}, | ||
{ | ||
test: /\.css$/, | ||
use: [ | ||
{ | ||
loader: 'style-loader', | ||
options: { | ||
injectType: 'singletonStyleTag' | ||
} | ||
}, | ||
{ | ||
loader: 'postcss-loader', | ||
options: styles.getPostCssConfig( { | ||
themeImporter: { | ||
themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ) | ||
}, | ||
minify: true | ||
} ) | ||
}, | ||
] | ||
} | ||
] | ||
} | ||
}; |
Oops, something went wrong.