浏览代码

Merge pull request #2 from ckeditor/t/1

Feature: Implemented the balloon block build. Closes #1. Closes [ckeditor/ckeditor5#1112](https://github.com/ckeditor/ckeditor5/issues/1112).
Piotrek Koszuliński 6 年之前
父节点
当前提交
e66380c3f4
共有 70 个文件被更改,包括 682 次插入5 次删除
  1. 12 0
      packages/ckeditor5-build-balloon-block/.eslintrc.js
  2. 1 1
      packages/ckeditor5-build-balloon-block/LICENSE.md
  3. 71 0
      packages/ckeditor5-build-balloon-block/README.md
  4. 6 0
      packages/ckeditor5-build-balloon-block/build/ckeditor.js
  5. 1 0
      packages/ckeditor5-build-balloon-block/build/ckeditor.js.map
  6. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/ar.js
  7. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/ast.js
  8. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/az.js
  9. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/bg.js
  10. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/ca.js
  11. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/cs.js
  12. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/da.js
  13. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/de-ch.js
  14. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/de.js
  15. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/el.js
  16. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/en-au.js
  17. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/eo.js
  18. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/es.js
  19. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/et.js
  20. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/eu.js
  21. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/fa.js
  22. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/fi.js
  23. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/fr.js
  24. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/gl.js
  25. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/gu.js
  26. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/he.js
  27. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/hr.js
  28. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/hu.js
  29. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/id.js
  30. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/it.js
  31. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/ja.js
  32. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/km.js
  33. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/kn.js
  34. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/ko.js
  35. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/ku.js
  36. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/lv.js
  37. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/nb.js
  38. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/ne.js
  39. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/nl.js
  40. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/no.js
  41. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/oc.js
  42. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/pl.js
  43. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/pt-br.js
  44. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/pt.js
  45. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/ro.js
  46. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/ru.js
  47. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/si.js
  48. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/sk.js
  49. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/sq.js
  50. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/sv.js
  51. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/tr.js
  52. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/tt.js
  53. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/ug.js
  54. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/uk.js
  55. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/vi.js
  56. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/zh-cn.js
  57. 1 0
      packages/ckeditor5-build-balloon-block/build/translations/zh.js
  58. 24 4
      packages/ckeditor5-build-balloon-block/package.json
  59. 41 0
      packages/ckeditor5-build-balloon-block/sample/index.html
  60. 100 0
      packages/ckeditor5-build-balloon-block/src/ckeditor.js
  61. 173 0
      packages/ckeditor5-build-balloon-block/tests/ckeditor.js
  62. 27 0
      packages/ckeditor5-build-balloon-block/tests/manual/ckeditor-cjs-version.html
  63. 17 0
      packages/ckeditor5-build-balloon-block/tests/manual/ckeditor-cjs-version.js
  64. 9 0
      packages/ckeditor5-build-balloon-block/tests/manual/ckeditor-cjs-version.md
  65. 27 0
      packages/ckeditor5-build-balloon-block/tests/manual/ckeditor.html
  66. 16 0
      packages/ckeditor5-build-balloon-block/tests/manual/ckeditor.js
  67. 9 0
      packages/ckeditor5-build-balloon-block/tests/manual/ckeditor.md
  68. 二进制
      packages/ckeditor5-build-balloon-block/tests/manual/sample.jpg
  69. 9 0
      packages/ckeditor5-build-balloon-block/theme/theme.css
  70. 87 0
      packages/ckeditor5-build-balloon-block/webpack.config.js

+ 12 - 0
packages/ckeditor5-build-balloon-block/.eslintrc.js

@@ -0,0 +1,12 @@
+/**
+ * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+/* eslint-env node */
+
+'use strict';
+
+module.exports = {
+	extends: 'ckeditor5'
+};

+ 1 - 1
packages/ckeditor5-build-balloon-block/LICENSE.md

@@ -2,7 +2,7 @@ Software License Agreement
 ==========================
 
 **CKEditor 5 balloon block editor build** – https://github.com/ckeditor/ckeditor5-build-balloon-block <br>
-Copyright (c) 2003-2018, [CKSource](http://cksource.com) Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2019, [CKSource](http://cksource.com) Frederico Knabben. All rights reserved.
 
 Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html).
 

+ 71 - 0
packages/ckeditor5-build-balloon-block/README.md

@@ -1,2 +1,73 @@
 CKEditor 5 balloon block editor build
 ==============================================
+
+[![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)
+[![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-build-balloon-block.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-build-balloon-block)
+[![Dependency Status](https://david-dm.org/ckeditor/ckeditor5-build-balloon-block/status.svg)](https://david-dm.org/ckeditor/ckeditor5-build-balloon-block)
+[![devDependency Status](https://david-dm.org/ckeditor/ckeditor5-build-balloon-block/dev-status.svg)](https://david-dm.org/ckeditor/ckeditor5-build-balloon-block?type=dev)
+
+The build of CKEditor 5 featuring the balloon and block toolbars. Read more about the [balloon block editor build](https://ckeditor.com/docs/ckeditor5/latest/builds/guides/overview.html#balloon-block-editor) and see the [demo](https://ckeditor.com/docs/ckeditor5/latest/examples/builds/balloon-block-editor.html).
+
+![CKEditor 5 balloon block editor build screenshot](https://c.cksource.com/a/1/img/npm/ckeditor5-build-balloon-block.png)
+
+## Documentation
+
+See:
+
+* [Installation](https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/installation.html) for how to install this package and what it contains.
+* [Basic API](https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/basic-api.html) for how to create an editor and interact with it.
+* [Configuration](https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/configuration.html) for how to configure the editor.
+* [Creating custom builds](https://ckeditor.com/docs/ckeditor5/latest/builds/guides/development/custom-builds.html) for how to customize the build (configure and rebuild the editor bundle).
+
+## Quick start
+
+First, install the build from npm:
+
+```bash
+npm install --save @ckeditor/ckeditor5-build-balloon-block
+```
+
+And use it in your website:
+
+```html
+<div id="editor">
+	<p>This is the editor content.</p>
+</div>
+<script src="./node_modules/@ckeditor/ckeditor5-build-balloon-block/build/ckeditor.js"></script>
+<script>
+	BalloonEditor
+		.create( document.querySelector( '#editor' ) )
+		.then( editor => {
+			window.editor = editor;
+		} )
+		.catch( err => {
+			console.error( err.stack );
+		} );
+</script>
+```
+
+Or in your JavaScript application:
+
+```js
+import BalloonEditor from '@ckeditor/ckeditor5-build-balloon-block';
+
+// Or using the CommonJS version:
+// const BalloonEditor = require( '@ckeditor/ckeditor5-build-balloon-block' );
+
+BalloonEditor
+	.create( document.querySelector( '#editor' ) )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );
+```
+
+**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 [Advanced setup guide](https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/advanced-setup.html).
+
+**Note:** You can configure the block toolbar items using the {@link module:core/editor/editorconfig~EditorConfig#blockToolbar `config.blockToolbar`} option.
+
+## License
+
+Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html). For full details about the license, please check the `LICENSE.md` file.

文件差异内容过多而无法显示
+ 6 - 0
packages/ckeditor5-build-balloon-block/build/ckeditor.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/ckeditor.js.map


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/ar.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/ast.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/az.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/bg.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/ca.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/cs.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/da.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/de-ch.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/de.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/el.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/en-au.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/eo.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/es.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/et.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/eu.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/fa.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/fi.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/fr.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/gl.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/gu.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/he.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/hr.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/hu.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/id.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/it.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/ja.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/km.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/kn.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/ko.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/ku.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/lv.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/nb.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/ne.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/nl.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/no.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/oc.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/pl.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/pt-br.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/pt.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/ro.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/ru.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/si.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/sk.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/sq.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/sv.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/tr.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/tt.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/ug.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/uk.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/vi.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/zh-cn.js


文件差异内容过多而无法显示
+ 1 - 0
packages/ckeditor5-build-balloon-block/build/translations/zh.js


+ 24 - 4
packages/ckeditor5-build-balloon-block/package.json

@@ -30,8 +30,9 @@
     "@ckeditor/ckeditor5-basic-styles": "^10.1.0",
     "@ckeditor/ckeditor5-block-quote": "^10.1.1",
     "@ckeditor/ckeditor5-ckfinder": "^10.0.0",
-    "@ckeditor/ckeditor5-dev-utils": "^11.0.0",
-    "@ckeditor/ckeditor5-dev-webpack-plugin": "^7.0.0",
+    "@ckeditor/ckeditor5-core": "^11.1.0",
+    "@ckeditor/ckeditor5-dev-utils": "^11.0.1",
+    "@ckeditor/ckeditor5-dev-webpack-plugin": "^7.0.1",
     "@ckeditor/ckeditor5-easy-image": "^10.0.4",
     "@ckeditor/ckeditor5-editor-balloon": "^11.0.2",
     "@ckeditor/ckeditor5-essentials": "^10.1.3",
@@ -46,6 +47,10 @@
     "@ckeditor/ckeditor5-theme-lark": "^12.0.0",
     "@ckeditor/ckeditor5-ui": "^11.2.0",
     "@ckeditor/ckeditor5-upload": "^10.0.4",
+    "eslint": "^5.5.0",
+    "eslint-config-ckeditor5": "^1.0.7",
+    "husky": "^1.3.1",
+    "lint-staged": "^7.0.0",
     "postcss-loader": "^3.0.0",
     "raw-loader": "^1.0.0",
     "style-loader": "^0.23.0",
@@ -54,8 +59,8 @@
     "webpack-cli": "^3.0.8"
   },
   "engines": {
-    "node": ">=6.9.0",
-    "npm": ">=3.0.0"
+    "node": ">=8.0.0",
+    "npm": ">=5.7.1"
   },
   "author": "CKSource (http://cksource.com/)",
   "license": "GPL-2.0-or-later",
@@ -67,6 +72,21 @@
   },
   "scripts": {
     "build": "webpack --mode production",
+    "lint": "eslint --quiet '**/*.js'",
     "preversion": "npm run build; if [ -n \"$(git status src/ckeditor.js build/ --porcelain)\" ]; then git add -u src/ckeditor.js build/ && git commit -m 'Internal: Build.'; fi"
+  },
+  "lint-staged": {
+    "**/*.js": [
+      "eslint --quiet"
+    ]
+  },
+  "eslintIgnore": [
+    "build/**",
+    "packages/**"
+  ],
+  "husky": {
+    "hooks": {
+      "pre-commit": "lint-staged"
+    }
   }
 }

+ 41 - 0
packages/ckeditor5-build-balloon-block/sample/index.html

@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+	<meta charset="utf-8">
+	<title>CKEditor 5 – balloon block editor build – development sample</title>
+	<style>
+		body {
+			max-width: 800px;
+			margin: 20px auto;
+		}
+	</style>
+</head>
+<body>
+
+<h1>CKEditor 5 – balloon block editor build – development sample</h1>
+
+<div id="editor">
+	<h2>Sample</h2>
+
+	<p>This is an instance of the <a href="https://ckeditor.com/docs/ckeditor5/latest/builds/guides/overview.html#balloon-editor">balloon block editor build</a>.</p>
+
+	<figure class="image">
+		<img src="../tests/manual/sample.jpg" alt="Autumn fields" />
+	</figure>
+
+	<p>You can use this sample to validate whether your <a href="https://ckeditor.com/docs/ckeditor5/latest/builds/guides/development/custom-builds.html">custom build</a> works fine.</p>
+</div>
+
+<script src="../build/ckeditor.js"></script>
+<script>
+	BalloonEditor.create( document.querySelector( '#editor' ) )
+		.then( editor => {
+			window.editor = editor;
+		} )
+		.catch( err => {
+			console.error( err.stack );
+		} );
+</script>
+
+</body>
+</html>

+ 100 - 0
packages/ckeditor5-build-balloon-block/src/ckeditor.js

@@ -0,0 +1,100 @@
+/**
+ * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+// The editor creator to use.
+import BalloonEditorBase from '@ckeditor/ckeditor5-editor-balloon/src/ballooneditor';
+
+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 BlockToolbar from '@ckeditor/ckeditor5-ui/src/toolbar/block/blocktoolbar.js';
+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 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 '../theme/theme.css';
+
+export default class BalloonEditor extends BalloonEditorBase {}
+
+// Plugins to include in the build.
+BalloonEditor.builtinPlugins = [
+	Essentials,
+	UploadAdapter,
+	Autoformat,
+	BlockToolbar,
+	Bold,
+	Italic,
+	BlockQuote,
+	CKFinder,
+	EasyImage,
+	Heading,
+	Image,
+	ImageCaption,
+	ImageStyle,
+	ImageToolbar,
+	ImageUpload,
+	Link,
+	List,
+	MediaEmbed,
+	Paragraph,
+	PasteFromOffice,
+	Table,
+	TableToolbar
+];
+
+// Editor configuration.
+BalloonEditor.defaultConfig = {
+	blockToolbar: [
+		'heading',
+		'|',
+		'bulletedList',
+		'numberedList',
+		'imageUpload',
+		'blockQuote',
+		'insertTable',
+		'mediaEmbed'
+	],
+	toolbar: {
+		items: [
+			'bold',
+			'italic',
+			'link',
+			'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'
+};

+ 173 - 0
packages/ckeditor5-build-balloon-block/tests/ckeditor.js

@@ -0,0 +1,173 @@
+/**
+ * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+/* globals document */
+
+import BalloonEditor from '../src/ckeditor';
+import BaseBalloonEditor from '@ckeditor/ckeditor5-editor-balloon/src/ballooneditor';
+import { describeMemoryUsage, testMemoryUsage } from '@ckeditor/ckeditor5-core/tests/_utils/memory';
+
+describe( 'BalloonEditor build', () => {
+	let editor, editorElement;
+
+	beforeEach( () => {
+		editorElement = document.createElement( 'div' );
+		editorElement.innerHTML = '<p><strong>foo</strong> bar</p>';
+
+		document.body.appendChild( editorElement );
+	} );
+
+	afterEach( () => {
+		editorElement.remove();
+	} );
+
+	describe( 'buid', () => {
+		it( 'contains plugins', () => {
+			expect( BalloonEditor.builtinPlugins ).to.not.be.empty;
+		} );
+
+		it( 'contains config', () => {
+			expect( BalloonEditor.defaultConfig.toolbar ).to.not.be.empty;
+		} );
+
+		it( 'contains block toolbar config', () => {
+			expect( BalloonEditor.defaultConfig.blockToolbar ).to.not.be.empty;
+		} );
+	} );
+
+	describe( 'create()', () => {
+		beforeEach( () => {
+			return BalloonEditor.create( editorElement )
+				.then( newEditor => {
+					editor = newEditor;
+				} );
+		} );
+
+		afterEach( () => {
+			return editor.destroy();
+		} );
+
+		it( 'creates an instance which inherits from the BalloonEditor', () => {
+			expect( editor ).to.be.instanceof( BalloonEditor );
+			expect( editor ).to.be.instanceof( BaseBalloonEditor );
+		} );
+
+		it( 'loads data from the editor element', () => {
+			expect( editor.getData() ).to.equal( '<p><strong>foo</strong> bar</p>' );
+		} );
+	} );
+
+	describe( 'destroy()', () => {
+		beforeEach( () => {
+			return BalloonEditor.create( editorElement )
+				.then( newEditor => {
+					editor = newEditor;
+				} );
+		} );
+
+		it( 'sets the data back to the editor element', () => {
+			editor.setData( '<p>foo</p>' );
+
+			return editor.destroy()
+				.then( () => {
+					expect( editorElement.innerHTML ).to.equal( '<p>foo</p>' );
+				} );
+		} );
+	} );
+
+	describe( 'plugins', () => {
+		beforeEach( () => {
+			return BalloonEditor.create( editorElement )
+				.then( newEditor => {
+					editor = newEditor;
+				} );
+		} );
+
+		afterEach( () => {
+			return editor.destroy();
+		} );
+
+		it( 'block toolbar works', () => {
+			expect( editor.plugins.get( 'BlockToolbar' ) ).to.be.an( 'object' );
+		} );
+
+		it( 'paragraph works', () => {
+			const data = '<p>Some text inside a paragraph.</p>';
+
+			editor.setData( data );
+			expect( editor.getData() ).to.equal( data );
+		} );
+
+		it( 'basic-styles work', () => {
+			const data = [
+				'<p>',
+				'<strong>Test:strong</strong>',
+				'<i>Test:i</i>',
+				'</p>'
+			].join( '' );
+
+			editor.setData( data );
+			expect( editor.getData() ).to.equal( data );
+		} );
+
+		it( 'block-quote works', () => {
+			const data = '<blockquote><p>Quote</p></blockquote>';
+
+			editor.setData( data );
+			expect( editor.getData() ).to.equal( data );
+		} );
+
+		it( 'heading works', () => {
+			const data = [
+				'<h2>Heading 1.</h2>',
+				'<h3>Heading 1.1</h3>',
+				'<h4>Heading 1.1.1</h4>',
+				'<h4>Heading 1.1.2</h4>',
+				'<h3>Heading 1.2</h3>',
+				'<h4>Heading 1.2.1</h4>',
+				'<h2>Heading 2</h2>'
+			].join( '' );
+
+			editor.setData( data );
+			expect( editor.getData() ).to.equal( data );
+		} );
+
+		it( 'image works', () => {
+			const data = '<figure class="image"><img src="./manual/sample.jpg"></figure>';
+
+			editor.setData( data );
+			expect( editor.getData() ).to.equal( data );
+		} );
+
+		it( 'list works', () => {
+			const data = [
+				'<ul>',
+				'<li>Item 1.</li>',
+				'<li>Item 2.</li>',
+				'</ul>',
+				'<ol>',
+				'<li>Item 1.</li>',
+				'<li>Item 2.</li>',
+				'</ol>'
+			].join( '' );
+
+			editor.setData( data );
+			expect( editor.getData() ).to.equal( data );
+		} );
+
+		it( 'link works', () => {
+			const data = '<p><a href="//ckeditor.com">CKEditor.com</a></p>';
+
+			editor.setData( data );
+			expect( editor.getData() ).to.equal( data );
+		} );
+	} );
+
+	describeMemoryUsage( () => {
+		testMemoryUsage(
+			'should not grow on multiple create/destroy',
+			() => BalloonEditor.create( document.querySelector( '#mem-editor' ) ) );
+	} );
+} );

+ 27 - 0
packages/ckeditor5-build-balloon-block/tests/manual/ckeditor-cjs-version.html

@@ -0,0 +1,27 @@
+<div id="editor">
+	<h2>About CKEditor&nbsp;5</h2>
+
+	<p>This is <a href="https://ckeditor.com">CKEditor&nbsp;5</a>.</p>
+
+	<figure class="image">
+		<img src="./sample.jpg" alt="Autumn fields" />
+	</figure>
+
+	<p>After more than 2 years of building the next generation editor from scratch and closing over 980 tickets, we created a highly <strong>extensible and flexible architecture</strong> which consists of an <strong>amazing editing framework</strong> and <strong>editing solutions</strong> that will be built on top of it.</p>
+
+	<p>We explained this design choice in <a href="https://medium.com/content-uneditable/ckeditor-5-the-future-of-rich-text-editing-2b9300f9df2c">&ldquo;CKEditor 5: The future of rich text editing&ldquo;</a>:</p>
+
+	<blockquote><p>(…) we are changing our approach with CKEditor 5. We will no longer have only two solutions available, instead CKEditor will be seen as a framework for editing solutions. At the same time, we will be developing several out-of-the-box solutions based on it, which will be available to use in many different contexts. It will be a real “one size fits all” approach, from little requirements, to super advanced full featured applications.</p></blockquote>
+
+	<h3>Notes</h3>
+
+	<p><a href="https://ckeditor.com">CKEditor&nbsp;5</a> is <i>under heavy development</i> and this demo is not production-ready software. For example:</p>
+
+	<ul>
+		<li><strong>Only Chrome, Opera and Safari are supported</strong>.</li>
+		<li>Firefox requires enabling the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Document/onselectionchange">&ldquo;dom.select_events.enabled&rdquo;</a> option.</li>
+		<li><a href="https://github.com/ckeditor/ckeditor5/issues/342">Support for pasting</a> is under development (content filtering is unstable).</li>
+	</ul>
+
+	<p>It has <em>bugs</em> that we are aware of &mdash; and that we will be working on in the next few iterations of the project. Stay tuned for some updates soon!</p>
+</div>

+ 17 - 0
packages/ckeditor5-build-balloon-block/tests/manual/ckeditor-cjs-version.js

@@ -0,0 +1,17 @@
+/**
+ * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+/* eslint-env commonjs */
+/* globals window, document, console */
+
+const BalloonEditor = require( '../../build/ckeditor' );
+
+BalloonEditor.create( document.querySelector( '#editor' ) )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 9 - 0
packages/ckeditor5-build-balloon-block/tests/manual/ckeditor-cjs-version.md

@@ -0,0 +1,9 @@
+# CKEditor 5 balloon block editor build – standard version (CommonJS `require()`)
+
+Just play with it.
+
+**Note:** Remember to rebuild the bundles (`npm run build`). You can also run Webpack in the watch mode:
+
+```
+./node_modules/.bin/webpack -w
+```

+ 27 - 0
packages/ckeditor5-build-balloon-block/tests/manual/ckeditor.html

@@ -0,0 +1,27 @@
+<div id="editor">
+	<h2>About CKEditor&nbsp;5</h2>
+
+	<p>This is <a href="https://ckeditor.com">CKEditor&nbsp;5</a>.</p>
+
+	<figure class="image">
+		<img src="./sample.jpg" alt="Autumn fields" />
+	</figure>
+
+	<p>After more than 2 years of building the next generation editor from scratch and closing over 980 tickets, we created a highly <strong>extensible and flexible architecture</strong> which consists of an <strong>amazing editing framework</strong> and <strong>editing solutions</strong> that will be built on top of it.</p>
+
+	<p>We explained this design choice in <a href="https://medium.com/content-uneditable/ckeditor-5-the-future-of-rich-text-editing-2b9300f9df2c">&ldquo;CKEditor 5: The future of rich text editing&ldquo;</a>:</p>
+
+	<blockquote><p>(…) we are changing our approach with CKEditor 5. We will no longer have only two solutions available, instead CKEditor will be seen as a framework for editing solutions. At the same time, we will be developing several out-of-the-box solutions based on it, which will be available to use in many different contexts. It will be a real “one size fits all” approach, from little requirements, to super advanced full featured applications.</p></blockquote>
+
+	<h3>Notes</h3>
+
+	<p><a href="https://ckeditor.com">CKEditor&nbsp;5</a> is <i>under heavy development</i> and this demo is not production-ready software. For example:</p>
+
+	<ul>
+		<li><strong>Only Chrome, Opera and Safari are supported</strong>.</li>
+		<li>Firefox requires enabling the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Document/onselectionchange">&ldquo;dom.select_events.enabled&rdquo;</a> option.</li>
+		<li><a href="https://github.com/ckeditor/ckeditor5/issues/342">Support for pasting</a> is under development (content filtering is unstable).</li>
+	</ul>
+
+	<p>It has <em>bugs</em> that we are aware of &mdash; and that we will be working on in the next few iterations of the project. Stay tuned for some updates soon!</p>
+</div>

+ 16 - 0
packages/ckeditor5-build-balloon-block/tests/manual/ckeditor.js

@@ -0,0 +1,16 @@
+/**
+ * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+/* globals window, document, console */
+
+import BalloonEditor from '../../build/ckeditor';
+
+BalloonEditor.create( document.querySelector( '#editor' ) )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 9 - 0
packages/ckeditor5-build-balloon-block/tests/manual/ckeditor.md

@@ -0,0 +1,9 @@
+# CKEditor 5 balloon block editor build – standard version
+
+Just play with it.
+
+**Note:** Remember to rebuild the bundles (`npm run build`). You can also run Webpack in the watch mode:
+
+```
+./node_modules/.bin/webpack -w
+```

二进制
packages/ckeditor5-build-balloon-block/tests/manual/sample.jpg


+ 9 - 0
packages/ckeditor5-build-balloon-block/theme/theme.css

@@ -0,0 +1,9 @@
+/*
+ * Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+/* Give the block toolbar button some space, moving it a few pixels away from the editable area. */
+.ck.ck-block-toolbar-button {
+	transform: translateX( calc(-1 * var(--ck-spacing-large)) );
+}

+ 87 - 0
packages/ckeditor5-build-balloon-block/webpack.config.js

@@ -0,0 +1,87 @@
+/**
+ * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+'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 UglifyJsWebpackPlugin = require( 'uglifyjs-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: 'BalloonEditor',
+
+		path: path.resolve( __dirname, 'build' ),
+		filename: 'ckeditor.js',
+		libraryTarget: 'umd',
+		libraryExport: 'default'
+	},
+
+	optimization: {
+		minimizer: [
+			new UglifyJsWebpackPlugin( {
+				sourceMap: true,
+				uglifyOptions: {
+					output: {
+						// Preserve CKEditor 5 license comments.
+						comments: /^!/
+					}
+				}
+			} )
+		]
+	},
+
+	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: {
+							singleton: true
+						}
+					},
+					{
+						loader: 'postcss-loader',
+						options: styles.getPostCssConfig( {
+							themeImporter: {
+								themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' )
+							},
+							minify: true
+						} )
+					},
+				]
+			}
+		]
+	}
+};