You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{@link features/custom-components Custom Widgets and Components}
1985
+
<span>
1986
+
<span class="subfeature-icon"></span> {@link features/custom-components Custom Widgets and Components}
1987
+
</span>
1970
1988
</td>
1971
1989
<td>
1972
1990
Build custom interactive components using CKEditor 5's widget system. Create block widgets, inline elements, external data integrations, and framework components (React, Vue, Angular) that seamlessly integrate with the editor's content model and UI.
Copy file name to clipboardExpand all lines: docs/getting-started/integrations-cdn/angular.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -143,7 +143,7 @@ export class MyComponent {
143
143
public editorData;
144
144
145
145
private _setupEditor( cloud ) {
146
-
this.editorData='<p>Hello, world!</p>';
146
+
this.editorData='<p>Hello, world!</p>';
147
147
}
148
148
// ...
149
149
}
@@ -175,10 +175,10 @@ export class MyComponent {
175
175
public isDisabled;
176
176
// ...
177
177
private _setupEditor( cloud ) {
178
-
this.isDisabled=false;
178
+
this.isDisabled=false;
179
179
}
180
180
toggleDisabled() {
181
-
this.isDisabled=!this.isDisabled
181
+
this.isDisabled=!this.isDisabled;
182
182
}
183
183
}
184
184
```
@@ -275,7 +275,7 @@ export class MyComponent {
275
275
276
276
Allows disabling the two-way data binding mechanism. The default value is `false`.
277
277
278
-
The reason for the introduction of this option are performance issues in large documents. By default, while using the `ngModel` directive, whenever the editor's data is changed, the component must synchronize the data between the editor instance and the connected property. This results in calling the {@link module:core/editor/editor~Editor#getData `editor.getData()`} function, which causes a massive slowdown while typing in large documents.
278
+
The reason for the introduction of this option is performance issues in large documents. By default, while using the `ngModel` directive, whenever the editor's data is changed, the component must synchronize the data between the editor instance and the connected property. This results in calling the {@link module:core/editor/editor~Editor#getData `editor.getData()`} function, which causes a massive slowdown while typing in large documents.
279
279
280
280
This option allows the integrator to disable the default behavior and only call the {@link module:core/editor/editor~Editor#getData `editor.getData()`} method on demand, which prevents the slowdowns. You can read more in the [relevant issue](https://github.com/ckeditor/ckeditor5-angular/issues/141).
281
281
@@ -288,7 +288,7 @@ The following `@Output` properties are supported by the CKEditor 5 rich tex
288
288
Fired when the editor is ready. It corresponds with the [`editor#ready`](https://ckeditor.com/docs/ckeditor5/latest/api/module_core_editor_editor-Editor.html#event-ready) event.
289
289
It is fired with the editor instance.
290
290
291
-
Note that this method might be called multiple times. Apart from initialization, it is also called whenever the editor is restarted after a crash. Do not keep the reference to the editor instance internally, because it will change in case of restart. Instead, you should use `watchdog.editor` property.
291
+
Note that this method might be called multiple times. Apart from initialization, it is also called whenever the editor is restarted after a crash. Do not keep the reference to the editor instance internally, because it will change in case of a restart. Instead, you should use the`watchdog.editor` property.
292
292
293
293
### `change`
294
294
@@ -338,7 +338,7 @@ It is fired with an object containing the editor and the CKEditor 5 `focus`
338
338
339
339
### `error`
340
340
341
-
Fired when the editor crashes. Once the editor is crashed, the internal watchdog mechanism restarts the editor and fires the [ready](#ready) event.
341
+
Fired when the editor crashes. Once the editor has crashed, the internal watchdog mechanism restarts the editor and fires the [ready](#ready) event.
342
342
343
343
<info-box>
344
344
Prior to ckeditor5-angular `v7.0.1`, this event was not fired for crashes during the editor initialization.
@@ -388,7 +388,7 @@ First, create a (S)CSS file in the parent component's directory and style the gi
388
388
}
389
389
```
390
390
391
-
Then in the parent component add the relative path to the above style sheet:
391
+
Then, in the parent component, add the relative path to the above style sheet:
392
392
393
393
```ts
394
394
/* src/app/app.component.ts */
@@ -411,7 +411,7 @@ To style the component using a global style sheet, first, create it:
411
411
}
412
412
```
413
413
414
-
Then, add it in the `angular.json` configuration file:
414
+
Then, add it to the `angular.json` configuration file:
415
415
416
416
```json
417
417
"architect": {
@@ -448,7 +448,7 @@ export class MyComponent {
448
448
449
449
### Accessing the editor instance
450
450
451
-
The CKEditor 5 rich text editor component provides all the functionality needed for most use cases. When access to the full CKEditor 5 API is needed you can get the editor instance with an additional step.
451
+
The CKEditor 5 rich text editor component provides all the functionality needed for most use cases. When access to the full CKEditor 5 API is needed, you can get the editor instance with an additional step.
452
452
453
453
To do this, create a template reference variable `#editor` pointing to the `<ckeditor>` component:
454
454
@@ -472,7 +472,7 @@ export class MyComponent {
472
472
```
473
473
474
474
<info-box>
475
-
The editor creation is asynchronous so the `editorInstance` will not be available until the editor is created. If you want to make changes to an editor that has just been created, a better option would be getting the CKEditor 5 instance on the [`ready`](#ready) event.
475
+
The editor creation is asynchronous, so the `editorInstance` will not be available until the editor is created. If you want to make changes to an editor that has just been created, a better option would be getting the CKEditor 5 instance on the [`ready`](#ready) event.
476
476
</info-box>
477
477
478
478
## How to?
@@ -562,7 +562,7 @@ We provide a few **ready-to-use integrations** featuring collaborative editing i
562
562
*[CKEditor 5 with the revision history feature](https://github.com/ckeditor/ckeditor5-collaboration-samples/tree/master/revision-history-for-angular)
563
563
*[CKEditor 5 with the track changes feature](https://github.com/ckeditor/ckeditor5-collaboration-samples/tree/master/track-changes-for-angular)
564
564
565
-
It is not mandatory to build applications on top of the above samples, however, they should help you get started.
565
+
It is not mandatory to build applications on top of the above samples; however, they should help you get started.
566
566
567
567
### Localization
568
568
@@ -692,7 +692,7 @@ All available Angular versions are [listed on npm](https://www.npmjs.com/package
692
692
693
693
## Contributing and reporting issues
694
694
695
-
The source code of the CKEditor 5 rich text editor component for Angular is available on GitHub in[https://github.com/ckeditor/ckeditor5-angular](https://github.com/ckeditor/ckeditor5-angular).
695
+
The source code of the CKEditor 5 rich text editor component for Angular is available on GitHub at[https://github.com/ckeditor/ckeditor5-angular](https://github.com/ckeditor/ckeditor5-angular).
Copy file name to clipboardExpand all lines: docs/getting-started/integrations/angular.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -123,7 +123,7 @@ import { AppComponent } from './app.component';
123
123
exportclassAppModule { }
124
124
```
125
125
126
-
Then, import the editor in your Angular component and assign it to a `public` property to make it accessible from the template. The below example shows how to use the component with open-source and premium plugins.
126
+
Then, import the editor into your Angular component and assign it to a `public` property to make it accessible from the template. The example below shows how to use the component with open-source and premium plugins.
127
127
128
128
<info-box>
129
129
Starting from version 44.0.0, the `licenseKey` property is required to use the editor. If you use a self-hosted editor from npm:
@@ -159,7 +159,7 @@ export class AppComponent {
159
159
}
160
160
```
161
161
162
-
Depending on the plugins you used, you may need to import the first or both CSS files. Angular, by default, scope styles to a particular component. Because of that, the editor may not detect attached styles. You must set the encapsulation option to`ViewEncapsulation.None`to turn this scoping off.
162
+
Depending on the plugins you used, you may need to import the first or both CSS files. Angular, by default, scopes styles to a particular component. That's why the editor may not detect attached styles. You must set the encapsulation option to`ViewEncapsulation.None`to turn this scoping off.
163
163
164
164
```css
165
165
/* app.component.css */
@@ -318,7 +318,7 @@ export class MyComponent {
318
318
319
319
Allows disabling the two-way data binding mechanism. The default value is `false`.
320
320
321
-
The reason for the introduction of this option are performance issues in large documents. By default, while using the `ngModel` directive, whenever the editor's data is changed, the component must synchronize the data between the editor instance and the connected property. This results in calling the {@link module:core/editor/editor~Editor#getData `editor.getData()`} function, which causes a massive slowdown while typing in large documents.
321
+
We introduced this option to address performance issues in large documents. By default, while using the `ngModel` directive, whenever the editor's data is changed, the component must synchronize the data between the editor instance and the connected property. This results in calling the {@link module:core/editor/editor~Editor#getData `editor.getData()`} function, which causes a massive slowdown while typing in large documents.
322
322
323
323
This option allows the integrator to disable the default behavior and only call the {@link module:core/editor/editor~Editor#getData `editor.getData()`} method on demand, which prevents the slowdowns. You can read more in the [relevant issue](https://github.com/ckeditor/ckeditor5-angular/issues/141).
324
324
@@ -331,7 +331,7 @@ The following `@Output` properties are supported by the CKEditor 5 rich tex
331
331
Fired when the editor is ready. It corresponds with the [`editor#ready`](https://ckeditor.com/docs/ckeditor5/latest/api/module_core_editor_editor-Editor.html#event-ready) event.
332
332
It is fired with the editor instance.
333
333
334
-
Note that this method might be called multiple times. Apart from initialization, it is also called whenever the editor is restarted after a crash. Do not keep the reference to the editor instance internally, because it will change in case of restart. Instead, you should use `watchdog.editor`property.
334
+
Note that this method might be called multiple times. Apart from initialization, it is also called whenever the editor is restarted after a crash. Do not keep the reference to the editor instance internally, because it will change in case of a restart. Instead, you should use the`watchdog.editor`property.
335
335
336
336
### `change`
337
337
@@ -373,7 +373,7 @@ It is fired with an object containing the editor and the CKEditor 5 `focus`
373
373
374
374
### `error`
375
375
376
-
Fired when the editor crashes. Once the editor is crashed, the internal watchdog mechanism restarts the editor and fires the [ready](#ready) event.
376
+
Fired when the editor crashes. Once the editor has crashed, the internal watchdog mechanism restarts the editor and fires the [ready](#ready) event.
377
377
378
378
<info-box>
379
379
Prior to ckeditor5-angular `v7.0.1`, this event was not fired for crashes during the editor initialization.
@@ -419,7 +419,7 @@ First, create a (S)CSS file in the parent component's directory and style the gi
419
419
}
420
420
```
421
421
422
-
Then in the parent component add the relative path to the above style sheet:
422
+
Then, in the parent component, add the relative path to the above style sheet:
423
423
424
424
```ts
425
425
/* src/app/app.component.ts */
@@ -442,7 +442,7 @@ To style the component using a global style sheet, first, create it:
442
442
}
443
443
```
444
444
445
-
Then, add it in the `angular.json` configuration file:
445
+
Then, add it to the `angular.json` configuration file:
446
446
447
447
```json
448
448
"architect": {
@@ -458,7 +458,7 @@ Then, add it in the `angular.json` configuration file:
458
458
459
459
#### Setting the placeholder
460
460
461
-
To display {@link features/editor-placeholder the placeholder} in the main editable element, set the `placeholder` field in the CKEditor 5 rich text editor component configuration:
461
+
To display the {@link features/editor-placeholder placeholder} in the main editable element, set the `placeholder` field in the CKEditor 5 rich text editor component configuration:
462
462
463
463
```ts
464
464
@Component( {
@@ -681,7 +681,7 @@ beforeAll( () => {
681
681
} );
682
682
```
683
683
684
-
These mocks should be placed before the tests that use CKEditor 5. They are imperfect and may not cover all the cases, but they should be sufficient for basic initialization and rendering editor. Keep in mind that they are not a replacement for proper browser testing.
684
+
These mocks should be placed before the tests that use CKEditor 5. They are imperfect and may not cover all the cases, but they should be sufficient for basic initialization and rendering the editor. Keep in mind that they are not a replacement for proper browser testing.
685
685
686
686
## Supported Angular versions
687
687
@@ -759,7 +759,7 @@ All available Angular versions are [listed on npm](https://www.npmjs.com/package
759
759
760
760
## Contributing and reporting issues
761
761
762
-
The source code of the CKEditor 5 rich text editor component for Angular is available on GitHub in[https://github.com/ckeditor/ckeditor5-angular](https://github.com/ckeditor/ckeditor5-angular).
762
+
The source code of the CKEditor 5 rich text editor component for Angular is available on GitHub at[https://github.com/ckeditor/ckeditor5-angular](https://github.com/ckeditor/ckeditor5-angular).
Copy file name to clipboardExpand all lines: docs/getting-started/setup/csp.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,9 @@ Some CSP directives have an impact on certain rich-text editor features. Here is
49
49
*`style-src 'self' 'unsafe-inline'`:
50
50
* The `self` directive allows to load styles from the site's own domain. Since v42.0.0, the editor {@link getting-started/setup/css distributes its stylesheets}. If you need to load styles from some other domain, add them explicitly: `style-src https://trusted-styles.example.com;`.
51
51
* The directive `unsafe-inline` is required to make the styles of certain features work properly. For instance, you are going to need it if you want to enable such editor features as {@link features/font font} or {@link features/text-alignment text alignment} or any other feature that uses the inline `style="..."` attributes in the content.
52
+
53
+
**Note**: Inline styles are also required when using {@link features/lists#list-item-marker-formatting list item marker formatting}. For example, if you apply font color, size, or family to list markers, the editor uses inline style attributes to render them. Because of this, `unsafe-inline` must be allowed for the styles to display correctly.
54
+
52
55
*`frame-src *`: Necessary for the {@link features/media-embed media embed} feature to load media with previews (containing `<iframe>`).
53
56
54
57
**Note**: Use the more strict `frame-src 'self'` if all the media in the edited content come from the same domain as your application.
As you can see, the code became much more verbose and far longer. This is because you used lower-level converters. We plan to provide more handy widget conversion utilities in the future. Read more (and 👍) in [this ticket](https://github.com/ckeditor/ckeditor5/issues/1228).
541
-
</info-box>
542
-
543
539
### Behavior after turning simple box into a widget
544
540
545
541
Now, you should see how your simple box plugin has changed.
@@ -825,7 +821,7 @@ npm run dev
825
821
826
822
If you want to use the editor from CDN, you can adapt this tutorial by following these steps.
827
823
828
-
First, clone the repository the same way as before. But do not install the dependencies. Instead, open the `index.html` file and add the following tags:
824
+
First, clone the repository the same way as before. **But do not install the dependencies.** Instead, open the `index.html` file and add the following tags:
Copy file name to clipboardExpand all lines: docs/tutorials/widgets/implementing-an-inline-widget.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ meta-description: Discover how to create a custom inline widget in CKEditor 5 wi
9
9
10
10
In this tutorial, you will learn how to implement an inline widget. You will build a "placeholder" feature that allows the users to insert predefined placeholders, like a date or a surname, into the document.
11
11
12
-
<info-boxwarning>
12
+
<info-box>
13
13
**We have an official implementation of this feature!**
14
14
15
15
While this tutorial was created for learning purposes, it only offers a basic, simplified solution. We have an official implementation of this mechanism, called the {@link features/merge-fields merge fields} feature. It is much more robust than the solution presented here, and offers many configuration options.
@@ -633,7 +633,7 @@ npm run dev
633
633
634
634
If you want to use the editor from CDN, you can adapt this tutorial by following these steps.
635
635
636
-
First, clone the repository the same way as before. But do not install the dependencies. Instead, open the `index.html` file and add the following tags:
636
+
First, clone the repository the same way as before. **But do not install the dependencies.** Instead, open the `index.html` file and add the following tags:
0 commit comments