Skip to content

Commit

Permalink
Merged stable into master.
Browse files Browse the repository at this point in the history
  • Loading branch information
ma2ciek committed Dec 21, 2020
2 parents 513a85f + c13f2cb commit 8d9e06b
Show file tree
Hide file tree
Showing 29 changed files with 509 additions and 83 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ The CKEditor 5 Collaboration features changelog can be found here: https://ckedi
* **[indent](https://www.npmjs.com/package/@ckeditor/ckeditor5-indent)**: The block indent feature will now work with custom headings. Closes [#8177](https://github.com/ckeditor/ckeditor5/issues/8177). ([commit](https://github.com/ckeditor/ckeditor5/commit/23c64f5abc8e3f4ed76a1bc9266aee947f2694ad))
* **[link](https://www.npmjs.com/package/@ckeditor/ckeditor5-link)**: The editor should not crash when inserting a link after another link with the same URL. Closes [#8210](https://github.com/ckeditor/ckeditor5/issues/8210). ([commit](https://github.com/ckeditor/ckeditor5/commit/81b8dc6cefb6311cdcae6dc4b19971905e3768c6))
* **[link](https://www.npmjs.com/package/@ckeditor/ckeditor5-link)**: Fixed the unlink command for a selection spreading over 3+ blocks. Closes [#8030](https://github.com/ckeditor/ckeditor5/issues/8030). ([commit](https://github.com/ckeditor/ckeditor5/commit/3d86dadc4db52fde9a7e80c130f1fc67e49c73b2))
* **[link](https://www.npmjs.com/package/@ckeditor/ckeditor5-link)**: Fixed a quick image flicker of the image resize frame when inserting an image. Closes [#8088](https://github.com/ckeditor/ckeditor5/issues/8088). ([commit](https://github.com/ckeditor/ckeditor5/commit/021227d3ccce8b3ed7114bbb22e99f67bd3fa66e))
* **[image](https://www.npmjs.com/package/@ckeditor/ckeditor5-link)**: Fixed a quick image flicker of the image resize frame when inserting an image. Closes [#8088](https://github.com/ckeditor/ckeditor5/issues/8088). ([commit](https://github.com/ckeditor/ckeditor5/commit/021227d3ccce8b3ed7114bbb22e99f67bd3fa66e))
* **[list](https://www.npmjs.com/package/@ckeditor/ckeditor5-list)**: List styles will be inherited correctly when pasting a list into another list. Closes [#8160](https://github.com/ckeditor/ckeditor5/issues/8160). ([commit](https://github.com/ckeditor/ckeditor5/commit/5dd14a38a4c403e312681cc129deac78cf325629))
* **[paste-from-office](https://www.npmjs.com/package/@ckeditor/ckeditor5-paste-from-office)**: Improved the mechanism that detects nested lists when pasting from Word. In some scenarios, pasting nested lists could produce invalid results in the editor. Closes [#7805](https://github.com/ckeditor/ckeditor5/issues/7805). ([commit](https://github.com/ckeditor/ckeditor5/commit/be5b989419930b3a45349494d7a1874801bf1dd4))
* **[theme-lark](https://www.npmjs.com/package/@ckeditor/ckeditor5-theme-lark)**: The HTML embed editing UI should not be broken when the editor uses an RTL language (see [#8335](https://github.com/ckeditor/ckeditor5/issues/8335)). ([commit](https://github.com/ckeditor/ckeditor5/commit/1ac756a9829055f9508ae07932d5d12cd672851f))
Expand Down
Empty file.
44 changes: 44 additions & 0 deletions docs/_snippets/features/build-toolbar-source.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

/* globals window */

import ClassicEditor from '@ckeditor/ckeditor5-build-classic/src/ckeditor';

import Alignment from '@ckeditor/ckeditor5-alignment/src/alignment';
import Strikethrough from '@ckeditor/ckeditor5-basic-styles/src/strikethrough';
import Subscript from '@ckeditor/ckeditor5-basic-styles/src/subscript';
import Superscript from '@ckeditor/ckeditor5-basic-styles/src/superscript';
import Underline from '@ckeditor/ckeditor5-basic-styles/src/underline';
import TableProperties from '@ckeditor/ckeditor5-table/src/tableproperties';
import TableCellProperties from '@ckeditor/ckeditor5-table/src/tablecellproperties';
import FontSize from '@ckeditor/ckeditor5-font/src/fontsize';
import FontFamily from '@ckeditor/ckeditor5-font/src/fontfamily';
import FontColor from '@ckeditor/ckeditor5-font/src/fontcolor';
import FontBackgroundColor from '@ckeditor/ckeditor5-font/src/fontbackgroundcolor';
import CodeBlock from '@ckeditor/ckeditor5-code-block/src/codeblock';
import Code from '@ckeditor/ckeditor5-basic-styles/src/code';
import IndentBlock from '@ckeditor/ckeditor5-indent/src/indentblock';
import Indent from '@ckeditor/ckeditor5-indent/src/indent';
import TodoList from '@ckeditor/ckeditor5-list/src/todolist';

ClassicEditor.builtinPlugins.push( Alignment );
ClassicEditor.builtinPlugins.push( Strikethrough );
ClassicEditor.builtinPlugins.push( Subscript );
ClassicEditor.builtinPlugins.push( Superscript );
ClassicEditor.builtinPlugins.push( Underline );
ClassicEditor.builtinPlugins.push( TableProperties );
ClassicEditor.builtinPlugins.push( TableCellProperties );
ClassicEditor.builtinPlugins.push( FontSize );
ClassicEditor.builtinPlugins.push( FontFamily );
ClassicEditor.builtinPlugins.push( FontColor );
ClassicEditor.builtinPlugins.push( FontBackgroundColor );
ClassicEditor.builtinPlugins.push( CodeBlock );
ClassicEditor.builtinPlugins.push( IndentBlock );
ClassicEditor.builtinPlugins.push( Indent );
ClassicEditor.builtinPlugins.push( Code );
ClassicEditor.builtinPlugins.push( TodoList );

window.ClassicEditor = ClassicEditor;
7 changes: 7 additions & 0 deletions docs/_snippets/features/toolbar-basic.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div id="toolbar-basic">

<p>
The <a href="https://en.wikipedia.org/wiki/Mars">Red Planet</a> is a target that has been aimed at for decades. Both Soviet (later Russian) and American designers looked at the sky and planned. Valeri Polyakov spent almost <strong>438 days</strong> during a single long-term mission onboard the <i>Mir</i> space station to test the ability of humans to thrive in space for long periods of time. It was twenty years ago. The experiments he carried out, the research and all scientific data are still patiently waiting. They are evaluated, researched, re-read again and again, as people near the day they will launch a manned spacecraft toward Mars, the Moon, or the cislunar orbit.
</p>

</div>
22 changes: 22 additions & 0 deletions docs/_snippets/features/toolbar-basic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

/* globals ClassicEditor, console, window, document */

import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';

ClassicEditor
.create( document.querySelector( '#toolbar-basic' ), {
toolbar: {
items: [ 'bold', 'italic', 'link', 'undo', 'redo', 'numberedList', 'bulletedList' ]
},
cloudServices: CS_CONFIG
} )
.then( editor => {
window.editor = editor;
} )
.catch( err => {
console.error( err.stack );
} );
8 changes: 8 additions & 0 deletions docs/_snippets/features/toolbar-breakpoint.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div id="toolbar-breakpoint">

<h2>The nice Canadian</h2>
<p>Remember Chris Hadfield? Of course, everyone has seen &ldquo;Space Oddity&rdquo; played and sung onboard the <em>ISS</em>. But have you seen the videos he recorded for schools? Short pieces on living in space, brushing your teeth in space, and sleeping in zero gravity? Kids love them. Teachers love them. Schools use them. This is a gift, a thank you gesture, a hand extended back. This humble man made his dream come true, he flew to the stars. But not even once did he forget the people that put him there &ndash; the engineers, designers, scientists.&nbsp;Those before him that went into space and those who gave their life to make this dream possible.</p>

<p>Now he helps bring up a new generation that will build better, safer, faster spaceships. That will once more reach the surface of the Moon, will leave the Earth orbit and fly to Mars, to Venus. Those are years to come and the goals will take a lot of patience. But what he does is gold. He is honest, humble, and true in what he did up there and the generation that came can see that, share in his activities and grab that passion.</p>

</div>
63 changes: 63 additions & 0 deletions docs/_snippets/features/toolbar-breakpoint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/**
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

/* globals ClassicEditor, console, window, document */

import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';

ClassicEditor
.create( document.querySelector( '#toolbar-breakpoint' ), {
toolbar: {
items: [
'heading', '|',
'alignment', '|',
'bold', 'italic', 'strikethrough', 'underline', 'subscript', 'superscript', '|',
'link', '|',
'bulletedList', 'numberedList', 'todoList', '-',
'fontfamily', 'fontsize', 'fontColor', 'fontBackgroundColor', '|',
'code', 'codeBlock', '|',
'insertTable', '|',
'outdent', 'indent', '|',
'imageUpload', 'blockQuote', '|',
'undo', 'redo'
],
shouldNotGroupWhenFull: true,
viewportTopOffset: window.getViewportTopOffsetConfig()
},
image: {
toolbar: [ 'imageStyle:full', 'imageStyle:side', '|', 'imageTextAlternative' ]
},
codeBlock: {
languages: [
{ language: 'css', label: 'CSS' },
{ language: 'html', label: 'HTML' },
{ language: 'javascript', label: 'JavaScript' },
{ language: 'php', label: 'PHP' }
]
},
fontFamily: {
supportAllValues: true
},
fontSize: {
options: [ 9, 10, 11, 12, 'default', 14, 15 ],
supportAllValues: true
},
heading: {
options: [
{ model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
{ model: 'heading1', view: 'h2', title: 'Heading 1', class: 'ck-heading_heading1' },
{ model: 'heading2', view: 'h3', title: 'Heading 2', class: 'ck-heading_heading2' },
{ model: 'heading3', view: 'h4', title: 'Heading 3', class: 'ck-heading_heading3' },
{ model: 'heading4', view: 'h5', title: 'Heading 4', class: 'ck-heading_heading4' }
]
},
cloudServices: CS_CONFIG
} )
.then( editor => {
window.editor = editor;
} )
.catch( err => {
console.error( err.stack );
} );
9 changes: 9 additions & 0 deletions docs/_snippets/features/toolbar-grouping.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div id="toolbar-grouping">

<h2>The space race</h2>

<p>It is no longer a secret &mdash; though it was for a long time &mdash; that the Soviet Union raced the United States to the Moon and only aknowledging the failure did they focus all their brilliant minds and hard work on the orbital station program known widely as Salyut. The reason for their lunar failure &mdash; we learned that only in the late 1990&rsquo;s after the fall of USSR &mdash; was the lack of a proper plan. And, as some sources suggest, the absence of a real need to achieve that goal. It was the US president&rsquo;s challenge, cast in front of an audience, that the Americans will put a man on the face of Luna before the end of the decade. The Soviets, who have so far been winning in everything concerning the space race, felt obliged to accept the challenge.</p>

<p>So what made the Soviets fail? Why did the <em>N1</em> monster rocket never leave low earth orbit and why did the <em>Lunniy Korabl</em> never reach the surface of our natural satellite? I believe it was because the Soviets never planned to go there in the first place. The greatest minds of that nation were involved, but the undertaking had no heart. And no real favors on the part of the Communist Party. No passion, no fire, no feeling to take that Soviet Man, grab him with the mighty hand formed from the collective effort of the workers and scientists, and cast him into orbit like a gauntlet cast in the face of the American opponent. And most of all &mdash; no time. They were so behind their counterparts from the USA that they just could not make up the lost time.</p>

</div>
59 changes: 59 additions & 0 deletions docs/_snippets/features/toolbar-grouping.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/**
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

/* globals ClassicEditor, console, window, document */

import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';

ClassicEditor
.create( document.querySelector( '#toolbar-grouping' ), {
toolbar: {
items: [
'heading', '|',
'fontfamily', 'fontsize', 'fontColor', 'fontBackgroundColor', '|',
'bold', 'italic', 'strikethrough', 'subscript', 'superscript', 'link', '|',
'bulletedList', 'numberedList', 'todoList', '|',
'code', 'codeBlock', '|',
'outdent', 'indent', '|',
'imageUpload', 'blockQuote', '|',
'undo', 'redo'
],
viewportTopOffset: window.getViewportTopOffsetConfig()
},
image: {
toolbar: [ 'imageStyle:full', 'imageStyle:side', '|', 'imageTextAlternative' ]
},
codeBlock: {
languages: [
{ language: 'css', label: 'CSS' },
{ language: 'html', label: 'HTML' },
{ language: 'javascript', label: 'JavaScript' },
{ language: 'php', label: 'PHP' }
]
},
fontFamily: {
supportAllValues: true
},
fontSize: {
options: [ 9, 10, 11, 12, 'default', 14, 15 ],
supportAllValues: true
},
heading: {
options: [
{ model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
{ model: 'heading1', view: 'h2', title: 'Heading 1', class: 'ck-heading_heading1' },
{ model: 'heading2', view: 'h3', title: 'Heading 2', class: 'ck-heading_heading2' },
{ model: 'heading3', view: 'h4', title: 'Heading 3', class: 'ck-heading_heading3' },
{ model: 'heading4', view: 'h5', title: 'Heading 4', class: 'ck-heading_heading4' }
]
},
cloudServices: CS_CONFIG
} )
.then( editor => {
window.editor = editor;
} )
.catch( err => {
console.error( err.stack );
} );
7 changes: 7 additions & 0 deletions docs/_snippets/features/toolbar-separator.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div id="toolbar-separator">

<p>
The Soviets have been winning in everything concerning the space race up until the American <strong>Moon landing</strong> in 1969. They beat the Americans with the <strong>first manned spaceflight</strong>, the <strong>first woman in space</strong> (and for almost twenty more years the only one), the <strong>first multicraft flight</strong>, and finally &mdash; the <strong>first group flight</strong>. They left Americans on the scorched ground, even if sometimes just by weeks or even days. And in the course of racing the hideous imperialist capitalist to the Silver Globe they achieved one more outstanding success &mdash; the <strong>first orbital docking</strong> between two manned spaceships and a successful <strong>orbital crew transfer</strong> which let to the launch of <strong>world&#39;s first-ever orbital station</strong> <em>Salyut 1</em> and taking back the lead in 1971.
</p>

</div>
22 changes: 22 additions & 0 deletions docs/_snippets/features/toolbar-separator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

/* globals ClassicEditor, console, window, document */

import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';

ClassicEditor
.create( document.querySelector( '#toolbar-separator' ), {
toolbar: {
items: [ 'bold', 'italic', '|', 'undo', 'redo', '|', 'numberedList', 'bulletedList' ]
},
cloudServices: CS_CONFIG
} )
.then( editor => {
window.editor = editor;
} )
.catch( err => {
console.error( err.stack );
} );
8 changes: 8 additions & 0 deletions docs/_snippets/features/toolbar-wrapping.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div id="toolbar-wrapping">

<h2>The space stations</h2>
<p>The Soviet <em>Salyut</em> space station line was, in fact, two different programs. One was a military <em>Almaz</em> programme with <em>OPS</em> station design, and the other was civilian <em>Salyut</em> with their <em>DOS</em> design. The <em>DOS</em> was, in fact, the hull of an <em>OPS</em> outfitted with additional hardware. The original <em>OPS</em> was designed in the mid-1960&rsquo;s by the <em>OKB-52</em> secret facility lead by Chelomei. As they struggled with funding and fell behind schedule, the original design was &ldquo;borrowed&rdquo; by engineers from <em>OKB-1</em>, lead by Korolev.</p>

<p>His people used Chelomei&rsquo;s main hull and outfitted it with the engines, solar panels, and docking and transfer systems from their own space craft, <em>Soyuz</em> (which was, primarily, developed to fly to the Moon; once it never did, it flew to low Earth orbit in 1967 and still does so, ferrying astronauts and cosmonauts to the <em>ISS</em> in 2021!). Korolev&rsquo;s people used somebody else&rsquo;s experience, but did their own work, and in 1971 for the first time in history they put a space base in orbit. And manned it. And it was a success.</p>

</div>
67 changes: 67 additions & 0 deletions docs/_snippets/features/toolbar-wrapping.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/**
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

/* globals ClassicEditor, console, window, document */

import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';

ClassicEditor
.create( document.querySelector( '#toolbar-wrapping' ), {
toolbar: {
items: [
'heading', '|',
'fontfamily', 'fontsize', '|',
'alignment', '|',
'fontColor', 'fontBackgroundColor', '|',
'bold', 'italic', 'strikethrough', 'underline', 'subscript', 'superscript', '|',
'link', '|',
'outdent', 'indent', '|',
'bulletedList', 'numberedList', 'todoList', '|',
'code', 'codeBlock', '|',
'insertTable', '|',
'imageUpload', 'blockQuote', '|',
'undo', 'redo'
],
shouldNotGroupWhenFull: true,
viewportTopOffset: window.getViewportTopOffsetConfig()
},
image: {
toolbar: [ 'imageStyle:full', 'imageStyle:side', '|', 'imageTextAlternative' ]
},
codeBlock: {
languages: [
{ language: 'css', label: 'CSS' },
{ language: 'html', label: 'HTML' },
{ language: 'javascript', label: 'JavaScript' },
{ language: 'php', label: 'PHP' }
]
},
fontFamily: {
supportAllValues: true
},
fontSize: {
options: [ 9, 10, 11, 12, 'default', 14, 15 ],
supportAllValues: true
},
heading: {
options: [
{ model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
{ model: 'heading1', view: 'h2', title: 'Heading 1', class: 'ck-heading_heading1' },
{ model: 'heading2', view: 'h3', title: 'Heading 2', class: 'ck-heading_heading2' },
{ model: 'heading3', view: 'h4', title: 'Heading 3', class: 'ck-heading_heading3' },
{ model: 'heading4', view: 'h5', title: 'Heading 4', class: 'ck-heading_heading4' }
]
},
table: {
contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells', 'tableProperties', 'tableCellProperties' ]
},
cloudServices: CS_CONFIG
} )
.then( editor => {
window.editor = editor;
} )
.catch( err => {
console.error( err.stack );
} );
15 changes: 15 additions & 0 deletions docs/builds/guides/frameworks/angular.md
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,21 @@ export class MyComponent {

For advanced usage see the {@link features/ui-language Setting the UI language} guide.

## Common issues

### zone.js

There is a repeatable issue with zone.js library when upgrading to new Angular versions. The ngOnDestroy handler crashes throwing:
```
ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'data-ck-expando' of undefined
TypeError: Cannot read property 'data-ck-expando' of undefined
```

Workaround: in `polyfills.js` import zone.js using `import zone.js/dist/zone.js` instead of `import 'zone.js'`.
More details:
- https://github.com/ckeditor/ckeditor5-angular/issues/109
- https://github.com/angular/angular/tree/master/packages/zone.js#breaking-changes-since-zonejs-v0111

## Contributing and reporting issues

The source code of the CKEditor 5 rich text editor component for Angular is available on GitHub in https://github.com/ckeditor/ckeditor5-angular.
Loading

0 comments on commit 8d9e06b

Please sign in to comment.