@ckeditor/ckeditor5-remove-format 45.2.1-alpha.4 → 45.2.1-alpha.6
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/build/remove-format.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/build/remove-format.js
CHANGED
|
@@ -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,(
|
|
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})();
|
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","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","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,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,CAA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AA,CAAA,GAAA,CAAkBE,UAAa,CAAA,CAAA,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,CACD,CAAA,CAAA,CAAA,CAAA,MAAA,CAAA,GAAA,CAA2BC,gBAAyB,CAAA,CAAA,CAAA;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","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,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,EAAE,CAAC;AAChG,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;;ACY/D,KAAA,CAAMA,aAAAA,CAAAA,CAAAA,CAAgB,CAAA,YAAA,CAAA;AAEtB,CAAA,CAAA;ADVA,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CA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O,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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-remove-format",
|
|
3
|
-
"version": "45.2.1-alpha.
|
|
3
|
+
"version": "45.2.1-alpha.6",
|
|
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-alpha.
|
|
17
|
-
"@ckeditor/ckeditor5-icons": "45.2.1-alpha.
|
|
18
|
-
"@ckeditor/ckeditor5-ui": "45.2.1-alpha.
|
|
19
|
-
"@ckeditor/ckeditor5-utils": "45.2.1-alpha.
|
|
20
|
-
"ckeditor5": "45.2.1-alpha.
|
|
16
|
+
"@ckeditor/ckeditor5-core": "45.2.1-alpha.6",
|
|
17
|
+
"@ckeditor/ckeditor5-icons": "45.2.1-alpha.6",
|
|
18
|
+
"@ckeditor/ckeditor5-ui": "45.2.1-alpha.6",
|
|
19
|
+
"@ckeditor/ckeditor5-utils": "45.2.1-alpha.6",
|
|
20
|
+
"ckeditor5": "45.2.1-alpha.6"
|
|
21
21
|
},
|
|
22
22
|
"author": "CKSource (http://cksource.com/)",
|
|
23
23
|
"license": "SEE LICENSE IN LICENSE.md",
|