@ckeditor/ckeditor5-remove-format 40.0.0 → 40.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,17 +5,17 @@ All changes in the package are documented in the main repository. See: https://g
5
5
 
6
6
  Changes for the past releases are available below.
7
7
 
8
- ## [19.0.0](https://github.com/ckeditor/ckeditor5-remove-format/compare/v18.0.0...v19.0.0) (2020-04-29)
8
+ ## [19.0.0](https://github.com/ckeditor/ckeditor5-remove-format/compare/v18.0.0...v19.0.0) (April 29, 2020)
9
9
 
10
10
  Internal changes only (updated dependencies, documentation, etc.).
11
11
 
12
12
 
13
- ## [18.0.0](https://github.com/ckeditor/ckeditor5-remove-format/compare/v17.0.0...v18.0.0) (2020-03-19)
13
+ ## [18.0.0](https://github.com/ckeditor/ckeditor5-remove-format/compare/v17.0.0...v18.0.0) (March 19, 2020)
14
14
 
15
15
  Internal changes only (updated dependencies, documentation, etc.).
16
16
 
17
17
 
18
- ## [17.0.0](https://github.com/ckeditor/ckeditor5-remove-format/compare/v16.0.0...v17.0.0) (2020-02-19)
18
+ ## [17.0.0](https://github.com/ckeditor/ckeditor5-remove-format/compare/v16.0.0...v17.0.0) (February 19, 2020)
19
19
 
20
20
  ### Bug fixes
21
21
 
@@ -26,21 +26,21 @@ Internal changes only (updated dependencies, documentation, etc.).
26
26
  * Updated translations. ([00595f3](https://github.com/ckeditor/ckeditor5-remove-format/commit/00595f3))
27
27
 
28
28
 
29
- ## [16.0.0](https://github.com/ckeditor/ckeditor5-remove-format/compare/v15.0.0...v16.0.0) (2019-12-04)
29
+ ## [16.0.0](https://github.com/ckeditor/ckeditor5-remove-format/compare/v15.0.0...v16.0.0) (December 4, 2019)
30
30
 
31
31
  ### Other changes
32
32
 
33
33
  * Updated translations. ([4fa2bcf](https://github.com/ckeditor/ckeditor5-remove-format/commit/4fa2bcf))
34
34
 
35
35
 
36
- ## [15.0.0](https://github.com/ckeditor/ckeditor5-remove-format/compare/v10.0.4...v15.0.0) (2019-10-23)
36
+ ## [15.0.0](https://github.com/ckeditor/ckeditor5-remove-format/compare/v10.0.4...v15.0.0) (October 23, 2019)
37
37
 
38
38
  ### Other changes
39
39
 
40
40
  * Updated translations. ([93516d9](https://github.com/ckeditor/ckeditor5-remove-format/commit/93516d9))
41
41
 
42
42
 
43
- ## [10.0.4](https://github.com/ckeditor/ckeditor5-remove-format/compare/v10.0.3...v10.0.4) (2019-08-26)
43
+ ## [10.0.4](https://github.com/ckeditor/ckeditor5-remove-format/compare/v10.0.3...v10.0.4) (August 26, 2019)
44
44
 
45
45
  ### Other changes
46
46
 
@@ -48,25 +48,25 @@ Internal changes only (updated dependencies, documentation, etc.).
48
48
  * Updated translations. ([9b2f170](https://github.com/ckeditor/ckeditor5-remove-format/commit/9b2f170))
49
49
 
50
50
 
51
- ## [10.0.3](https://github.com/ckeditor/ckeditor5-remove-format/compare/v10.0.2...v10.0.3) (2019-07-10)
51
+ ## [10.0.3](https://github.com/ckeditor/ckeditor5-remove-format/compare/v10.0.2...v10.0.3) (July 10, 2019)
52
52
 
53
53
  Internal changes only (updated dependencies, documentation, etc.).
54
54
 
55
55
 
56
- ## [10.0.2](https://github.com/ckeditor/ckeditor5-remove-format/compare/v10.0.1...v10.0.2) (2019-07-04)
56
+ ## [10.0.2](https://github.com/ckeditor/ckeditor5-remove-format/compare/v10.0.1...v10.0.2) (July 4, 2019)
57
57
 
58
58
  ### Other changes
59
59
 
60
60
  * Updated translations. ([8e17de8](https://github.com/ckeditor/ckeditor5-remove-format/commit/8e17de8)) ([de55035](https://github.com/ckeditor/ckeditor5-remove-format/commit/de55035))
61
61
 
62
62
 
63
- ## [10.0.1](https://github.com/ckeditor/ckeditor5-remove-format/compare/v10.0.0...v10.0.1) (2019-06-05)
63
+ ## [10.0.1](https://github.com/ckeditor/ckeditor5-remove-format/compare/v10.0.0...v10.0.1) (June 6, 2019)
64
64
 
65
65
  ### Other changes
66
66
 
67
67
  * Updated translations. ([232052a](https://github.com/ckeditor/ckeditor5-remove-format/commit/232052a))
68
68
 
69
69
 
70
- ## [10.0.0](https://github.com/ckeditor/ckeditor5-remove-format/tree/v10.0.0) (2019-04-10)
70
+ ## [10.0.0](https://github.com/ckeditor/ckeditor5-remove-format/tree/v10.0.0) (April 4, 2019)
71
71
 
72
72
  The initial release.
package/LICENSE.md CHANGED
@@ -2,7 +2,7 @@ Software License Agreement
2
2
  ==========================
3
3
 
4
4
  **CKEditor&nbsp;5 remove format feature** – https://github.com/ckeditor/ckeditor5-remove-format <br>
5
- Copyright (c) 2003-2023, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
5
+ Copyright (c) 20032023, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
6
6
 
7
7
  Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html).
8
8
 
@@ -14,4 +14,4 @@ Where not otherwise indicated, all CKEditor content is authored by CKSource engi
14
14
  Trademarks
15
15
  ----------
16
16
 
17
- **CKEditor** is a trademark of [CKSource Holding sp. z o.o.](https://cksource.com) All other brand and product names are trademarks, registered trademarks or service marks of their respective holders.
17
+ **CKEditor** is a trademark of [CKSource Holding sp. z o.o.](https://cksource.com) All other brand and product names are trademarks, registered trademarks, or service marks of their respective holders.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-remove-format",
3
- "version": "40.0.0",
3
+ "version": "40.2.0",
4
4
  "description": "Remove format feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -12,7 +12,7 @@
12
12
  ],
13
13
  "main": "src/index.js",
14
14
  "dependencies": {
15
- "ckeditor5": "40.0.0"
15
+ "ckeditor5": "40.2.0"
16
16
  },
17
17
  "author": "CKSource (http://cksource.com/)",
18
18
  "license": "GPL-2.0-or-later",
@@ -1,15 +1,15 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- import type { RemoveFormat, RemoveFormatEditing, RemoveFormatUI, RemoveFormatCommand } from './index';
6
- declare module '@ckeditor/ckeditor5-core' {
7
- interface PluginsMap {
8
- [RemoveFormat.pluginName]: RemoveFormat;
9
- [RemoveFormatUI.pluginName]: RemoveFormatUI;
10
- [RemoveFormatEditing.pluginName]: RemoveFormatEditing;
11
- }
12
- interface CommandsMap {
13
- removeFormat: RemoveFormatCommand;
14
- }
15
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ import type { RemoveFormat, RemoveFormatEditing, RemoveFormatUI, RemoveFormatCommand } from './index';
6
+ declare module '@ckeditor/ckeditor5-core' {
7
+ interface PluginsMap {
8
+ [RemoveFormat.pluginName]: RemoveFormat;
9
+ [RemoveFormatUI.pluginName]: RemoveFormatUI;
10
+ [RemoveFormatEditing.pluginName]: RemoveFormatEditing;
11
+ }
12
+ interface CommandsMap {
13
+ removeFormat: RemoveFormatCommand;
14
+ }
15
+ }
@@ -1,5 +1,5 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- export {};
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ export {};
package/src/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module remove-format
7
- */
8
- export { default as RemoveFormat } from './removeformat';
9
- export { default as RemoveFormatEditing } from './removeformatediting';
10
- export { default as RemoveFormatUI } from './removeformatui';
11
- export type { default as RemoveFormatCommand } from './removeformatcommand';
12
- import './augmentation';
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module remove-format
7
+ */
8
+ export { default as RemoveFormat } from './removeformat';
9
+ export { default as RemoveFormatEditing } from './removeformatediting';
10
+ export { default as RemoveFormatUI } from './removeformatui';
11
+ export type { default as RemoveFormatCommand } from './removeformatcommand';
12
+ import './augmentation';
package/src/index.js CHANGED
@@ -1,11 +1,11 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module remove-format
7
- */
8
- export { default as RemoveFormat } from './removeformat';
9
- export { default as RemoveFormatEditing } from './removeformatediting';
10
- export { default as RemoveFormatUI } from './removeformatui';
11
- import './augmentation';
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module remove-format
7
+ */
8
+ export { default as RemoveFormat } from './removeformat';
9
+ export { default as RemoveFormatEditing } from './removeformatediting';
10
+ export { default as RemoveFormatUI } from './removeformatui';
11
+ import './augmentation';
@@ -1,28 +1,28 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module remove-format/removeformat
7
- */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import RemoveFormatUI from './removeformatui';
10
- import RemoveFormatEditing from './removeformatediting';
11
- /**
12
- * The remove format plugin.
13
- *
14
- * This is a "glue" plugin which loads the {@link module:remove-format/removeformatediting~RemoveFormatEditing}
15
- * and {@link module:remove-format/removeformatui~RemoveFormatUI} plugins.
16
- *
17
- * For a detailed overview, check out the {@glink features/remove-format remove format} feature documentation.
18
- */
19
- export default class RemoveFormat extends Plugin {
20
- /**
21
- * @inheritDoc
22
- */
23
- static get requires(): readonly [typeof RemoveFormatEditing, typeof RemoveFormatUI];
24
- /**
25
- * @inheritDoc
26
- */
27
- static get pluginName(): "RemoveFormat";
28
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module remove-format/removeformat
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core';
9
+ import RemoveFormatUI from './removeformatui';
10
+ import RemoveFormatEditing from './removeformatediting';
11
+ /**
12
+ * The remove format plugin.
13
+ *
14
+ * This is a "glue" plugin which loads the {@link module:remove-format/removeformatediting~RemoveFormatEditing}
15
+ * and {@link module:remove-format/removeformatui~RemoveFormatUI} plugins.
16
+ *
17
+ * For a detailed overview, check out the {@glink features/remove-format remove format} feature documentation.
18
+ */
19
+ export default class RemoveFormat extends Plugin {
20
+ /**
21
+ * @inheritDoc
22
+ */
23
+ static get requires(): readonly [typeof RemoveFormatEditing, typeof RemoveFormatUI];
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ static get pluginName(): "RemoveFormat";
28
+ }
@@ -1,32 +1,32 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module remove-format/removeformat
7
- */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import RemoveFormatUI from './removeformatui';
10
- import RemoveFormatEditing from './removeformatediting';
11
- /**
12
- * The remove format plugin.
13
- *
14
- * This is a "glue" plugin which loads the {@link module:remove-format/removeformatediting~RemoveFormatEditing}
15
- * and {@link module:remove-format/removeformatui~RemoveFormatUI} plugins.
16
- *
17
- * For a detailed overview, check out the {@glink features/remove-format remove format} feature documentation.
18
- */
19
- export default class RemoveFormat extends Plugin {
20
- /**
21
- * @inheritDoc
22
- */
23
- static get requires() {
24
- return [RemoveFormatEditing, RemoveFormatUI];
25
- }
26
- /**
27
- * @inheritDoc
28
- */
29
- static get pluginName() {
30
- return 'RemoveFormat';
31
- }
32
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module remove-format/removeformat
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core';
9
+ import RemoveFormatUI from './removeformatui';
10
+ import RemoveFormatEditing from './removeformatediting';
11
+ /**
12
+ * The remove format plugin.
13
+ *
14
+ * This is a "glue" plugin which loads the {@link module:remove-format/removeformatediting~RemoveFormatEditing}
15
+ * and {@link module:remove-format/removeformatui~RemoveFormatUI} plugins.
16
+ *
17
+ * For a detailed overview, check out the {@glink features/remove-format remove format} feature documentation.
18
+ */
19
+ export default class RemoveFormat extends Plugin {
20
+ /**
21
+ * @inheritDoc
22
+ */
23
+ static get requires() {
24
+ return [RemoveFormatEditing, RemoveFormatUI];
25
+ }
26
+ /**
27
+ * @inheritDoc
28
+ */
29
+ static get pluginName() {
30
+ return 'RemoveFormat';
31
+ }
32
+ }
@@ -1,42 +1,42 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- import { Command } from 'ckeditor5/src/core';
6
- /**
7
- * The remove format command.
8
- *
9
- * It is used by the {@link module:remove-format/removeformat~RemoveFormat remove format feature}
10
- * to clear the formatting in the selection.
11
- *
12
- * ```ts
13
- * editor.execute( 'removeFormat' );
14
- * ```
15
- */
16
- export default class RemoveFormatCommand extends Command {
17
- value: boolean;
18
- /**
19
- * @inheritDoc
20
- */
21
- refresh(): void;
22
- /**
23
- * @inheritDoc
24
- */
25
- execute(): void;
26
- /**
27
- * Returns an iterable of items in a selection (including the selection itself) that have formatting model
28
- * attributes to be removed by the feature.
29
- *
30
- * @param schema The schema describing the item.
31
- */
32
- private _getFormattingItems;
33
- /**
34
- * Returns an iterable of formatting attributes of a given model item.
35
- *
36
- * **Note:** Formatting items have the `isFormatting` property set to `true`.
37
- *
38
- * @param schema The schema describing the item.
39
- * @returns The names of formatting attributes found in a given item.
40
- */
41
- private _getFormattingAttributes;
42
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ import { Command } from 'ckeditor5/src/core';
6
+ /**
7
+ * The remove format command.
8
+ *
9
+ * It is used by the {@link module:remove-format/removeformat~RemoveFormat remove format feature}
10
+ * to clear the formatting in the selection.
11
+ *
12
+ * ```ts
13
+ * editor.execute( 'removeFormat' );
14
+ * ```
15
+ */
16
+ export default class RemoveFormatCommand extends Command {
17
+ value: boolean;
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ refresh(): void;
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ execute(): void;
26
+ /**
27
+ * Returns an iterable of items in a selection (including the selection itself) that have formatting model
28
+ * attributes to be removed by the feature.
29
+ *
30
+ * @param schema The schema describing the item.
31
+ */
32
+ private _getFormattingItems;
33
+ /**
34
+ * Returns an iterable of formatting attributes of a given model item.
35
+ *
36
+ * **Note:** Formatting items have the `isFormatting` property set to `true`.
37
+ *
38
+ * @param schema The schema describing the item.
39
+ * @returns The names of formatting attributes found in a given item.
40
+ */
41
+ private _getFormattingAttributes;
42
+ }
@@ -1,94 +1,94 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- import { Command } from 'ckeditor5/src/core';
6
- import { first } from 'ckeditor5/src/utils';
7
- /**
8
- * The remove format command.
9
- *
10
- * It is used by the {@link module:remove-format/removeformat~RemoveFormat remove format feature}
11
- * to clear the formatting in the selection.
12
- *
13
- * ```ts
14
- * editor.execute( 'removeFormat' );
15
- * ```
16
- */
17
- export default class RemoveFormatCommand extends Command {
18
- /**
19
- * @inheritDoc
20
- */
21
- refresh() {
22
- const model = this.editor.model;
23
- this.isEnabled = !!first(this._getFormattingItems(model.document.selection, model.schema));
24
- }
25
- /**
26
- * @inheritDoc
27
- */
28
- execute() {
29
- const model = this.editor.model;
30
- const schema = model.schema;
31
- model.change(writer => {
32
- for (const item of this._getFormattingItems(model.document.selection, schema)) {
33
- if (item.is('selection')) {
34
- for (const attributeName of this._getFormattingAttributes(item, schema)) {
35
- writer.removeSelectionAttribute(attributeName);
36
- }
37
- }
38
- else {
39
- // Workaround for items with multiple removable attributes. See
40
- // https://github.com/ckeditor/ckeditor5-remove-format/pull/1#pullrequestreview-220515609
41
- const itemRange = writer.createRangeOn(item);
42
- for (const attributeName of this._getFormattingAttributes(item, schema)) {
43
- writer.removeAttribute(attributeName, itemRange);
44
- }
45
- }
46
- }
47
- });
48
- }
49
- /**
50
- * Returns an iterable of items in a selection (including the selection itself) that have formatting model
51
- * attributes to be removed by the feature.
52
- *
53
- * @param schema The schema describing the item.
54
- */
55
- *_getFormattingItems(selection, schema) {
56
- const itemHasRemovableFormatting = (item) => {
57
- return !!first(this._getFormattingAttributes(item, schema));
58
- };
59
- // Check formatting on selected items that are not blocks.
60
- for (const curRange of selection.getRanges()) {
61
- for (const item of curRange.getItems()) {
62
- if (!schema.isBlock(item) && itemHasRemovableFormatting(item)) {
63
- yield item;
64
- }
65
- }
66
- }
67
- // Check formatting from selected blocks.
68
- for (const block of selection.getSelectedBlocks()) {
69
- if (itemHasRemovableFormatting(block)) {
70
- yield block;
71
- }
72
- }
73
- // Finally the selection might be formatted as well, so make sure to check it.
74
- if (itemHasRemovableFormatting(selection)) {
75
- yield selection;
76
- }
77
- }
78
- /**
79
- * Returns an iterable of formatting attributes of a given model item.
80
- *
81
- * **Note:** Formatting items have the `isFormatting` property set to `true`.
82
- *
83
- * @param schema The schema describing the item.
84
- * @returns The names of formatting attributes found in a given item.
85
- */
86
- *_getFormattingAttributes(item, schema) {
87
- for (const [attributeName] of item.getAttributes()) {
88
- const attributeProperties = schema.getAttributeProperties(attributeName);
89
- if (attributeProperties && attributeProperties.isFormatting) {
90
- yield attributeName;
91
- }
92
- }
93
- }
94
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ import { Command } from 'ckeditor5/src/core';
6
+ import { first } from 'ckeditor5/src/utils';
7
+ /**
8
+ * The remove format command.
9
+ *
10
+ * It is used by the {@link module:remove-format/removeformat~RemoveFormat remove format feature}
11
+ * to clear the formatting in the selection.
12
+ *
13
+ * ```ts
14
+ * editor.execute( 'removeFormat' );
15
+ * ```
16
+ */
17
+ export default class RemoveFormatCommand extends Command {
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ refresh() {
22
+ const model = this.editor.model;
23
+ this.isEnabled = !!first(this._getFormattingItems(model.document.selection, model.schema));
24
+ }
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ execute() {
29
+ const model = this.editor.model;
30
+ const schema = model.schema;
31
+ model.change(writer => {
32
+ for (const item of this._getFormattingItems(model.document.selection, schema)) {
33
+ if (item.is('selection')) {
34
+ for (const attributeName of this._getFormattingAttributes(item, schema)) {
35
+ writer.removeSelectionAttribute(attributeName);
36
+ }
37
+ }
38
+ else {
39
+ // Workaround for items with multiple removable attributes. See
40
+ // https://github.com/ckeditor/ckeditor5-remove-format/pull/1#pullrequestreview-220515609
41
+ const itemRange = writer.createRangeOn(item);
42
+ for (const attributeName of this._getFormattingAttributes(item, schema)) {
43
+ writer.removeAttribute(attributeName, itemRange);
44
+ }
45
+ }
46
+ }
47
+ });
48
+ }
49
+ /**
50
+ * Returns an iterable of items in a selection (including the selection itself) that have formatting model
51
+ * attributes to be removed by the feature.
52
+ *
53
+ * @param schema The schema describing the item.
54
+ */
55
+ *_getFormattingItems(selection, schema) {
56
+ const itemHasRemovableFormatting = (item) => {
57
+ return !!first(this._getFormattingAttributes(item, schema));
58
+ };
59
+ // Check formatting on selected items that are not blocks.
60
+ for (const curRange of selection.getRanges()) {
61
+ for (const item of curRange.getItems()) {
62
+ if (!schema.isBlock(item) && itemHasRemovableFormatting(item)) {
63
+ yield item;
64
+ }
65
+ }
66
+ }
67
+ // Check formatting from selected blocks.
68
+ for (const block of selection.getSelectedBlocks()) {
69
+ if (itemHasRemovableFormatting(block)) {
70
+ yield block;
71
+ }
72
+ }
73
+ // Finally the selection might be formatted as well, so make sure to check it.
74
+ if (itemHasRemovableFormatting(selection)) {
75
+ yield selection;
76
+ }
77
+ }
78
+ /**
79
+ * Returns an iterable of formatting attributes of a given model item.
80
+ *
81
+ * **Note:** Formatting items have the `isFormatting` property set to `true`.
82
+ *
83
+ * @param schema The schema describing the item.
84
+ * @returns The names of formatting attributes found in a given item.
85
+ */
86
+ *_getFormattingAttributes(item, schema) {
87
+ for (const [attributeName] of item.getAttributes()) {
88
+ const attributeProperties = schema.getAttributeProperties(attributeName);
89
+ if (attributeProperties && attributeProperties.isFormatting) {
90
+ yield attributeName;
91
+ }
92
+ }
93
+ }
94
+ }
@@ -1,23 +1,23 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module remove-format/removeformatediting
7
- */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- /**
10
- * The remove format editing plugin.
11
- *
12
- * It registers the {@link module:remove-format/removeformatcommand~RemoveFormatCommand removeFormat} command.
13
- */
14
- export default class RemoveFormatEditing extends Plugin {
15
- /**
16
- * @inheritDoc
17
- */
18
- static get pluginName(): "RemoveFormatEditing";
19
- /**
20
- * @inheritDoc
21
- */
22
- init(): void;
23
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module remove-format/removeformatediting
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core';
9
+ /**
10
+ * The remove format editing plugin.
11
+ *
12
+ * It registers the {@link module:remove-format/removeformatcommand~RemoveFormatCommand removeFormat} command.
13
+ */
14
+ export default class RemoveFormatEditing extends Plugin {
15
+ /**
16
+ * @inheritDoc
17
+ */
18
+ static get pluginName(): "RemoveFormatEditing";
19
+ /**
20
+ * @inheritDoc
21
+ */
22
+ init(): void;
23
+ }
@@ -1,29 +1,29 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module remove-format/removeformatediting
7
- */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import RemoveFormatCommand from './removeformatcommand';
10
- /**
11
- * The remove format editing plugin.
12
- *
13
- * It registers the {@link module:remove-format/removeformatcommand~RemoveFormatCommand removeFormat} command.
14
- */
15
- export default class RemoveFormatEditing extends Plugin {
16
- /**
17
- * @inheritDoc
18
- */
19
- static get pluginName() {
20
- return 'RemoveFormatEditing';
21
- }
22
- /**
23
- * @inheritDoc
24
- */
25
- init() {
26
- const editor = this.editor;
27
- editor.commands.add('removeFormat', new RemoveFormatCommand(editor));
28
- }
29
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module remove-format/removeformatediting
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core';
9
+ import RemoveFormatCommand from './removeformatcommand';
10
+ /**
11
+ * The remove format editing plugin.
12
+ *
13
+ * It registers the {@link module:remove-format/removeformatcommand~RemoveFormatCommand removeFormat} command.
14
+ */
15
+ export default class RemoveFormatEditing extends Plugin {
16
+ /**
17
+ * @inheritDoc
18
+ */
19
+ static get pluginName() {
20
+ return 'RemoveFormatEditing';
21
+ }
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ init() {
26
+ const editor = this.editor;
27
+ editor.commands.add('removeFormat', new RemoveFormatCommand(editor));
28
+ }
29
+ }
@@ -1,22 +1,22 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module remove-format/removeformatui
7
- */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- /**
10
- * The remove format UI plugin. It registers the `'removeFormat'` button which can be
11
- * used in the toolbar.
12
- */
13
- export default class RemoveFormatUI extends Plugin {
14
- /**
15
- * @inheritDoc
16
- */
17
- static get pluginName(): "RemoveFormatUI";
18
- /**
19
- * @inheritDoc
20
- */
21
- init(): void;
22
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module remove-format/removeformatui
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core';
9
+ /**
10
+ * The remove format UI plugin. It registers the `'removeFormat'` button which can be
11
+ * used in the toolbar.
12
+ */
13
+ export default class RemoveFormatUI extends Plugin {
14
+ /**
15
+ * @inheritDoc
16
+ */
17
+ static get pluginName(): "RemoveFormatUI";
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ init(): void;
22
+ }
@@ -1,46 +1,46 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module remove-format/removeformatui
7
- */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import { ButtonView } from 'ckeditor5/src/ui';
10
- import removeFormatIcon from '../theme/icons/remove-format.svg';
11
- const REMOVE_FORMAT = 'removeFormat';
12
- /**
13
- * The remove format UI plugin. It registers the `'removeFormat'` button which can be
14
- * used in the toolbar.
15
- */
16
- export default class RemoveFormatUI extends Plugin {
17
- /**
18
- * @inheritDoc
19
- */
20
- static get pluginName() {
21
- return 'RemoveFormatUI';
22
- }
23
- /**
24
- * @inheritDoc
25
- */
26
- init() {
27
- const editor = this.editor;
28
- const t = editor.t;
29
- editor.ui.componentFactory.add(REMOVE_FORMAT, locale => {
30
- const command = editor.commands.get(REMOVE_FORMAT);
31
- const view = new ButtonView(locale);
32
- view.set({
33
- label: t('Remove Format'),
34
- icon: removeFormatIcon,
35
- tooltip: true
36
- });
37
- view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');
38
- // Execute the command.
39
- this.listenTo(view, 'execute', () => {
40
- editor.execute(REMOVE_FORMAT);
41
- editor.editing.view.focus();
42
- });
43
- return view;
44
- });
45
- }
46
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module remove-format/removeformatui
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core';
9
+ import { ButtonView } from 'ckeditor5/src/ui';
10
+ import removeFormatIcon from '../theme/icons/remove-format.svg';
11
+ const REMOVE_FORMAT = 'removeFormat';
12
+ /**
13
+ * The remove format UI plugin. It registers the `'removeFormat'` button which can be
14
+ * used in the toolbar.
15
+ */
16
+ export default class RemoveFormatUI extends Plugin {
17
+ /**
18
+ * @inheritDoc
19
+ */
20
+ static get pluginName() {
21
+ return 'RemoveFormatUI';
22
+ }
23
+ /**
24
+ * @inheritDoc
25
+ */
26
+ init() {
27
+ const editor = this.editor;
28
+ const t = editor.t;
29
+ editor.ui.componentFactory.add(REMOVE_FORMAT, locale => {
30
+ const command = editor.commands.get(REMOVE_FORMAT);
31
+ const view = new ButtonView(locale);
32
+ view.set({
33
+ label: t('Remove Format'),
34
+ icon: removeFormatIcon,
35
+ tooltip: true
36
+ });
37
+ view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');
38
+ // Execute the command.
39
+ this.listenTo(view, 'execute', () => {
40
+ editor.execute(REMOVE_FORMAT);
41
+ editor.editing.view.focus();
42
+ });
43
+ return view;
44
+ });
45
+ }
46
+ }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["webpack://CKEditor5.removeFormat/./theme/icons/remove-format.svg","webpack://CKEditor5.removeFormat/./src/removeformat.js","webpack://CKEditor5.removeFormat/./src/removeformatcommand.js","webpack://CKEditor5.removeFormat/./src/removeformatediting.js","webpack://CKEditor5.removeFormat/./src/removeformatui.js","webpack://CKEditor5.removeFormat/delegated \"./src/core.js\" from dll-reference CKEditor5.dll","webpack://CKEditor5.removeFormat/delegated \"./src/ui.js\" from dll-reference CKEditor5.dll","webpack://CKEditor5.removeFormat/delegated \"./src/utils.js\" from dll-reference CKEditor5.dll","webpack://CKEditor5.removeFormat/external var \"CKEditor5.dll\"","webpack://CKEditor5.removeFormat/webpack/bootstrap","webpack://CKEditor5.removeFormat/webpack/runtime/define property getters","webpack://CKEditor5.removeFormat/webpack/runtime/hasOwnProperty shorthand","webpack://CKEditor5.removeFormat/webpack/runtime/make namespace object","webpack://CKEditor5.removeFormat/./src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,iEAAe,40BAA40B;;;;;;;;;;;;;;;;;;ACA31B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAE4C;;AAEE;AACU;;AAExD;AACA;AACA;AACA,4CAA4C;AAC5C,QAAQ,0DAA0D;AAClE;AACA,2CAA2C,6CAA6C;AACxF;AACA;AACA;AACe,2BAA2B,sDAAM;AAChD;AACA;AACA;AACA;AACA,WAAW,4DAAmB,EAAE,uDAAc;AAC9C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;ACtCA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAE6C;AACD;;AAE5C;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACe,kCAAkC,uDAAO;AACxD;AACA;AACA;AACA;AACA;;AAEA,qBAAqB,0DAAK;AAC1B;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,yDAAyD;AACrE,YAAY,mCAAmC;AAC/C,cAAc;AACd;AACA;AACA;AACA,YAAY,0DAAK;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,uFAAuF;AACnG,YAAY,mCAAmC;AAC/C,cAAc,mBAAmB;AACjC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;ACjHA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAE4C;;AAEY;;AAExD;AACA;AACA;AACA,qBAAqB,iFAAiF;AACtG;AACA;AACA;AACe,kCAAkC,sDAAM;AACvD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,2CAA2C,4DAAmB;AAC9D;AACA;;;;;;;;;;;;;;;;;;;ACpCA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAE4C;AACE;;AAEkB;;AAEhE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACe,6BAA6B,sDAAM;AAClD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,wDAAU;;AAE9B;AACA;AACA,UAAU,sEAAgB;AAC1B;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,IAAI;AACJ;AACA;;;;;;;;;;;AC1DA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;;;;ACNA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEyD;AACc;AACV","file":"remove-format.js","sourcesContent":["export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M8.69 14.915c.053.052.173.083.36.093a.366.366 0 0 1 .345.485l-.003.01a.738.738 0 0 1-.697.497h-2.67a.374.374 0 0 1-.353-.496l.013-.038a.681.681 0 0 1 .644-.458c.197-.012.325-.043.386-.093a.28.28 0 0 0 .072-.11L9.592 4.5H6.269c-.359-.017-.609.013-.75.09-.142.078-.289.265-.442.563-.192.29-.516.464-.864.464H4.17a.43.43 0 0 1-.407-.569L4.46 3h13.08l-.62 2.043a.81.81 0 0 1-.775.574h-.114a.486.486 0 0 1-.486-.486c.001-.284-.054-.464-.167-.54-.112-.076-.367-.106-.766-.091h-3.28l-2.68 10.257c-.006.074.007.127.038.158zM3 17h8a.5.5 0 1 1 0 1H3a.5.5 0 1 1 0-1zm11.299 1.17a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.06-1.06l1.415 1.414 1.414-1.415a.75.75 0 1 1 1.06 1.06l-1.413 1.415 1.414 1.415a.75.75 0 0 1-1.06 1.06l-1.415-1.414-1.414 1.414z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module remove-format/removeformat\n */\n\nimport { Plugin } from 'ckeditor5/src/core';\n\nimport RemoveFormatUI from './removeformatui';\nimport RemoveFormatEditing from './removeformatediting';\n\n/**\n * The remove format plugin.\n *\n * This is a \"glue\" plugin which loads the {@link module:remove-format/removeformatediting~RemoveFormatEditing}\n * and {@link module:remove-format/removeformatui~RemoveFormatUI} plugins.\n *\n * For a detailed overview, check out the {@glink features/remove-format remove format} feature documentation.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class RemoveFormat extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get requires() {\n\t\treturn [ RemoveFormatEditing, RemoveFormatUI ];\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'RemoveFormat';\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module remove-format/removeformatcommand\n */\n\nimport { Command } from 'ckeditor5/src/core';\nimport { first } from 'ckeditor5/src/utils';\n\n/**\n * The remove format command.\n *\n * It is used by the {@link module:remove-format/removeformat~RemoveFormat remove format feature}\n * to clear the formatting in the selection.\n *\n *\t\teditor.execute( 'removeFormat' );\n *\n * @extends module:core/command~Command\n */\nexport default class RemoveFormatCommand extends Command {\n\t/**\n\t * @inheritDoc\n\t */\n\trefresh() {\n\t\tconst model = this.editor.model;\n\n\t\tthis.isEnabled = !!first( this._getFormattingItems( model.document.selection, model.schema ) );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\texecute() {\n\t\tconst model = this.editor.model;\n\t\tconst schema = model.schema;\n\n\t\tmodel.change( writer => {\n\t\t\tfor ( const item of this._getFormattingItems( model.document.selection, schema ) ) {\n\t\t\t\tif ( item.is( 'selection' ) ) {\n\t\t\t\t\tfor ( const attributeName of this._getFormattingAttributes( item, schema ) ) {\n\t\t\t\t\t\twriter.removeSelectionAttribute( attributeName );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Workaround for items with multiple removable attributes. See\n\t\t\t\t\t// https://github.com/ckeditor/ckeditor5-remove-format/pull/1#pullrequestreview-220515609\n\t\t\t\t\tconst itemRange = writer.createRangeOn( item );\n\n\t\t\t\t\tfor ( const attributeName of this._getFormattingAttributes( item, schema ) ) {\n\t\t\t\t\t\twriter.removeAttribute( attributeName, itemRange );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t/**\n\t * Returns an iterable of items in a selection (including the selection itself) that have formatting model\n\t * attributes to be removed by the feature.\n\t *\n\t * @protected\n\t * @param {module:engine/model/documentselection~DocumentSelection} selection\n\t * @param {module:engine/model/schema~Schema} schema The schema describing the item.\n\t * @returns {Iterable.<module:engine/model/item~Item>|Iterable.<module:engine/model/documentselection~DocumentSelection>}\n\t */\n\t* _getFormattingItems( selection, schema ) {\n\t\tconst itemHasRemovableFormatting = item => {\n\t\t\treturn !!first( this._getFormattingAttributes( item, schema ) );\n\t\t};\n\n\t\t// Check formatting on selected items that are not blocks.\n\t\tfor ( const curRange of selection.getRanges() ) {\n\t\t\tfor ( const item of curRange.getItems() ) {\n\t\t\t\tif ( !schema.isBlock( item ) && itemHasRemovableFormatting( item ) ) {\n\t\t\t\t\tyield item;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check formatting from selected blocks.\n\t\tfor ( const block of selection.getSelectedBlocks() ) {\n\t\t\tif ( itemHasRemovableFormatting( block ) ) {\n\t\t\t\tyield block;\n\t\t\t}\n\t\t}\n\n\t\t// Finally the selection might be formatted as well, so make sure to check it.\n\t\tif ( itemHasRemovableFormatting( selection ) ) {\n\t\t\tyield selection;\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterable of formatting attributes of a given model item.\n\t *\n\t * **Note:** Formatting items have the `isFormatting` property set to `true`.\n\t *\n\t * @protected\n\t * @param {module:engine/model/item~Item|module:engine/model/documentselection~DocumentSelection} item\n\t * @param {module:engine/model/schema~Schema} schema The schema describing the item.\n\t * @returns {Iterable.<String>} The names of formatting attributes found in a given item.\n\t */\n\t* _getFormattingAttributes( item, schema ) {\n\t\tfor ( const [ attributeName ] of item.getAttributes() ) {\n\t\t\tconst attributeProperties = schema.getAttributeProperties( attributeName );\n\n\t\t\tif ( attributeProperties && attributeProperties.isFormatting ) {\n\t\t\t\tyield attributeName;\n\t\t\t}\n\t\t}\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module remove-format/removeformatediting\n */\n\nimport { Plugin } from 'ckeditor5/src/core';\n\nimport RemoveFormatCommand from './removeformatcommand';\n\n/**\n * The remove format editing plugin.\n *\n * It registers the {@link module:remove-format/removeformatcommand~RemoveFormatCommand removeFormat} command.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class RemoveFormatEditing extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'RemoveFormatEditing';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tconst editor = this.editor;\n\n\t\teditor.commands.add( 'removeFormat', new RemoveFormatCommand( editor ) );\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module remove-format/removeformatui\n */\n\nimport { Plugin } from 'ckeditor5/src/core';\nimport { ButtonView } from 'ckeditor5/src/ui';\n\nimport removeFormatIcon from '../theme/icons/remove-format.svg';\n\nconst REMOVE_FORMAT = 'removeFormat';\n\n/**\n * The remove format UI plugin. It registers the `'removeFormat'` button which can be\n * used in the toolbar.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class RemoveFormatUI extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'RemoveFormatUI';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst t = editor.t;\n\n\t\teditor.ui.componentFactory.add( REMOVE_FORMAT, locale => {\n\t\t\tconst command = editor.commands.get( REMOVE_FORMAT );\n\t\t\tconst view = new ButtonView( locale );\n\n\t\t\tview.set( {\n\t\t\t\tlabel: t( 'Remove Format' ),\n\t\t\t\ticon: removeFormatIcon,\n\t\t\t\ttooltip: true\n\t\t\t} );\n\n\t\t\tview.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );\n\n\t\t\t// Execute the command.\n\t\t\tthis.listenTo( view, 'execute', () => {\n\t\t\t\teditor.execute( REMOVE_FORMAT );\n\t\t\t\teditor.editing.view.focus();\n\t\t\t} );\n\n\t\t\treturn view;\n\t\t} );\n\t}\n}\n","module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ \"dll-reference CKEditor5.dll\"))(\"./src/core.js\");","module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ \"dll-reference CKEditor5.dll\"))(\"./src/ui.js\");","module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ \"dll-reference CKEditor5.dll\"))(\"./src/utils.js\");","module.exports = CKEditor5.dll;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module remove-format\n */\n\nexport { default as RemoveFormat } from './removeformat';\nexport { default as RemoveFormatEditing } from './removeformatediting';\nexport { default as RemoveFormatUI } from './removeformatui';\n"],"sourceRoot":""}