Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Commit caff6d9

Browse files
committed
Feature: Introduced the inline editor build.
0 parents  commit caff6d9

25 files changed

+707
-0
lines changed

.editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Configurations to normalize the IDE behavior.
2+
# http://editorconfig.org/
3+
4+
root = true
5+
6+
[*]
7+
indent_style = tab
8+
tab_width = 4
9+
charset = utf-8
10+
end_of_line = lf
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true

.gitattributes

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
* text=auto
2+
3+
*.htaccess eol=lf
4+
*.cgi eol=lf
5+
*.sh eol=lf
6+
7+
*.css text
8+
*.htm text
9+
*.html text
10+
*.js text
11+
*.json text
12+
*.php text
13+
*.txt text
14+
*.md text
15+
16+
*.png -text
17+
*.gif -text
18+
*.jpg -text

.github/PULL_REQUEST_TEMPLATE.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
### Suggested merge commit message ([convention](https://github.com/ckeditor/ckeditor5-design/wiki/Git-commit-message-convention))
2+
3+
Type: Message. Closes #000.
4+
5+
---
6+
7+
### Additional information
8+
9+
*For example – encountered issues, assumptions you had to make, other affected tickets, etc.*

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# These files will be ignored by Git and by our linting tools:
2+
# gulp lint
3+
# gulp lint-staged
4+
5+
node_modules/

.npmignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
tests/**
2+
sample/**

CONTRIBUTING.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Contributing
2+
========================================
3+
4+
Information about contributing can be found on the following page: <https://github.com/ckeditor/ckeditor5/blob/master/CONTRIBUTING.md>.

LICENSE.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Software License Agreement
2+
==========================
3+
4+
**CKEditor 5 inline editor build**https://github.com/ckeditor/ckeditor5-build-inline <br>
5+
Copyright (c) 2003-2017, [CKSource](http://cksource.com) Frederico Knabben. All rights reserved.
6+
7+
Licensed under the terms of any of the following licenses at your choice:
8+
9+
* [GNU General Public License Version 2 or later (the "GPL")](http://www.gnu.org/licenses/gpl.html)
10+
* [GNU Lesser General Public License Version 2.1 or later (the "LGPL")](http://www.gnu.org/licenses/lgpl.html)
11+
* [Mozilla Public License Version 1.1 or later (the "MPL")](http://www.mozilla.org/MPL/MPL-1.1.html)
12+
13+
You are not required to, but if you want to explicitly declare the license you have chosen to be bound to when using, reproducing, modifying and distributing this software, just include a text file titled "legal.txt" in your version of this software, indicating your license choice. In any case, your choice will not restrict any recipient of your version of this software to use, reproduce, modify and distribute this software under any of the above licenses.
14+
15+
Sources of Intellectual Property Included in CKEditor
16+
-----------------------------------------------------
17+
18+
Where not otherwise indicated, all CKEditor content is authored by CKSource engineers and consists of CKSource-owned intellectual property. In some specific instances, CKEditor will incorporate work done by developers outside of CKSource with their express permission.
19+
20+
Trademarks
21+
----------
22+
23+
**CKEditor** is a trademark of [CKSource](http://cksource.com) Frederico Knabben. All other brand and product names are trademarks, registered trademarks or service marks of their respective holders.

README.md

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
CKEditor 5 inline editor build
2+
==============================================
3+
4+
[![Join the chat at https://gitter.im/ckeditor/ckeditor5](https://badges.gitter.im/ckeditor/ckeditor5.svg)](https://gitter.im/ckeditor/ckeditor5?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
5+
[![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-build-inline.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-build-inline)
6+
[![Dependency Status](https://david-dm.org/ckeditor/ckeditor5-build-inline/status.svg)](https://david-dm.org/ckeditor/ckeditor5-build-inline)
7+
[![devDependency Status](https://david-dm.org/ckeditor/ckeditor5-build-inline/dev-status.svg)](https://david-dm.org/ckeditor/ckeditor5-build-inline?type=dev)
8+
9+
The inline editor build. Read more in the [classic editor](https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/builds/guides/overview.html#Classic-editor) and see the [demo](https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/examples/builds/classic-editor.html).
10+
11+
## Documentation
12+
13+
See:
14+
15+
* [Installation](https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/builds/guides/integration/installation.html) for how to install this package and what it contains.
16+
* [Basic API](https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/builds/guides/integration/basic-api.html) for how to create an editor and interact with it.
17+
* [Configuration](https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/builds/guides/integration/configuration.html) for how to configure the editor.
18+
* [Creating custom builds](https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/builds/guides/development/custom-builds.html) for how to customize the build (configure and rebuild the editor bundle).
19+
20+
## Quick start
21+
22+
First, install the build from npm:
23+
24+
```
25+
npm install --save @ckeditor/ckeditor5-build-inline
26+
```
27+
28+
And use it in your website:
29+
30+
```html
31+
<div id="editor">
32+
<p>This is the editor content.</p>
33+
</div>
34+
<script src="./node_modules/@ckeditor/ckeditor5-build-inline/build/ckeditor.js"></script>
35+
<script>
36+
InlineEditor
37+
.create( document.querySelector( '#editor' ) )
38+
.then( editor => {
39+
window.editor = editor;
40+
} )
41+
.catch( err => {
42+
console.error( err.stack );
43+
} );
44+
</script>
45+
```
46+
47+
Or in your JavaScript application:
48+
49+
```js
50+
import { InlineEditor } from '@ckeditor/ckeditor5-build-inline/build/ckeditor';
51+
52+
// Or using CommonJS verion:
53+
// const InlineEditor = require( '@ckeditor/ckeditor5-build-inline/build/ckeditor' ).InlineEditor;
54+
55+
InlineEditor
56+
.create( document.querySelector( '#editor' ) )
57+
.then( editor => {
58+
window.editor = editor;
59+
} )
60+
.catch( err => {
61+
console.error( err.stack );
62+
} );
63+
```
64+
65+
**Note:** If you are planning to integrate CKEditor 5 deep into your application it is actually more convenient and recommended to install and import the source modules directly (like it happens in `ckeditor.js`). Read more in the [Bundling guide](https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/builds/guides/integration/bundling.html).
66+
67+
## License
68+
69+
Licensed under the GPL, LGPL and MPL licenses, at your choice. For full details about the license, please check the `LICENSE.md` file.

bin/build-ckeditor.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
echo "Building 'build/ckeditor.js'..."
4+
echo ""
5+
6+
webpack
7+
8+
echo ""
9+
echo "Done."

bin/create-entry-file.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env node
2+
3+
/**
4+
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
5+
* For licensing, see LICENSE.md.
6+
*/
7+
8+
'use strict';
9+
10+
const { bundler } = require( '@ckeditor/ckeditor5-dev-utils' );
11+
const buildConfig = require( '../build-config' );
12+
13+
console.log( 'Creating the entry file...' );
14+
15+
bundler.createEntryFile( 'ckeditor.js', buildConfig );
16+
17+
console.log( 'Done.' );

build-config.js

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/**
2+
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3+
* For licensing, see LICENSE.md.
4+
*/
5+
6+
'use strict';
7+
8+
module.exports = {
9+
// The editor creator to use.
10+
editor: '@ckeditor/ckeditor5-editor-inline/src/inlineeditor',
11+
12+
// The name under which the editor will be exported.
13+
moduleName: 'InlineEditor',
14+
15+
// Plugins to include in the build.
16+
plugins: [
17+
'@ckeditor/ckeditor5-presets/src/essentials',
18+
19+
'@ckeditor/ckeditor5-autoformat/src/autoformat',
20+
'@ckeditor/ckeditor5-basic-styles/src/bold',
21+
'@ckeditor/ckeditor5-basic-styles/src/italic',
22+
'@ckeditor/ckeditor5-block-quote/src/blockquote',
23+
'@ckeditor/ckeditor5-heading/src/heading',
24+
'@ckeditor/ckeditor5-image/src/image',
25+
'@ckeditor/ckeditor5-image/src/imagecaption',
26+
'@ckeditor/ckeditor5-image/src/imagestyle',
27+
'@ckeditor/ckeditor5-image/src/imagetoolbar',
28+
'@ckeditor/ckeditor5-link/src/link',
29+
'@ckeditor/ckeditor5-list/src/list',
30+
'@ckeditor/ckeditor5-paragraph/src/paragraph',
31+
],
32+
33+
// UI language. Language codes follow the https://en.wikipedia.org/wiki/ISO_639-1 format.
34+
language: 'en',
35+
36+
// Editor config.
37+
config: {
38+
toolbar: [
39+
'headings',
40+
'bold',
41+
'italic',
42+
'link',
43+
'bulletedList',
44+
'numberedList',
45+
'blockQuote',
46+
'undo',
47+
'redo'
48+
],
49+
50+
image: {
51+
toolbar: [ 'imageStyleFull', 'imageStyleSide', '|', 'imageTextAlternative' ]
52+
}
53+
}
54+
};

build/ckeditor.js

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/ckeditor.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ckeditor.js

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/**
2+
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3+
* For licensing, see LICENSE.md.
4+
*/
5+
6+
import InlineEditorBase from '@ckeditor/ckeditor5-editor-inline/src/inlineeditor';
7+
import EssentialsPlugin from '@ckeditor/ckeditor5-presets/src/essentials';
8+
import AutoformatPlugin from '@ckeditor/ckeditor5-autoformat/src/autoformat';
9+
import BoldPlugin from '@ckeditor/ckeditor5-basic-styles/src/bold';
10+
import ItalicPlugin from '@ckeditor/ckeditor5-basic-styles/src/italic';
11+
import BlockquotePlugin from '@ckeditor/ckeditor5-block-quote/src/blockquote';
12+
import HeadingPlugin from '@ckeditor/ckeditor5-heading/src/heading';
13+
import ImagePlugin from '@ckeditor/ckeditor5-image/src/image';
14+
import ImagecaptionPlugin from '@ckeditor/ckeditor5-image/src/imagecaption';
15+
import ImagestylePlugin from '@ckeditor/ckeditor5-image/src/imagestyle';
16+
import ImagetoolbarPlugin from '@ckeditor/ckeditor5-image/src/imagetoolbar';
17+
import LinkPlugin from '@ckeditor/ckeditor5-link/src/link';
18+
import ListPlugin from '@ckeditor/ckeditor5-list/src/list';
19+
import ParagraphPlugin from '@ckeditor/ckeditor5-paragraph/src/paragraph';
20+
21+
export class InlineEditor extends InlineEditorBase {}
22+
23+
InlineEditor.build = {
24+
plugins: [
25+
EssentialsPlugin,
26+
AutoformatPlugin,
27+
BoldPlugin,
28+
ItalicPlugin,
29+
BlockquotePlugin,
30+
HeadingPlugin,
31+
ImagePlugin,
32+
ImagecaptionPlugin,
33+
ImagestylePlugin,
34+
ImagetoolbarPlugin,
35+
LinkPlugin,
36+
ListPlugin,
37+
ParagraphPlugin
38+
],
39+
config: {
40+
toolbar: [
41+
'headings',
42+
'bold',
43+
'italic',
44+
'link',
45+
'bulletedList',
46+
'numberedList',
47+
'blockQuote',
48+
'undo',
49+
'redo'
50+
],
51+
image: {
52+
toolbar: [
53+
'imageStyleFull',
54+
'imageStyleSide',
55+
'|',
56+
'imageTextAlternative'
57+
]
58+
}
59+
}
60+
};

package.json

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"name": "@ckeditor/ckeditor5-build-inline",
3+
"version": "0.0.1",
4+
"description": "CKEditor 5 inline editor build.",
5+
"keywords": [
6+
"ckeditor5-build",
7+
"text editor",
8+
"WYSIWYG",
9+
"rich-text editor"
10+
],
11+
"main": "./build/ckeditor.js",
12+
"dependencies": {
13+
"@ckeditor/ckeditor5-editor-inline": "*",
14+
"@ckeditor/ckeditor5-presets": "^0.2.2",
15+
"@ckeditor/ckeditor5-autoformat": "^0.5.1",
16+
"@ckeditor/ckeditor5-basic-styles": "^0.8.1",
17+
"@ckeditor/ckeditor5-block-quote": "^0.1.1",
18+
"@ckeditor/ckeditor5-heading": "^0.9.1",
19+
"@ckeditor/ckeditor5-image": "^0.6.0",
20+
"@ckeditor/ckeditor5-link": "^0.7.0",
21+
"@ckeditor/ckeditor5-list": "^0.6.1",
22+
"@ckeditor/ckeditor5-paragraph": "^0.8.0"
23+
},
24+
"devDependencies": {
25+
"@ckeditor/ckeditor5-dev-utils": "^3.0.0",
26+
"@ckeditor/ckeditor5-dev-webpack-plugin": "^2.0.11",
27+
"babel-minify-webpack-plugin": "^0.2.0",
28+
"css-loader": "^0.28.5",
29+
"node-sass": "^4.5.3",
30+
"raw-loader": "^0.5.1",
31+
"sass-loader": "^6.0.6",
32+
"style-loader": "^0.18.2",
33+
"webpack": "^3.5.5"
34+
},
35+
"engines": {
36+
"node": ">=6.0.0",
37+
"npm": ">=3.0.0"
38+
},
39+
"author": "CKSource (http://cksource.com/)",
40+
"license": "(GPL-2.0 OR LGPL-2.1 OR MPL-1.1)",
41+
"homepage": "https://ckeditor5.github.io",
42+
"bugs": "https://github.com/ckeditor/ckeditor5-build-inline/issues",
43+
"repository": {
44+
"type": "git",
45+
"url": "https://github.com/ckeditor/ckeditor5-build-inline.git"
46+
},
47+
"scripts": {
48+
"build": "npm run create-entry-file && npm run build-ckeditor",
49+
"create-entry-file": "./bin/create-entry-file.js",
50+
"build-ckeditor": "./bin/build-ckeditor.sh"
51+
}
52+
}

0 commit comments

Comments
 (0)