8
0
Просмотр исходного кода

Merge branch 'master' into t/ckeditor5/2472

Aleksander Nowodzinski 6 лет назад
Родитель
Сommit
0c4af71b16

+ 26 - 8
packages/ckeditor5-heading/docs/_snippets/features/title.html

@@ -1,20 +1,38 @@
 <div id="snippet-title">
 <div id="snippet-title">
-	<h1>Feasibility Study</h1>
-	<h2>Introduction</h2>
-	<p>
-		The Business Development team conducted the study as part of the evaluation process for expanding the Company's product portfolio for the mid-market sector. Using project costs and revenue forecasts as inputs, the team calculated key performance indicators that will enable the Company to make smart business decisions about the direction of current projects.
-	</p>
+	<h1></h1>
+	<p></p>
 </div>
 </div>
 
 
 <h3>Console</h3>
 <h3>Console</h3>
 
 
 <p>You can check the content of the title and body elements below.</p>
 <p>You can check the content of the title and body elements below.</p>
 
 
-<pre><code class="title-console title-console__title">'Feasibility Study'</code></pre>
-<pre><code class="title-console title-console__body">'&lt;h2>Introduction&lt;/h2>&lt;p>The Business Development team conducted the study as part of the evaluation process for expanding the Company's product portfolio for the mid-market sector. Using project costs and revenue forecasts as inputs, the team calculated key performance indicators that will enable the Company to make smart business decisions about the direction of current projects.&lt;/p>'</code></pre>
-<pre><code class="title-console title-console__data">'&lt;h1>Feasibility Study&lt;/h1>&lt;h2>Introduction&lt;/h2>&lt;p>The Business Development team conducted the study as part of the evaluation process for expanding the Company's product portfolio for the mid-market sector. Using project costs and revenue forecasts as inputs, the team calculated key performance indicators that will enable the Company to make smart business decisions about the direction of current projects.&lt;/p>'</code></pre>
+<pre><code class="title-console title-console__title">''</code></pre>
+<pre><code class="title-console title-console__body">'&lt;p>&amp;nbsp;&lt;/p>'</code></pre>
+<pre><code class="title-console title-console__data">''</code></pre>
 
 
 <style>
 <style>
+	.ck.ck-editor__editable_inline {
+		border-color: hsl(0, 0%, 77%);
+	}
+
+	/* Let's move pilcrow icon inside the editor space. */
+	.ck.ck-block-toolbar-button {
+		transform: translateX( 40px );
+	}
+
+	#snippet-title {
+		min-height: 300px;
+		max-width: 450px;
+		padding: 50px;
+		margin: 50px auto 0;
+		box-shadow: 5px 5px 1px 0px hsla( 0, 0%, 0%, 0.1);
+	}
+
+	#snippet-title h1 {
+		padding-top: 0;
+	}
+
 	#title-console {
 	#title-console {
 		max-height: 300px;
 		max-height: 300px;
 		overflow: auto;
 		overflow: auto;

+ 5 - 4
packages/ckeditor5-heading/docs/_snippets/features/title.js

@@ -5,16 +5,17 @@
 
 
 /* globals console, window, document, setTimeout */
 /* globals console, window, document, setTimeout */
 
 
-import ClassicEditor from '@ckeditor/ckeditor5-build-classic/src/ckeditor';
+import BaloonBlockEditor from '@ckeditor/ckeditor5-build-balloon-block/src/ckeditor';
 import Title from '@ckeditor/ckeditor5-heading/src/title';
 import Title from '@ckeditor/ckeditor5-heading/src/title';
 
 
 import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';
 import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';
 
 
-ClassicEditor.builtinPlugins.push( Title );
+BaloonBlockEditor.builtinPlugins.push( Title );
 
 
-ClassicEditor
+BaloonBlockEditor
 	.create( document.querySelector( '#snippet-title' ), {
 	.create( document.querySelector( '#snippet-title' ), {
-		cloudServices: CS_CONFIG
+		cloudServices: CS_CONFIG,
+		blockToolbar: [ 'bulletedList', 'numberedList', 'imageUpload', 'blockQuote', 'insertTable', 'mediaEmbed' ]
 	} )
 	} )
 	.then( editor => {
 	.then( editor => {
 		window.editor = editor;
 		window.editor = editor;

+ 4 - 0
packages/ckeditor5-heading/docs/features/title.md

@@ -7,8 +7,12 @@ menu-title: Document title
 
 
 The {@link module:heading/title~Title} feature enables support for adding the title field to your document. It helps ensure that there will always be a single title field at the beginning of your document.
 The {@link module:heading/title~Title} feature enables support for adding the title field to your document. It helps ensure that there will always be a single title field at the beginning of your document.
 
 
+This feature can be used to implement an editor with a clear division of content into the title and body sections, similar to solutions available in Medium, Grammarly, Slack post editor or some content management systems.
+
 ## Demo
 ## Demo
 
 
+Use the editor below to create a document with clearly separated title and body sections.
+
 {@snippet features/title}
 {@snippet features/title}
 
 
 ## Keyboard navigation
 ## Keyboard navigation

+ 7 - 0
packages/ckeditor5-heading/src/headingediting.js

@@ -23,6 +23,13 @@ const defaultModelElement = 'paragraph';
  * @extends module:core/plugin~Plugin
  * @extends module:core/plugin~Plugin
  */
  */
 export default class HeadingEditing extends Plugin {
 export default class HeadingEditing extends Plugin {
+	/**
+	 * @inheritDoc
+	 */
+	static get pluginName() {
+		return 'HeadingEditing';
+	}
+
 	/**
 	/**
 	 * @inheritDoc
 	 * @inheritDoc
 	 */
 	 */

+ 4 - 0
packages/ckeditor5-heading/tests/headingediting.js

@@ -25,6 +25,10 @@ describe( 'HeadingEditing', () => {
 			} );
 			} );
 	} );
 	} );
 
 
+	it( 'should have pluginName', () => {
+		expect( HeadingEditing.pluginName ).to.equal( 'HeadingEditing' );
+	} );
+
 	it( 'should be loaded', () => {
 	it( 'should be loaded', () => {
 		expect( editor.plugins.get( HeadingEditing ) ).to.be.instanceOf( HeadingEditing );
 		expect( editor.plugins.get( HeadingEditing ) ).to.be.instanceOf( HeadingEditing );
 	} );
 	} );