Browse Source

Merge branch 'stable'

Piotrek Koszuliński 7 years ago
parent
commit
28ce11ed68

+ 6 - 1
docs/_snippets/examples/document-editor.html

@@ -45,7 +45,7 @@
 
 	.document-editor__editable .ck-editor__editable {
 		/* Set the dimensions of the "page". */
-		width: 15.8cm;
+		width: 15cm;
 		min-height: 21cm;
 
 		/* Keep the "page" off the boundaries of the container. */
@@ -62,6 +62,11 @@
 		margin: 0 auto;
 	}
 
+	/* Override the page's width in the "Examples" section which is wider. */
+	.main__content-wide .document-editor__editable .ck-editor__editable {
+		width: 18cm;
+	}
+
 	/* Set the default font for the "page" of the content. */
 	.document-editor .ck-content,
 	.document-editor .ck-heading-dropdown .ck-list {

+ 21 - 0
docs/assets/styles.css

@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
+ */
+
+/* https://github.com/ckeditor/ckeditor5/issues/913 */
+@media only screen and (min-width: 1600px) {
+	.main .main__content-wide .main__content-inner {
+		width: 800px;
+	}
+}
+
+/* https://github.com/ckeditor/ckeditor5/issues/913 */
+@media only screen and (min-width: 1360px) {
+	.main .main__content.main__content-wide {
+		padding-right: 0;
+	}
+
+	.main .main__content-wide .main__content-inner {
+		max-width: 800px;
+	}
+}

+ 2 - 0
docs/examples/builds/document-editor.md

@@ -1,6 +1,7 @@
 ---
 category: examples-builds
 order: 30
+classes: main__content-wide
 ---
 
 # Document editor
@@ -10,3 +11,4 @@ The editor in this example is a feature–rich build focused on rich text editin
 See the {@link framework/guides/document-editor tutorial} to learn how to create this kind of an editor (and similar) with a custom UI layout on top of {@link module:editor-decoupled/decouplededitor~DecoupledEditor}.
 
 {@snippet examples/document-editor}
+

+ 25 - 1
docs/framework/guides/architecture/editing-engine.md

@@ -141,7 +141,31 @@ This makes them ideal for storing and maintaining additional data in the model 
 
 ### Schema
 
-TODO
+The {@link module:engine/model/schema~Schema model's schema} defines several aspects of how the model should look:
+
+* where a node is allowed or disallowed (e.g. `paragraph` is allowed in `$root`, but not in `heading1`),
+* what attributes are allowed on a certain node (e.g. `image` can have `src` and `alt` attributes),
+* additional semantics of model nodes (e.g. `image` is of the "object" type and paragraph of the "block" type).
+
+This information is then used by features and the engine to make decisions how to process the model. For instance, the information from the schema will affect:
+
+* what happens with a pasted content - what is filtered out (note: in case of pasting the other important mechanism is the conversion – HTML elements and attributes which are not upcasted by any of the registered converters are filtered out before they even become model nodes, so the schema is not applied to them; we'll cover conversion later in this guide),
+* to which elements the heading feature can be applied (which blocks can be turned to headings and which elements are blocks in the first place),
+* which elements can be wrapped with a block quote,
+* whether the bold button is enabled when the selection is in a heading (and whether text in this heading can be bolded),
+* where the selection can be placed (which is – only in text nodes and on object elements),
+* etc.
+
+The schema is, by default, configured by editor plugins. It is recommended that every editor feature come with rules which enable and preconfigure it in the editor. This will make sure that the plugin's user can enable it without worrying to re-configure her/his schema.
+
+<info-box>
+	Currently, there is [no straightforward way to override the schema](https://github.com/ckeditor/ckeditor5-engine/issues/1367) preconfigured by features. If you want to override the default settings when initializing the editor, the best solution is to replace `editor.model.schema` with a new instance of. This, however, requires rebuilding the editor.
+</info-box>
+
+The instance of the schema is available in {@link module:engine/model/model~Model#schema `editor.model.schema`}. Read an extensive guide about using the schema API in {@link module:engine/model/schema~Schema API docs for the `Schema` class}.
+
+
+
 
 ## View
 

+ 1 - 0
docs/umberto.json

@@ -2,6 +2,7 @@
 	"name": "CKEditor 5",
 	"slug": "ckeditor5",
 	"hexo-config": "docs/hexo-custom-config.json",
+	"extraStyles": "assets/styles.css",
 	"path": "docs",
 	"observablesdocs": "module:utils/observablemixin~ObservableMixin",
 	"scripts": {

+ 1 - 1
package.json

@@ -68,7 +68,7 @@
     "postcss-loader": "^2.0.10",
     "raw-loader": "^0.5.1",
     "style-loader": "^0.19.1",
-    "umberto": "^0.3.48",
+    "umberto": "^0.4.0",
     "webpack": "^3.10.0",
     "webpack-sources": "1.0.1"
   },