Ver código fonte

Added first two presets.

Piotrek Koszuliński 8 anos atrás
pai
commit
4ab1911deb

+ 14 - 1
packages/ckeditor5-essentials/package.json

@@ -4,9 +4,22 @@
   "description": "The presets of plugins for CKEditor 5.",
   "keywords": [],
   "dependencies": {
+    "@ckeditor/ckeditor5-autoformat": "*",
+    "@ckeditor/ckeditor5-basic-styles": "*",
+    "@ckeditor/ckeditor5-clipboard": "*",
+    "@ckeditor/ckeditor5-core": "*",
+    "@ckeditor/ckeditor5-engine": "*",
+    "@ckeditor/ckeditor5-enter": "*",
+    "@ckeditor/ckeditor5-heading": "*",
+    "@ckeditor/ckeditor5-image": "*",
+    "@ckeditor/ckeditor5-link": "*",
+    "@ckeditor/ckeditor5-list": "*",
+    "@ckeditor/ckeditor5-paragraph": "*",
+    "@ckeditor/ckeditor5-typing": "*",
+    "@ckeditor/ckeditor5-undo": "*"
   },
   "devDependencies": {
-    "@ckeditor/ckeditor5-dev-lint": "^2.0.0",
+    "@ckeditor/ckeditor5-dev-lint": "^2.0.2",
     "gulp": "^3.9.0",
     "guppy-pre-commit": "^0.4.0"
   },

+ 34 - 0
packages/ckeditor5-essentials/src/article.js

@@ -0,0 +1,34 @@
+/**
+ * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+/**
+ * @module presets/article
+ */
+
+import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
+
+import TextboxPreset from './textbox';
+
+import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
+import Heading from '@ckeditor/ckeditor5-heading/src/heading';
+import Image from '@ckeditor/ckeditor5-image/src/image';
+import ImageStyle from '@ckeditor/ckeditor5-image/src/imagestyle';
+import ImageToolbar from '@ckeditor/ckeditor5-image/src/imagetoolbar';
+import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
+import Link from '@ckeditor/ckeditor5-link/src/link';
+import List from '@ckeditor/ckeditor5-list/src/list';
+
+/**
+ * Article editor preset. Represents a set of features which enable in the editor
+ * all functionalities of a simple article editor.
+ * This preset follows [Editor Recommendations](https://github.com/ckeditor/editor-recommendations).
+ *
+ * @extends module:core/plugin~Plugin
+ */
+export default class Article extends Plugin {
+	static get requires() {
+		return [ TextboxPreset, Bold, Heading, Image, ImageStyle, ImageToolbar, Italic, Link, List ];
+	}
+}

+ 28 - 0
packages/ckeditor5-essentials/src/textbox.js

@@ -0,0 +1,28 @@
+/**
+ * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+/**
+ * @module presets/textbox
+ */
+
+import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
+
+import Clipboard from '@ckeditor/ckeditor5-clipboard/src/clipboard';
+import Enter from '@ckeditor/ckeditor5-enter/src/enter';
+import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
+import Typing from '@ckeditor/ckeditor5-typing/src/typing';
+import Undo from '@ckeditor/ckeditor5-undo/src/undo';
+
+/**
+ * Textbox preset. Represents a set of features which enable in the editor
+ * similar functionalities to a `<textarea>`.
+ *
+ * @extends module:core/plugin~Plugin
+ */
+export default class Textbox extends Plugin {
+	static get requires() {
+		return [ Clipboard, Enter, Paragraph, Typing, Undo ];
+	}
+}