@ckeditor/ckeditor5-remove-format 45.2.1 → 46.0.0-alpha.1

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.
@@ -2,4 +2,4 @@
2
2
  /*!
3
3
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
4
4
  * For licensing, see LICENSE.md.
5
- */(()=>{var t={237:t=>{"use strict";t.exports=CKEditor5.dll},311:(t,e,o)=>{t.exports=o(237)("./src/ui.js")},355:(t,e,o)=>{t.exports=o(237)("./src/icons.js")},584:(t,e,o)=>{t.exports=o(237)("./src/utils.js")},782:(t,e,o)=>{t.exports=o(237)("./src/core.js")}},e={};function o(i){var r=e[i];if(void 0!==r)return r.exports;var s=e[i]={exports:{}};return t[i](s,s.exports,o),s.exports}o.d=(t,e)=>{for(var i in e)o.o(e,i)&&!o.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};(()=>{"use strict";o.r(i),o.d(i,{RemoveFormat:()=>u,RemoveFormatEditing:()=>m,RemoveFormatUI:()=>n});var t=o(782),e=o(355),r=o(311);const s="removeFormat";class n extends t.Plugin{static get pluginName(){return"RemoveFormatUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.ui.componentFactory.add(s,()=>{const t=this._createButton(r.ButtonView);return t.set({tooltip:!0}),t}),t.ui.componentFactory.add(`menuBar:${s}`,()=>this._createButton(r.MenuBarMenuListItemButtonView))}_createButton(t){const o=this.editor,i=o.locale,r=o.commands.get(s),n=new t(o.locale),a=i.t;return n.set({label:a("Remove Format"),icon:e.IconRemoveFormat}),n.bind("isEnabled").to(r,"isEnabled"),this.listenTo(n,"execute",()=>{o.execute(s),o.editing.view.focus()}),n}}var a=o(584);class c extends t.Command{refresh(){const t=this.editor.model;this.isEnabled=!!(0,a.first)(this._getFormattingItems(t.document.selection,t.schema))}execute(){const t=this.editor.model,e=t.schema;t.change(o=>{for(const i of this._getFormattingItems(t.document.selection,e))if(i.is("selection"))for(const t of this._getFormattingAttributes(i,e))o.removeSelectionAttribute(t);else{const t=o.createRangeOn(i);for(const r of this._getFormattingAttributes(i,e))o.removeAttribute(r,t)}})}*_getFormattingItems(t,e){const o=t=>!!(0,a.first)(this._getFormattingAttributes(t,e));for(const i of t.getRanges())for(const t of i.getItems())!e.isBlock(t)&&o(t)&&(yield t);for(const e of t.getSelectedBlocks())o(e)&&(yield e);o(t)&&(yield t)}*_getFormattingAttributes(t,e){for(const[o]of t.getAttributes()){const t=e.getAttributeProperties(o);t&&t.isFormatting&&(yield o)}}}class m extends t.Plugin{static get pluginName(){return"RemoveFormatEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.commands.add("removeFormat",new c(t))}}class u extends t.Plugin{static get requires(){return[m,n]}static get pluginName(){return"RemoveFormat"}static get isOfficialPlugin(){return!0}}})(),(window.CKEditor5=window.CKEditor5||{}).removeFormat=i})();
5
+ */(()=>{var t={237:t=>{"use strict";t.exports=CKEditor5.dll},311:(t,e,o)=>{t.exports=o(237)("./src/ui.js")},355:(t,e,o)=>{t.exports=o(237)("./src/icons.js")},584:(t,e,o)=>{t.exports=o(237)("./src/utils.js")},782:(t,e,o)=>{t.exports=o(237)("./src/core.js")}},e={};function o(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r](s,s.exports,o),s.exports}o.d=(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};(()=>{"use strict";o.r(r),o.d(r,{RemoveFormat:()=>u,RemoveFormatCommand:()=>c,RemoveFormatEditing:()=>m,RemoveFormatUI:()=>n});var t=o(782),e=o(355),i=o(311);const s="removeFormat";class n extends t.Plugin{static get pluginName(){return"RemoveFormatUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.ui.componentFactory.add(s,()=>{const t=this._createButton(i.ButtonView);return t.set({tooltip:!0}),t}),t.ui.componentFactory.add(`menuBar:${s}`,()=>this._createButton(i.MenuBarMenuListItemButtonView))}_createButton(t){const o=this.editor,r=o.locale,i=o.commands.get(s),n=new t(o.locale),a=r.t;return n.set({label:a("Remove Format"),icon:e.IconRemoveFormat}),n.bind("isEnabled").to(i,"isEnabled"),this.listenTo(n,"execute",()=>{o.execute(s),o.editing.view.focus()}),n}}var a=o(584);class c extends t.Command{_customAttributesHandlers=[];refresh(){const t=this.editor.model;this.isEnabled=!!(0,a.first)(this._getFormattingItems(t.document.selection,t.schema))}execute(){const t=this.editor.model,e=t.schema;t.change(o=>{for(const r of this._getFormattingItems(t.document.selection,e))if(r.is("selection"))for(const t of this._getFormattingAttributes(r,e))o.removeSelectionAttribute(t);else{const t=o.createRangeOn(r);for(const i of this._getFormattingAttributes(r,e))this._removeFormatting(i,r,t,o)}})}registerCustomAttribute(t,e){this._customAttributesHandlers.push({isFormatting:t,removeFormatting:e})}_removeFormatting(t,e,o,r){let i=!1;for(const{isFormatting:s,removeFormatting:n}of this._customAttributesHandlers)s(t,e)&&(n(t,o,r),i=!0);i||r.removeAttribute(t,o)}*_getFormattingItems(t,e){const o=t=>!!(0,a.first)(this._getFormattingAttributes(t,e));for(const r of t.getRanges())for(const t of r.getItems())!e.isBlock(t)&&o(t)&&(yield t);for(const e of t.getSelectedBlocks())o(e)&&(yield e);o(t)&&(yield t)}*_getFormattingAttributes(t,e){for(const[o]of t.getAttributes()){for(const{isFormatting:e}of this._customAttributesHandlers)e(o,t)&&(yield o);const r=e.getAttributeProperties(o);r&&r.isFormatting&&(yield o)}}}class m extends t.Plugin{static get pluginName(){return"RemoveFormatEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.commands.add("removeFormat",new c(t))}}class u extends t.Plugin{static get requires(){return[m,n]}static get pluginName(){return"RemoveFormat"}static get isOfficialPlugin(){return!0}}})(),(window.CKEditor5=window.CKEditor5||{}).removeFormat=r})();
package/dist/index.js CHANGED
@@ -67,6 +67,9 @@ const REMOVE_FORMAT = 'removeFormat';
67
67
  * editor.execute( 'removeFormat' );
68
68
  * ```
69
69
  */ class RemoveFormatCommand extends Command {
70
+ /**
71
+ * List of all registered custom attribute handlers.
72
+ */ _customAttributesHandlers = [];
70
73
  /**
71
74
  * @inheritDoc
72
75
  */ refresh() {
@@ -89,12 +92,36 @@ const REMOVE_FORMAT = 'removeFormat';
89
92
  // https://github.com/ckeditor/ckeditor5-remove-format/pull/1#pullrequestreview-220515609
90
93
  const itemRange = writer.createRangeOn(item);
91
94
  for (const attributeName of this._getFormattingAttributes(item, schema)){
92
- writer.removeAttribute(attributeName, itemRange);
95
+ this._removeFormatting(attributeName, item, itemRange, writer);
93
96
  }
94
97
  }
95
98
  }
96
99
  });
97
100
  }
101
+ /**
102
+ * Registers a custom attribute handler that will be used to determine if an attribute is formatting and how to remove it.
103
+ *
104
+ * @internal
105
+ */ registerCustomAttribute(isFormatting, removeFormatting) {
106
+ this._customAttributesHandlers.push({
107
+ isFormatting,
108
+ removeFormatting
109
+ });
110
+ }
111
+ /**
112
+ * Helper method that removes a formatting attribute from an item either using custom callbacks or writer remove attribute.
113
+ */ _removeFormatting(attributeName, item, itemRange, writer) {
114
+ let customHandled = false;
115
+ for (const { isFormatting, removeFormatting } of this._customAttributesHandlers){
116
+ if (isFormatting(attributeName, item)) {
117
+ removeFormatting(attributeName, itemRange, writer);
118
+ customHandled = true;
119
+ }
120
+ }
121
+ if (!customHandled) {
122
+ writer.removeAttribute(attributeName, itemRange);
123
+ }
124
+ }
98
125
  /**
99
126
  * Returns an iterable of items in a selection (including the selection itself) that have formatting model
100
127
  * attributes to be removed by the feature.
@@ -132,6 +159,11 @@ const REMOVE_FORMAT = 'removeFormat';
132
159
  * @returns The names of formatting attributes found in a given item.
133
160
  */ *_getFormattingAttributes(item, schema) {
134
161
  for (const [attributeName] of item.getAttributes()){
162
+ for (const { isFormatting } of this._customAttributesHandlers){
163
+ if (isFormatting(attributeName, item)) {
164
+ yield attributeName;
165
+ }
166
+ }
135
167
  const attributeProperties = schema.getAttributeProperties(attributeName);
136
168
  if (attributeProperties && attributeProperties.isFormatting) {
137
169
  yield attributeName;
@@ -191,5 +223,5 @@ const REMOVE_FORMAT = 'removeFormat';
191
223
  }
192
224
  }
193
225
 
194
- export { RemoveFormat, RemoveFormatEditing, RemoveFormatUI };
226
+ export { RemoveFormat, RemoveFormatCommand, RemoveFormatEditing, RemoveFormatUI };
195
227
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js","../src/removeformatui.ts","../src/removeformatcommand.ts","../src/removeformatediting.ts","../src/removeformat.ts"],"names":["REMOVE_FORMAT","RemoveFormatUI","Plugin","pluginName","isOfficialPlugin","init","editor","ui","componentFactory","add","view","_createButton","ButtonView","set","tooltip","MenuBarMenuListItemButtonView","ButtonClass","locale","command","commands","get","t","label","icon","IconRemoveFormat","bind","to","listenTo","execute","editing","focus","RemoveFormatCommand","Command","refresh","model","isEnabled","first","_getFormattingItems","document","selection","schema","change","writer","item","is","attributeName","_getFormattingAttributes","removeSelectionAttribute","itemRange","createRangeOn","removeAttribute","itemHasRemovableFormatting","curRange","getRanges","getItems","isBlock","block","getSelectedBlocks","getAttributes","attributeProperties","getAttributeProperties","isFormatting","RemoveFormatEditing","RemoveFormat","requires"],"mappings":";;;;AAAA,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CA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A,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA;AAAgB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAC/C,CAAA,CAAA,CAAA,CAAA;AAEA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AJoJD,CAAC,CAAC,CAAC,CAAC,CAAC;AIlJH,CAAA,CAAA,CAAA,CAAA,CACD,MAAA,CAAA,GAAA,CAAkBE,UAAAA,CAAAA,CAAAA,CAAa;AJmJhC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CIlJL,MAAA,CAAO,CAAA,YAAA,CAAA;AACR,CAAA,CAAA,CAAA,CAAA;AAEA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AJkJD,CAAC,CAAC,CAAC,CAAC,CAAC;AIhJH,CAAA,CAAA,CAAA,CAAA,CACD,MAAA,CAAA,GAAA,CAA2BC,gBAAAA,CAAAA,CAAAA,CAAyB;AJiJrD,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CIhJL,MAAA,CAAO,IAAA;AACR,CAAA,CAAA,CAAA,CAAA;AACD;;AJkJA,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,mBAAmB,CAAC,CAAC,cAAc,CAAC,CAAC;AAC5D,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC","file":"index.js.map","sourcesContent":["import { Plugin, Command } from '@ckeditor/ckeditor5-core/dist/index.js';\nimport { IconRemoveFormat } from '@ckeditor/ckeditor5-icons/dist/index.js';\nimport { ButtonView, MenuBarMenuListItemButtonView } from '@ckeditor/ckeditor5-ui/dist/index.js';\nimport { first } from '@ckeditor/ckeditor5-utils/dist/index.js';\n\nconst REMOVE_FORMAT = 'removeFormat';\n/**\n * The remove format UI plugin. It registers the `'removeFormat'` button which can be\n * used in the toolbar.\n */ class RemoveFormatUI extends Plugin {\n /**\n\t * @inheritDoc\n\t */ static get pluginName() {\n return 'RemoveFormatUI';\n }\n /**\n\t * @inheritDoc\n\t */ static get isOfficialPlugin() {\n return true;\n }\n /**\n\t * @inheritDoc\n\t */ init() {\n const editor = this.editor;\n editor.ui.componentFactory.add(REMOVE_FORMAT, ()=>{\n const view = this._createButton(ButtonView);\n view.set({\n tooltip: true\n });\n return view;\n });\n editor.ui.componentFactory.add(`menuBar:${REMOVE_FORMAT}`, ()=>this._createButton(MenuBarMenuListItemButtonView));\n }\n /**\n\t * Creates a button for remove format command to use either in toolbar or in menu bar.\n\t */ _createButton(ButtonClass) {\n const editor = this.editor;\n const locale = editor.locale;\n const command = editor.commands.get(REMOVE_FORMAT);\n const view = new ButtonClass(editor.locale);\n const t = locale.t;\n view.set({\n label: t('Remove Format'),\n icon: IconRemoveFormat\n });\n view.bind('isEnabled').to(command, 'isEnabled');\n // Execute the command.\n this.listenTo(view, 'execute', ()=>{\n editor.execute(REMOVE_FORMAT);\n editor.editing.view.focus();\n });\n return view;\n }\n}\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 * ```ts\n * editor.execute( 'removeFormat' );\n * ```\n */ class RemoveFormatCommand extends Command {\n /**\n\t * @inheritDoc\n\t */ refresh() {\n const model = this.editor.model;\n this.isEnabled = !!first(this._getFormattingItems(model.document.selection, model.schema));\n }\n /**\n\t * @inheritDoc\n\t */ execute() {\n const model = this.editor.model;\n const schema = model.schema;\n model.change((writer)=>{\n for (const item of this._getFormattingItems(model.document.selection, schema)){\n if (item.is('selection')) {\n for (const attributeName of this._getFormattingAttributes(item, schema)){\n writer.removeSelectionAttribute(attributeName);\n }\n } else {\n // Workaround for items with multiple removable attributes. See\n // https://github.com/ckeditor/ckeditor5-remove-format/pull/1#pullrequestreview-220515609\n const itemRange = writer.createRangeOn(item);\n for (const attributeName of this._getFormattingAttributes(item, schema)){\n writer.removeAttribute(attributeName, itemRange);\n }\n }\n }\n });\n }\n /**\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 * @param schema The schema describing the item.\n\t */ *_getFormattingItems(selection, schema) {\n const itemHasRemovableFormatting = (item)=>{\n return !!first(this._getFormattingAttributes(item, schema));\n };\n // Check formatting on selected items that are not blocks.\n for (const curRange of selection.getRanges()){\n for (const item of curRange.getItems()){\n if (!schema.isBlock(item) && itemHasRemovableFormatting(item)) {\n yield item;\n }\n }\n }\n // Check formatting from selected blocks.\n for (const block of selection.getSelectedBlocks()){\n if (itemHasRemovableFormatting(block)) {\n yield block;\n }\n }\n // Finally the selection might be formatted as well, so make sure to check it.\n if (itemHasRemovableFormatting(selection)) {\n yield selection;\n }\n }\n /**\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 * @param schema The schema describing the item.\n\t * @returns The names of formatting attributes found in a given item.\n\t */ *_getFormattingAttributes(item, schema) {\n for (const [attributeName] of item.getAttributes()){\n const attributeProperties = schema.getAttributeProperties(attributeName);\n if (attributeProperties && attributeProperties.isFormatting) {\n yield attributeName;\n }\n }\n }\n}\n\n/**\n * The remove format editing plugin.\n *\n * It registers the {@link module:remove-format/removeformatcommand~RemoveFormatCommand removeFormat} command.\n */ class RemoveFormatEditing extends Plugin {\n /**\n\t * @inheritDoc\n\t */ static get pluginName() {\n return 'RemoveFormatEditing';\n }\n /**\n\t * @inheritDoc\n\t */ static get isOfficialPlugin() {\n return true;\n }\n /**\n\t * @inheritDoc\n\t */ init() {\n const editor = this.editor;\n editor.commands.add('removeFormat', new RemoveFormatCommand(editor));\n }\n}\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 */ class RemoveFormat extends Plugin {\n /**\n\t * @inheritDoc\n\t */ static get requires() {\n return [\n RemoveFormatEditing,\n RemoveFormatUI\n ];\n }\n /**\n\t * @inheritDoc\n\t */ static get pluginName() {\n return 'RemoveFormat';\n }\n /**\n\t * @inheritDoc\n\t */ static get isOfficialPlugin() {\n return true;\n }\n}\n\nexport { RemoveFormat, RemoveFormatEditing, RemoveFormatUI };\n//# sourceMappingURL=index.js.map\n","/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n/**\n * @module remove-format/removeformatui\n */\n\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { IconRemoveFormat } from 'ckeditor5/src/icons.js';\nimport { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';\n\nimport type RemoveFormatCommand from './removeformatcommand.js';\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 */\nexport default class RemoveFormatUI extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get pluginName() {\n\t\treturn 'RemoveFormatUI' as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static override get isOfficialPlugin(): true {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic init(): void {\n\t\tconst editor = this.editor;\n\n\t\teditor.ui.componentFactory.add( REMOVE_FORMAT, () => {\n\t\t\tconst view = this._createButton( ButtonView );\n\n\t\t\tview.set( {\n\t\t\t\ttooltip: true\n\t\t\t} );\n\n\t\t\treturn view;\n\t\t} );\n\n\t\teditor.ui.componentFactory.add( `menuBar:${ REMOVE_FORMAT }`, () => this._createButton( MenuBarMenuListItemButtonView ) );\n\t}\n\n\t/**\n\t * Creates a button for remove format command to use either in toolbar or in menu bar.\n\t */\n\tprivate _createButton<T extends typeof ButtonView | typeof MenuBarMenuListItemButtonView>( ButtonClass: T ): InstanceType<T> {\n\t\tconst editor = this.editor;\n\t\tconst locale = editor.locale;\n\t\tconst command: RemoveFormatCommand = editor.commands.get( REMOVE_FORMAT )!;\n\t\tconst view = new ButtonClass( editor.locale ) as InstanceType<T>;\n\t\tconst t = locale.t;\n\n\t\tview.set( {\n\t\t\tlabel: t( 'Remove Format' ),\n\t\t\ticon: IconRemoveFormat\n\t\t} );\n\n\t\tview.bind( 'isEnabled' ).to( command, 'isEnabled' );\n\n\t\t// Execute the command.\n\t\tthis.listenTo( view, 'execute', () => {\n\t\t\teditor.execute( REMOVE_FORMAT );\n\t\t\teditor.editing.view.focus();\n\t\t} );\n\n\t\treturn view;\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n/**\n * @module remove-format/removeformatcommand\n */\n\nimport type { DocumentSelection, Item, Schema } from 'ckeditor5/src/engine.js';\nimport { Command } from 'ckeditor5/src/core.js';\nimport { first } from 'ckeditor5/src/utils.js';\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 * ```ts\n * editor.execute( 'removeFormat' );\n * ```\n */\nexport default class RemoveFormatCommand extends Command {\n\tdeclare public value: boolean;\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic override refresh(): void {\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\tpublic override execute(): void {\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 * @param schema The schema describing the item.\n\t */\n\tprivate* _getFormattingItems( selection: DocumentSelection, schema: Schema ) {\n\t\tconst itemHasRemovableFormatting = ( item: Item | DocumentSelection ) => {\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 * @param schema The schema describing the item.\n\t * @returns The names of formatting attributes found in a given item.\n\t */\n\tprivate* _getFormattingAttributes( item: Item | DocumentSelection, schema: 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-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n/**\n * @module remove-format/removeformatediting\n */\n\nimport { Plugin } from 'ckeditor5/src/core.js';\n\nimport RemoveFormatCommand from './removeformatcommand.js';\n\n/**\n * The remove format editing plugin.\n *\n * It registers the {@link module:remove-format/removeformatcommand~RemoveFormatCommand removeFormat} command.\n */\nexport default class RemoveFormatEditing extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get pluginName() {\n\t\treturn 'RemoveFormatEditing' as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static override get isOfficialPlugin(): true {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic init(): void {\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-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n/**\n * @module remove-format/removeformat\n */\n\nimport { Plugin } from 'ckeditor5/src/core.js';\n\nimport RemoveFormatUI from './removeformatui.js';\nimport RemoveFormatEditing from './removeformatediting.js';\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 */\nexport default class RemoveFormat extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get requires() {\n\t\treturn [ RemoveFormatEditing, RemoveFormatUI ] as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get pluginName() {\n\t\treturn 'RemoveFormat' as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static override get isOfficialPlugin(): true {\n\t\treturn true;\n\t}\n}\n"]}
1
+ {"version":3,"sources":["index.js","../src/removeformatui.ts","../src/removeformatcommand.ts","../src/removeformatediting.ts","../src/removeformat.ts"],"names":["REMOVE_FORMAT","RemoveFormatUI","Plugin","pluginName","isOfficialPlugin","init","editor","ui","componentFactory","add","view","_createButton","ButtonView","set","tooltip","MenuBarMenuListItemButtonView","ButtonClass","locale","command","commands","get","t","label","icon","IconRemoveFormat","bind","to","listenTo","execute","editing","focus","RemoveFormatCommand","Command","_customAttributesHandlers","refresh","model","isEnabled","first","_getFormattingItems","document","selection","schema","change","writer","item","is","attributeName","_getFormattingAttributes","removeSelectionAttribute","itemRange","createRangeOn","_removeFormatting","registerCustomAttribute","isFormatting","removeFormatting","push","customHandled","removeAttribute","itemHasRemovableFormatting","curRange","getRanges","getItems","isBlock","block","getSelectedBlocks","getAttributes","attributeProperties","getAttributeProperties","RemoveFormatEditing","RemoveFormat","requires"],"mappings":";;;;AAAA,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;AACxE,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;AAC1E,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,E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,CAAA,CAAA,CAAA,CACD,MAAA,CAAA,GAAA,CAA2BC,gBAAAA,CAAAA,CAAAA,CAAyB;AJiLrD,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CIhLL,MAAA,CAAO,IAAA;AACR,CAAA,CAAA,CAAA,CAAA;AACD;;AJkLA,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,mBAAmB,CAAC,CAAC,mBAAmB,CAAC,CAAC,cAAc,CAAC,CAAC;AACjF,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC","file":"index.js.map","sourcesContent":["import { Plugin, Command } from '@ckeditor/ckeditor5-core/dist/index.js';\nimport { IconRemoveFormat } from '@ckeditor/ckeditor5-icons/dist/index.js';\nimport { ButtonView, MenuBarMenuListItemButtonView } from '@ckeditor/ckeditor5-ui/dist/index.js';\nimport { first } from '@ckeditor/ckeditor5-utils/dist/index.js';\n\nconst REMOVE_FORMAT = 'removeFormat';\n/**\n * The remove format UI plugin. It registers the `'removeFormat'` button which can be\n * used in the toolbar.\n */ class RemoveFormatUI extends Plugin {\n /**\n\t * @inheritDoc\n\t */ static get pluginName() {\n return 'RemoveFormatUI';\n }\n /**\n\t * @inheritDoc\n\t */ static get isOfficialPlugin() {\n return true;\n }\n /**\n\t * @inheritDoc\n\t */ init() {\n const editor = this.editor;\n editor.ui.componentFactory.add(REMOVE_FORMAT, ()=>{\n const view = this._createButton(ButtonView);\n view.set({\n tooltip: true\n });\n return view;\n });\n editor.ui.componentFactory.add(`menuBar:${REMOVE_FORMAT}`, ()=>this._createButton(MenuBarMenuListItemButtonView));\n }\n /**\n\t * Creates a button for remove format command to use either in toolbar or in menu bar.\n\t */ _createButton(ButtonClass) {\n const editor = this.editor;\n const locale = editor.locale;\n const command = editor.commands.get(REMOVE_FORMAT);\n const view = new ButtonClass(editor.locale);\n const t = locale.t;\n view.set({\n label: t('Remove Format'),\n icon: IconRemoveFormat\n });\n view.bind('isEnabled').to(command, 'isEnabled');\n // Execute the command.\n this.listenTo(view, 'execute', ()=>{\n editor.execute(REMOVE_FORMAT);\n editor.editing.view.focus();\n });\n return view;\n }\n}\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 * ```ts\n * editor.execute( 'removeFormat' );\n * ```\n */ class RemoveFormatCommand extends Command {\n /**\n\t * List of all registered custom attribute handlers.\n\t */ _customAttributesHandlers = [];\n /**\n\t * @inheritDoc\n\t */ refresh() {\n const model = this.editor.model;\n this.isEnabled = !!first(this._getFormattingItems(model.document.selection, model.schema));\n }\n /**\n\t * @inheritDoc\n\t */ execute() {\n const model = this.editor.model;\n const schema = model.schema;\n model.change((writer)=>{\n for (const item of this._getFormattingItems(model.document.selection, schema)){\n if (item.is('selection')) {\n for (const attributeName of this._getFormattingAttributes(item, schema)){\n writer.removeSelectionAttribute(attributeName);\n }\n } else {\n // Workaround for items with multiple removable attributes. See\n // https://github.com/ckeditor/ckeditor5-remove-format/pull/1#pullrequestreview-220515609\n const itemRange = writer.createRangeOn(item);\n for (const attributeName of this._getFormattingAttributes(item, schema)){\n this._removeFormatting(attributeName, item, itemRange, writer);\n }\n }\n }\n });\n }\n /**\n\t * Registers a custom attribute handler that will be used to determine if an attribute is formatting and how to remove it.\n\t *\n\t * @internal\n\t */ registerCustomAttribute(isFormatting, removeFormatting) {\n this._customAttributesHandlers.push({\n isFormatting,\n removeFormatting\n });\n }\n /**\n\t * Helper method that removes a formatting attribute from an item either using custom callbacks or writer remove attribute.\n\t */ _removeFormatting(attributeName, item, itemRange, writer) {\n let customHandled = false;\n for (const { isFormatting, removeFormatting } of this._customAttributesHandlers){\n if (isFormatting(attributeName, item)) {\n removeFormatting(attributeName, itemRange, writer);\n customHandled = true;\n }\n }\n if (!customHandled) {\n writer.removeAttribute(attributeName, itemRange);\n }\n }\n /**\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 * @param schema The schema describing the item.\n\t */ *_getFormattingItems(selection, schema) {\n const itemHasRemovableFormatting = (item)=>{\n return !!first(this._getFormattingAttributes(item, schema));\n };\n // Check formatting on selected items that are not blocks.\n for (const curRange of selection.getRanges()){\n for (const item of curRange.getItems()){\n if (!schema.isBlock(item) && itemHasRemovableFormatting(item)) {\n yield item;\n }\n }\n }\n // Check formatting from selected blocks.\n for (const block of selection.getSelectedBlocks()){\n if (itemHasRemovableFormatting(block)) {\n yield block;\n }\n }\n // Finally the selection might be formatted as well, so make sure to check it.\n if (itemHasRemovableFormatting(selection)) {\n yield selection;\n }\n }\n /**\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 * @param schema The schema describing the item.\n\t * @returns The names of formatting attributes found in a given item.\n\t */ *_getFormattingAttributes(item, schema) {\n for (const [attributeName] of item.getAttributes()){\n for (const { isFormatting } of this._customAttributesHandlers){\n if (isFormatting(attributeName, item)) {\n yield attributeName;\n }\n }\n const attributeProperties = schema.getAttributeProperties(attributeName);\n if (attributeProperties && attributeProperties.isFormatting) {\n yield attributeName;\n }\n }\n }\n}\n\n/**\n * The remove format editing plugin.\n *\n * It registers the {@link module:remove-format/removeformatcommand~RemoveFormatCommand removeFormat} command.\n */ class RemoveFormatEditing extends Plugin {\n /**\n\t * @inheritDoc\n\t */ static get pluginName() {\n return 'RemoveFormatEditing';\n }\n /**\n\t * @inheritDoc\n\t */ static get isOfficialPlugin() {\n return true;\n }\n /**\n\t * @inheritDoc\n\t */ init() {\n const editor = this.editor;\n editor.commands.add('removeFormat', new RemoveFormatCommand(editor));\n }\n}\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 */ class RemoveFormat extends Plugin {\n /**\n\t * @inheritDoc\n\t */ static get requires() {\n return [\n RemoveFormatEditing,\n RemoveFormatUI\n ];\n }\n /**\n\t * @inheritDoc\n\t */ static get pluginName() {\n return 'RemoveFormat';\n }\n /**\n\t * @inheritDoc\n\t */ static get isOfficialPlugin() {\n return true;\n }\n}\n\nexport { RemoveFormat, RemoveFormatCommand, RemoveFormatEditing, RemoveFormatUI };\n//# sourceMappingURL=index.js.map\n","/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n/**\n * @module remove-format/removeformatui\n */\n\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { IconRemoveFormat } from 'ckeditor5/src/icons.js';\nimport { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';\n\nimport { type RemoveFormatCommand } from './removeformatcommand.js';\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 */\nexport class RemoveFormatUI extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get pluginName() {\n\t\treturn 'RemoveFormatUI' as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static override get isOfficialPlugin(): true {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic init(): void {\n\t\tconst editor = this.editor;\n\n\t\teditor.ui.componentFactory.add( REMOVE_FORMAT, () => {\n\t\t\tconst view = this._createButton( ButtonView );\n\n\t\t\tview.set( {\n\t\t\t\ttooltip: true\n\t\t\t} );\n\n\t\t\treturn view;\n\t\t} );\n\n\t\teditor.ui.componentFactory.add( `menuBar:${ REMOVE_FORMAT }`, () => this._createButton( MenuBarMenuListItemButtonView ) );\n\t}\n\n\t/**\n\t * Creates a button for remove format command to use either in toolbar or in menu bar.\n\t */\n\tprivate _createButton<T extends typeof ButtonView | typeof MenuBarMenuListItemButtonView>( ButtonClass: T ): InstanceType<T> {\n\t\tconst editor = this.editor;\n\t\tconst locale = editor.locale;\n\t\tconst command: RemoveFormatCommand = editor.commands.get( REMOVE_FORMAT )!;\n\t\tconst view = new ButtonClass( editor.locale ) as InstanceType<T>;\n\t\tconst t = locale.t;\n\n\t\tview.set( {\n\t\t\tlabel: t( 'Remove Format' ),\n\t\t\ticon: IconRemoveFormat\n\t\t} );\n\n\t\tview.bind( 'isEnabled' ).to( command, 'isEnabled' );\n\n\t\t// Execute the command.\n\t\tthis.listenTo( view, 'execute', () => {\n\t\t\teditor.execute( REMOVE_FORMAT );\n\t\t\teditor.editing.view.focus();\n\t\t} );\n\n\t\treturn view;\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n/**\n * @module remove-format/removeformatcommand\n */\n\nimport type { ModelDocumentSelection, ModelItem, ModelSchema, ModelRange, ModelWriter } from 'ckeditor5/src/engine.js';\nimport { Command } from 'ckeditor5/src/core.js';\nimport { first } from 'ckeditor5/src/utils.js';\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 * ```ts\n * editor.execute( 'removeFormat' );\n * ```\n */\nexport class RemoveFormatCommand extends Command {\n\tdeclare public value: boolean;\n\n\t/**\n\t * List of all registered custom attribute handlers.\n\t */\n\tprivate _customAttributesHandlers: Array<{\n\t\tisFormatting: IsFormattingCallback;\n\t\tremoveFormatting: RemoveFormattingCallback;\n\t}> = [];\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic override refresh(): void {\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\tpublic override execute(): void {\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\tthis._removeFormatting( attributeName, item, itemRange, writer );\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 * Registers a custom attribute handler that will be used to determine if an attribute is formatting and how to remove it.\n\t *\n\t * @internal\n\t */\n\tpublic registerCustomAttribute( isFormatting: IsFormattingCallback, removeFormatting: RemoveFormattingCallback ): void {\n\t\tthis._customAttributesHandlers.push( {\n\t\t\tisFormatting,\n\t\t\tremoveFormatting\n\t\t} );\n\t}\n\n\t/**\n\t * Helper method that removes a formatting attribute from an item either using custom callbacks or writer remove attribute.\n\t */\n\tprivate _removeFormatting( attributeName: string, item: ModelItem, itemRange: ModelRange, writer: ModelWriter ) {\n\t\tlet customHandled = false;\n\n\t\tfor ( const { isFormatting, removeFormatting } of this._customAttributesHandlers ) {\n\t\t\tif ( isFormatting( attributeName, item ) ) {\n\t\t\t\tremoveFormatting( attributeName, itemRange, writer );\n\t\t\t\tcustomHandled = true;\n\t\t\t}\n\t\t}\n\n\t\tif ( !customHandled ) {\n\t\t\twriter.removeAttribute( attributeName, itemRange );\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 * @param schema The schema describing the item.\n\t */\n\tprivate* _getFormattingItems( selection: ModelDocumentSelection, schema: ModelSchema ) {\n\t\tconst itemHasRemovableFormatting = ( item: ModelItem | ModelDocumentSelection ) => {\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 * @param schema The schema describing the item.\n\t * @returns The names of formatting attributes found in a given item.\n\t */\n\tprivate* _getFormattingAttributes( item: ModelItem | ModelDocumentSelection, schema: ModelSchema ) {\n\t\tfor ( const [ attributeName ] of item.getAttributes() ) {\n\t\t\tfor ( const { isFormatting } of this._customAttributesHandlers ) {\n\t\t\t\tif ( isFormatting( attributeName, item ) ) {\n\t\t\t\t\tyield attributeName;\n\t\t\t\t}\n\t\t\t}\n\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/**\n * Callback that checks if an attribute is a formatting attribute.\n *\n * @internal\n */\nexport type IsFormattingCallback = ( attributeName: string, item: ModelItem | ModelDocumentSelection ) => boolean;\n\n/**\n * Callback that removes formatting from an item.\n *\n * @internal\n */\nexport type RemoveFormattingCallback = ( attributeName: string, range: ModelRange, writer: ModelWriter ) => void;\n","/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n/**\n * @module remove-format/removeformatediting\n */\n\nimport { Plugin } from 'ckeditor5/src/core.js';\n\nimport { RemoveFormatCommand } from './removeformatcommand.js';\n\n/**\n * The remove format editing plugin.\n *\n * It registers the {@link module:remove-format/removeformatcommand~RemoveFormatCommand removeFormat} command.\n */\nexport class RemoveFormatEditing extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get pluginName() {\n\t\treturn 'RemoveFormatEditing' as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static override get isOfficialPlugin(): true {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic init(): void {\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-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n/**\n * @module remove-format/removeformat\n */\n\nimport { Plugin } from 'ckeditor5/src/core.js';\n\nimport { RemoveFormatUI } from './removeformatui.js';\nimport { RemoveFormatEditing } from './removeformatediting.js';\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 */\nexport class RemoveFormat extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get requires() {\n\t\treturn [ RemoveFormatEditing, RemoveFormatUI ] as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get pluginName() {\n\t\treturn 'RemoveFormat' as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static override get isOfficialPlugin(): true {\n\t\treturn true;\n\t}\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-remove-format",
3
- "version": "45.2.1",
3
+ "version": "46.0.0-alpha.1",
4
4
  "description": "Remove format feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -13,11 +13,11 @@
13
13
  "type": "module",
14
14
  "main": "src/index.js",
15
15
  "dependencies": {
16
- "@ckeditor/ckeditor5-core": "45.2.1",
17
- "@ckeditor/ckeditor5-icons": "45.2.1",
18
- "@ckeditor/ckeditor5-ui": "45.2.1",
19
- "@ckeditor/ckeditor5-utils": "45.2.1",
20
- "ckeditor5": "45.2.1"
16
+ "@ckeditor/ckeditor5-core": "46.0.0-alpha.1",
17
+ "@ckeditor/ckeditor5-icons": "46.0.0-alpha.1",
18
+ "@ckeditor/ckeditor5-ui": "46.0.0-alpha.1",
19
+ "@ckeditor/ckeditor5-utils": "46.0.0-alpha.1",
20
+ "ckeditor5": "46.0.0-alpha.1"
21
21
  },
22
22
  "author": "CKSource (http://cksource.com/)",
23
23
  "license": "SEE LICENSE IN LICENSE.md",
package/src/index.d.ts CHANGED
@@ -5,8 +5,8 @@
5
5
  /**
6
6
  * @module remove-format
7
7
  */
8
- export { default as RemoveFormat } from './removeformat.js';
9
- export { default as RemoveFormatEditing } from './removeformatediting.js';
10
- export { default as RemoveFormatUI } from './removeformatui.js';
11
- export type { default as RemoveFormatCommand } from './removeformatcommand.js';
8
+ export { RemoveFormat } from './removeformat.js';
9
+ export { RemoveFormatEditing } from './removeformatediting.js';
10
+ export { RemoveFormatUI } from './removeformatui.js';
11
+ export { RemoveFormatCommand, type IsFormattingCallback, type RemoveFormattingCallback } from './removeformatcommand.js';
12
12
  import './augmentation.js';
package/src/index.js CHANGED
@@ -5,7 +5,8 @@
5
5
  /**
6
6
  * @module remove-format
7
7
  */
8
- export { default as RemoveFormat } from './removeformat.js';
9
- export { default as RemoveFormatEditing } from './removeformatediting.js';
10
- export { default as RemoveFormatUI } from './removeformatui.js';
8
+ export { RemoveFormat } from './removeformat.js';
9
+ export { RemoveFormatEditing } from './removeformatediting.js';
10
+ export { RemoveFormatUI } from './removeformatui.js';
11
+ export { RemoveFormatCommand } from './removeformatcommand.js';
11
12
  import './augmentation.js';
@@ -6,8 +6,8 @@
6
6
  * @module remove-format/removeformat
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import RemoveFormatUI from './removeformatui.js';
10
- import RemoveFormatEditing from './removeformatediting.js';
9
+ import { RemoveFormatUI } from './removeformatui.js';
10
+ import { RemoveFormatEditing } from './removeformatediting.js';
11
11
  /**
12
12
  * The remove format plugin.
13
13
  *
@@ -16,7 +16,7 @@ import RemoveFormatEditing from './removeformatediting.js';
16
16
  *
17
17
  * For a detailed overview, check out the {@glink features/remove-format remove format} feature documentation.
18
18
  */
19
- export default class RemoveFormat extends Plugin {
19
+ export declare class RemoveFormat extends Plugin {
20
20
  /**
21
21
  * @inheritDoc
22
22
  */
@@ -6,8 +6,8 @@
6
6
  * @module remove-format/removeformat
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import RemoveFormatUI from './removeformatui.js';
10
- import RemoveFormatEditing from './removeformatediting.js';
9
+ import { RemoveFormatUI } from './removeformatui.js';
10
+ import { RemoveFormatEditing } from './removeformatediting.js';
11
11
  /**
12
12
  * The remove format plugin.
13
13
  *
@@ -16,7 +16,7 @@ import RemoveFormatEditing from './removeformatediting.js';
16
16
  *
17
17
  * For a detailed overview, check out the {@glink features/remove-format remove format} feature documentation.
18
18
  */
19
- export default class RemoveFormat extends Plugin {
19
+ export class RemoveFormat extends Plugin {
20
20
  /**
21
21
  * @inheritDoc
22
22
  */
@@ -2,6 +2,10 @@
2
2
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
+ /**
6
+ * @module remove-format/removeformatcommand
7
+ */
8
+ import type { ModelDocumentSelection, ModelItem, ModelRange, ModelWriter } from 'ckeditor5/src/engine.js';
5
9
  import { Command } from 'ckeditor5/src/core.js';
6
10
  /**
7
11
  * The remove format command.
@@ -13,8 +17,12 @@ import { Command } from 'ckeditor5/src/core.js';
13
17
  * editor.execute( 'removeFormat' );
14
18
  * ```
15
19
  */
16
- export default class RemoveFormatCommand extends Command {
20
+ export declare class RemoveFormatCommand extends Command {
17
21
  value: boolean;
22
+ /**
23
+ * List of all registered custom attribute handlers.
24
+ */
25
+ private _customAttributesHandlers;
18
26
  /**
19
27
  * @inheritDoc
20
28
  */
@@ -23,6 +31,16 @@ export default class RemoveFormatCommand extends Command {
23
31
  * @inheritDoc
24
32
  */
25
33
  execute(): void;
34
+ /**
35
+ * Registers a custom attribute handler that will be used to determine if an attribute is formatting and how to remove it.
36
+ *
37
+ * @internal
38
+ */
39
+ registerCustomAttribute(isFormatting: IsFormattingCallback, removeFormatting: RemoveFormattingCallback): void;
40
+ /**
41
+ * Helper method that removes a formatting attribute from an item either using custom callbacks or writer remove attribute.
42
+ */
43
+ private _removeFormatting;
26
44
  /**
27
45
  * Returns an iterable of items in a selection (including the selection itself) that have formatting model
28
46
  * attributes to be removed by the feature.
@@ -40,3 +58,15 @@ export default class RemoveFormatCommand extends Command {
40
58
  */
41
59
  private _getFormattingAttributes;
42
60
  }
61
+ /**
62
+ * Callback that checks if an attribute is a formatting attribute.
63
+ *
64
+ * @internal
65
+ */
66
+ export type IsFormattingCallback = (attributeName: string, item: ModelItem | ModelDocumentSelection) => boolean;
67
+ /**
68
+ * Callback that removes formatting from an item.
69
+ *
70
+ * @internal
71
+ */
72
+ export type RemoveFormattingCallback = (attributeName: string, range: ModelRange, writer: ModelWriter) => void;
@@ -14,7 +14,11 @@ import { first } from 'ckeditor5/src/utils.js';
14
14
  * editor.execute( 'removeFormat' );
15
15
  * ```
16
16
  */
17
- export default class RemoveFormatCommand extends Command {
17
+ export class RemoveFormatCommand extends Command {
18
+ /**
19
+ * List of all registered custom attribute handlers.
20
+ */
21
+ _customAttributesHandlers = [];
18
22
  /**
19
23
  * @inheritDoc
20
24
  */
@@ -40,12 +44,38 @@ export default class RemoveFormatCommand extends Command {
40
44
  // https://github.com/ckeditor/ckeditor5-remove-format/pull/1#pullrequestreview-220515609
41
45
  const itemRange = writer.createRangeOn(item);
42
46
  for (const attributeName of this._getFormattingAttributes(item, schema)) {
43
- writer.removeAttribute(attributeName, itemRange);
47
+ this._removeFormatting(attributeName, item, itemRange, writer);
44
48
  }
45
49
  }
46
50
  }
47
51
  });
48
52
  }
53
+ /**
54
+ * Registers a custom attribute handler that will be used to determine if an attribute is formatting and how to remove it.
55
+ *
56
+ * @internal
57
+ */
58
+ registerCustomAttribute(isFormatting, removeFormatting) {
59
+ this._customAttributesHandlers.push({
60
+ isFormatting,
61
+ removeFormatting
62
+ });
63
+ }
64
+ /**
65
+ * Helper method that removes a formatting attribute from an item either using custom callbacks or writer remove attribute.
66
+ */
67
+ _removeFormatting(attributeName, item, itemRange, writer) {
68
+ let customHandled = false;
69
+ for (const { isFormatting, removeFormatting } of this._customAttributesHandlers) {
70
+ if (isFormatting(attributeName, item)) {
71
+ removeFormatting(attributeName, itemRange, writer);
72
+ customHandled = true;
73
+ }
74
+ }
75
+ if (!customHandled) {
76
+ writer.removeAttribute(attributeName, itemRange);
77
+ }
78
+ }
49
79
  /**
50
80
  * Returns an iterable of items in a selection (including the selection itself) that have formatting model
51
81
  * attributes to be removed by the feature.
@@ -85,6 +115,11 @@ export default class RemoveFormatCommand extends Command {
85
115
  */
86
116
  *_getFormattingAttributes(item, schema) {
87
117
  for (const [attributeName] of item.getAttributes()) {
118
+ for (const { isFormatting } of this._customAttributesHandlers) {
119
+ if (isFormatting(attributeName, item)) {
120
+ yield attributeName;
121
+ }
122
+ }
88
123
  const attributeProperties = schema.getAttributeProperties(attributeName);
89
124
  if (attributeProperties && attributeProperties.isFormatting) {
90
125
  yield attributeName;
@@ -11,7 +11,7 @@ import { Plugin } from 'ckeditor5/src/core.js';
11
11
  *
12
12
  * It registers the {@link module:remove-format/removeformatcommand~RemoveFormatCommand removeFormat} command.
13
13
  */
14
- export default class RemoveFormatEditing extends Plugin {
14
+ export declare class RemoveFormatEditing extends Plugin {
15
15
  /**
16
16
  * @inheritDoc
17
17
  */
@@ -6,13 +6,13 @@
6
6
  * @module remove-format/removeformatediting
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import RemoveFormatCommand from './removeformatcommand.js';
9
+ import { RemoveFormatCommand } from './removeformatcommand.js';
10
10
  /**
11
11
  * The remove format editing plugin.
12
12
  *
13
13
  * It registers the {@link module:remove-format/removeformatcommand~RemoveFormatCommand removeFormat} command.
14
14
  */
15
- export default class RemoveFormatEditing extends Plugin {
15
+ export class RemoveFormatEditing extends Plugin {
16
16
  /**
17
17
  * @inheritDoc
18
18
  */
@@ -10,7 +10,7 @@ import { Plugin } from 'ckeditor5/src/core.js';
10
10
  * The remove format UI plugin. It registers the `'removeFormat'` button which can be
11
11
  * used in the toolbar.
12
12
  */
13
- export default class RemoveFormatUI extends Plugin {
13
+ export declare class RemoveFormatUI extends Plugin {
14
14
  /**
15
15
  * @inheritDoc
16
16
  */
@@ -13,7 +13,7 @@ const REMOVE_FORMAT = 'removeFormat';
13
13
  * The remove format UI plugin. It registers the `'removeFormat'` button which can be
14
14
  * used in the toolbar.
15
15
  */
16
- export default class RemoveFormatUI extends Plugin {
16
+ export class RemoveFormatUI extends Plugin {
17
17
  /**
18
18
  * @inheritDoc
19
19
  */