Skip to content

Commit 120588f

Browse files
authored
Merge stable into master
2 parents a404e3f + ace9af1 commit 120588f

File tree

4 files changed

+87
-81
lines changed

4 files changed

+87
-81
lines changed

docs/tutorials/abbreviation-plugin-tutorial/abbreviation-plugin-level-1.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,12 @@ import { ClassicEditor, Essentials, Bold, Italic, Paragraph } from 'ckeditor5';
426426
const { ClassicEditor, Essentials, Bold, Italic, Paragraph } = CKEDITOR;
427427
```
428428

429+
<info-box type="warning">
430+
**Using the editor from CDN requires a commercial license**
431+
432+
The CDN build is not licensed under the GPL. Therefore, you need to use a commercial license key. Otherwise, you will get a `license-key-invalid-distribution-channel` error.
433+
</info-box>
434+
429435
After following these steps and running the `npm run dev` command, you should be able to open the editor in browser.
430436

431437
<info-box>

docs/tutorials/abbreviation-plugin-tutorial/abbreviation-plugin-level-2.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export default class FormView extends View {
101101

102102
Now, we add the <kbd>Submit</kbd> and <kbd>Cancel</kbd> buttons to our form. You can start by importing `ButtonView` from our UI library together with the icons, which we will use for labels.
103103

104-
We will use the `check` and `cancel` icons from the core package's [icons library](https://github.com/ckeditor/ckeditor5/tree/master/packages/ckeditor5-core/theme/icons). After importing the icons, we will use them for creating the buttons.
104+
We will use the `check` and `cancel` icons from the core package's [icons library](https://github.com/ckeditor/ckeditor5/tree/master/packages/ckeditor5-icons). After importing the icons, we will use them for creating the buttons.
105105

106106
Let's write a `_createButton` function, which will take three arguments &ndash; `label`, `icon` and `className`. We then set the button attributes, using the properties we passed into the function before, and adding a tooltip option.
107107

@@ -271,8 +271,8 @@ import {
271271
LabeledFieldView,
272272
createLabeledInputText,
273273
ButtonView,
274-
icons,
275-
submitHandler // ADDED
274+
IconCheck,
275+
submitHandler, // ADDED
276276
} from 'ckeditor5';
277277

278278
export default class FormView extends View {

docs/tutorials/abbreviation-plugin-tutorial/abbreviation-plugin-level-3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import {
5050
createLabeledInputText,
5151
ButtonView,
5252
submitHandler,
53-
icons,
53+
IconCheck,
5454
FocusTracker, // ADDED
5555
KeystrokeHandler, // ADDED
5656
} from 'ckeditor5';

tests/manual/abbreviation-level-2.md

Lines changed: 77 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -62,26 +62,26 @@ We will use {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView `Lab
6262
// abbreviation/abbreviationview.js
6363

6464
import {
65-
View,
66-
LabeledFieldView, // ADDED
67-
createLabeledInputText // ADDED
68-
} from '@ckeditor/ckeditor5-ui';
65+
View,
66+
LabeledFieldView, // ADDED
67+
createLabeledInputText // ADDED
68+
} from '@ckeditor/ckeditor5-ui';
6969

7070
export default class FormView extends View {
7171
constructor( locale ) {
72-
// ...
72+
// ...
7373

74-
this.abbrInputView = this._createInput( t( 'Add abbreviation' ) );
74+
this.abbrInputView = this._createInput( t( 'Add abbreviation' ) );
7575
this.titleInputView = this._createInput( t( 'Add title' ) );
7676
}
7777

78-
_createInput( label ) {
79-
const labeledInput = new LabeledFieldView( this.locale, createLabeledInputText );
78+
_createInput( label ) {
79+
const labeledInput = new LabeledFieldView( this.locale, createLabeledInputText );
8080

81-
labeledInput.label = label;
81+
labeledInput.label = label;
8282

83-
return labeledInput;
84-
}
83+
return labeledInput;
84+
}
8585
}
8686
```
8787

@@ -99,41 +99,39 @@ Last thing is to delegate `cancelButtonView#execute` to the FormView, so pressin
9999
// abbreviation/abbreviationview.js
100100

101101
import {
102-
View,
103-
LabeledFieldView,
104-
createLabeledInputText,
105-
ButtonView // ADDED
106-
} from '@ckeditor/ckeditor5-ui';
107-
import {
108-
IconCheck,
109-
IconCancel
110-
} from '@ckeditor/ckeditor5-icons'; // ADDED
102+
IconCheck,
103+
IconCancel,
104+
View,
105+
LabeledFieldView,
106+
createLabeledInputText,
107+
ButtonView // ADDED
108+
} from 'ckeditor5';
111109

112110
export default class FormView extends View {
113111
constructor( locale ) {
114-
// ...
112+
// ...
115113

116-
// Create the save and cancel buttons.
117-
this.saveButtonView = this._createButton(
118-
t( 'Save' ), IconCheck, 'ck-button-save'
119-
);
114+
// Create the save and cancel buttons.
115+
this.saveButtonView = this._createButton(
116+
t( 'Save' ), IconCheck, 'ck-button-save'
117+
);
120118
// Set the type to 'submit', which will trigger
121119
// the submit event on entire form when clicked.
122120
this.saveButtonView.type = 'submit';
123121

124122
this.cancelButtonView = this._createButton(
125-
t( 'Cancel' ), IconCancel, 'ck-button-cancel'
126-
);
123+
t( 'Cancel' ), IconCancel, 'ck-button-cancel'
124+
);
127125
// Delegate ButtonView#execute to FormView#cancel.
128126
this.cancelButtonView.delegate( 'execute' ).to( this, 'cancel' );
129127

130128
}
131129

132-
_createInput( label ) {
133-
// ...
134-
}
130+
_createInput( label ) {
131+
// ...
132+
}
135133

136-
_createButton( label, icon, className ) {
134+
_createButton( label, icon, className ) {
137135
const button = new ButtonView( this.locale );
138136

139137
button.set( {
@@ -211,20 +209,19 @@ We also need a `focus()` method, which will focus on the first child, so our `ab
211209
// abbreviation/abbreviationview.js
212210

213211
import {
214-
View,
215-
LabeledFieldView,
216-
createLabeledInputText,
217-
ButtonView,
218-
submitHandler // ADDED
219-
} from '@ckeditor/ckeditor5-ui';
220-
import { icons } from '@ckeditor/ckeditor5-core';
212+
View,
213+
LabeledFieldView,
214+
createLabeledInputText,
215+
ButtonView,
216+
submitHandler // ADDED
217+
} from 'ckeditor5';
221218

222219
export default class FormView extends View {
223220
constructor( locale ) {
224221

225-
// ...
222+
// ...
226223

227-
this.childViews = this.createCollection( [
224+
this.childViews = this.createCollection( [
228225
this.abbrInputView,
229226
this.titleInputView,
230227
this.saveButtonView,
@@ -234,33 +231,33 @@ export default class FormView extends View {
234231
this.setTemplate( {
235232
tag: 'form',
236233
attributes: {
237-
// ...
234+
// ...
238235
},
239236
children: this.childViews // ADDED
240237
} );
241238
}
242239

243-
render() {
244-
super.render();
240+
render() {
241+
super.render();
245242

246243
// Submit the form when the user clicked the save button
247244
// or pressed enter in the input.
248-
submitHandler( {
249-
view: this
250-
} );
251-
}
252-
253-
focus() {
254-
this.childViews.first.focus();
255-
}
256-
257-
_createInput( label ) {
258-
// ...
259-
}
260-
261-
_createButton( label, icon, className ) {
262-
// ...
263-
}
245+
submitHandler( {
246+
view: this
247+
} );
248+
}
249+
250+
focus() {
251+
this.childViews.first.focus();
252+
}
253+
254+
_createInput( label ) {
255+
// ...
256+
}
257+
258+
_createButton( label, icon, className ) {
259+
// ...
260+
}
264261
}
265262
```
266263

@@ -275,8 +272,7 @@ This is where we ended up with our UI in the first part of the tutorial.
275272
```js
276273
// abbreviation/abbreviationui.js
277274

278-
import { Plugin } from 'ckeditor5';
279-
import { ButtonView } from '@ckeditor/ckeditor5-ui';
275+
import { Plugin, ButtonView } from 'ckeditor5';
280276

281277
class AbbreviationUI extends Plugin {
282278
init() {
@@ -319,25 +315,29 @@ Finally, let's add our balloon and form view to the `init()` method.
319315
```js
320316
// abbreviation/abbreviationui.js
321317

322-
import { Plugin } from 'ckeditor5';
323-
import { ButtonView, ContextualBalloon } from '@ckeditor/ckeditor5-ui'; // ADDED
324-
import FormView from './abbreviationview'; // ADDED
318+
import {
319+
Plugin,
320+
ButtonView, // ADDED
321+
ContextualBalloon // ADDED
322+
} from 'ckeditor5';
323+
324+
import FormView from './abbreviationview'; // ADDED
325325

326326
class AbbreviationUI extends Plugin {
327327
static get requires() {
328328
return [ ContextualBalloon ];
329329
}
330330

331331
init() {
332-
const editor = this.editor;
332+
const editor = this.editor;
333333
const { t } = editor.locale;
334334

335-
// Create the balloon and the form view.
335+
// Create the balloon and the form view.
336336
this._balloon = this.editor.plugins.get( ContextualBalloon );
337337
this.formView = this._createFormView();
338338

339339
editor.ui.componentFactory.add( 'abbreviation', locale => {
340-
// ...
340+
// ...
341341
} );
342342
}
343343

@@ -353,7 +353,7 @@ class AbbreviationUI extends Plugin {
353353
const viewDocument = view.document;
354354
let target = null;
355355

356-
// Set a target position by converting view selection range to DOM
356+
// Set a target position by converting view selection range to DOM
357357
target = () => view.domConverter.viewRangeToDom(
358358
viewDocument.selection.getFirstRange()
359359
);
@@ -419,7 +419,7 @@ class AbbreviationUI extends Plugin {
419419
}
420420

421421
init() {
422-
// ...
422+
// ...
423423
}
424424

425425
_createFormView() {
@@ -442,7 +442,7 @@ class AbbreviationUI extends Plugin {
442442
}
443443

444444
_getBalloonPositionData() {
445-
// ...
445+
// ...
446446
}
447447

448448
_showUI() {
@@ -467,25 +467,25 @@ Additionally, we will import {@link module:ui/bindings/clickoutsidehandler~click
467467
// abbreviation/abbreviationui.js
468468

469469
// ...
470-
import { ContextualBalloon, clickOutsideHandler } from '@ckeditor/ckeditor5-ui'; // ADDED
470+
import { ContextualBalloon, clickOutsideHandler } from 'ckeditor5'; // ADDED
471471

472472
class AbbreviationUI extends Plugin {
473473
static get requires() {
474474
return [ ContextualBalloon ];
475475
}
476476

477477
init() {
478-
// ...
478+
// ...
479479
}
480480

481481
_createFormView() {
482482
const editor = this.editor;
483483
const formView = new FormView( editor.locale );
484484

485-
this.listenTo( formView, 'submit', () => {
486-
// ...
485+
this.listenTo( formView, 'submit', () => {
486+
// ...
487487

488-
// Hide the form view after submit.
488+
// Hide the form view after submit.
489489
this._hideUI();
490490
} );
491491

@@ -494,7 +494,7 @@ class AbbreviationUI extends Plugin {
494494
this._hideUI();
495495
} );
496496

497-
// Hide the form view when clicking outside the balloon.
497+
// Hide the form view when clicking outside the balloon.
498498
clickOutsideHandler( {
499499
emitter: formView,
500500
activator: () => this._balloon.visibleView === formView,
@@ -517,7 +517,7 @@ class AbbreviationUI extends Plugin {
517517
}
518518

519519
_getBalloonPositionData() {
520-
// ...
520+
// ...
521521
}
522522

523523
_showUI() {

0 commit comments

Comments
 (0)