@ckeditor/ckeditor5-indent 38.0.1 → 38.1.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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack://CKEditor5.indent/./theme/icons/indent.svg","webpack://CKEditor5.indent/./theme/icons/outdent.svg","webpack://CKEditor5.indent/./src/indent.js","webpack://CKEditor5.indent/./src/indentblock.js","webpack://CKEditor5.indent/./src/indentblockcommand.js","webpack://CKEditor5.indent/./src/indentcommandbehavior/indentusingclasses.js","webpack://CKEditor5.indent/./src/indentcommandbehavior/indentusingoffset.js","webpack://CKEditor5.indent/./src/indentediting.js","webpack://CKEditor5.indent/./src/indentui.js","webpack://CKEditor5.indent/delegated \"./src/core.js\" from dll-reference CKEditor5.dll","webpack://CKEditor5.indent/delegated \"./src/engine.js\" from dll-reference CKEditor5.dll","webpack://CKEditor5.indent/delegated \"./src/ui.js\" from dll-reference CKEditor5.dll","webpack://CKEditor5.indent/delegated \"./src/utils.js\" from dll-reference CKEditor5.dll","webpack://CKEditor5.indent/external var \"CKEditor5.dll\"","webpack://CKEditor5.indent/webpack/bootstrap","webpack://CKEditor5.indent/webpack/runtime/define property getters","webpack://CKEditor5.indent/webpack/runtime/hasOwnProperty shorthand","webpack://CKEditor5.indent/webpack/runtime/make namespace object","webpack://CKEditor5.indent/./src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,iEAAe,6YAA6Y;;;;;;;;;;;;;;;ACA5Z,iEAAe,2YAA2Y;;;;;;;;;;;;;;;;;;ACA1Z;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAE4C;;AAEA;AACV;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,6BAA6B,IAAI,gDAAgD;AAC3F,UAAU,6CAA6C;AACvD;AACA;AACA;AACA,UAAU,uEAAuE;AACjF,UAAU,wDAAwD;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,qBAAqB,sDAAM;AAC1C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,sDAAa,EAAE,iDAAQ;AAClC;AACA;;;;;;;;;;;;;;;;;;;;;AClDA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAE4C;AACU;;AAEA;AACoB;AACE;;AAE5E;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB,mCAAmC;AACrD;AACA;AACA;AACA;AACe,0BAA0B,sDAAM;AAC/C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,wCAAwC,sBAAsB;AAC9D,yCAAyC,uBAAuB;;AAEhE;AACA,uCAAuC,gEAAc;AACrD;;AAEA,2CAA2C,2DAAkB,cAAc,gFAAiB;AAC5F,4CAA4C,2DAAkB,cAAc,gFAAiB;AAC7F,IAAI;AACJ;AACA,2CAA2C,2DAAkB,cAAc,iFAAkB;AAC7F,4CAA4C,2DAAkB,cAAc,iFAAkB;AAC9F;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,kCAAkC,iCAAiC;AACnE;AACA,IAAI;;AAEJ,kDAAkD,qBAAqB;;AAEvE;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA,YAAY,gBAAgB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,6BAA6B,sEAAsE;AACnG;AACA,iBAAiB,kDAAkD;AACnE;AACA,YAAY,6CAA6C;AACzD;;AAEA;AACA;AACA;AACA,UAAU,2DAA2D;AACrE,IAAI,0DAA0D,KAAK,wDAAwD;AAC3H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,wEAAwE,2DAA2D;AACnI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,QAAQ,sEAAsE;AAC9E;AACA;AACA;;AAEA;AACA,4BAA4B,8DAA8D;AAC1F;AACA;AACA,YAAY,QAAQ;AACpB;;AAEA;AACA,kCAAkC,yDAAyD;AAC3F;AACA;AACA,YAAY,QAAQ;AACpB;;AAEA;AACA;AACA,QAAQ,2EAA2E;AACnF,IAAI,+EAA+E;AACnF;AACA;AACA,YAAY,0BAA0B;AACtC;;;;;;;;;;;;;;;;;;ACzOA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAE6C;AACD;;AAE5C;AACA;AACA;AACA,qCAAqC,6CAA6C;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,iCAAiC,uDAAO;AACvD;AACA;AACA;AACA,YAAY,kCAAkC;AAC9C,YAAY,iDAAiD;AAC7D;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,gBAAgB,0DAAK;;AAErB;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA,WAAW,iCAAiC;AAC5C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,qCAAqC,0DAA0D;AAC/F;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa;AACb;;;;;;;;;;;;;;;;ACzHA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACe;AACf;AACA;AACA;AACA,YAAY,QAAQ;AACpB,YAAY,QAAQ;AACpB,YAAY,gBAAgB;AAC5B;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;;;;;AC5DA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACe;AACf;AACA;AACA;AACA,YAAY,QAAQ;AACpB,YAAY,QAAQ;AACpB,YAAY,QAAQ;AACpB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;;;;;;;;;;;;;;;;ACzEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAE0D;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,kDAAkD;AACtD;AACA;AACA;AACe,4BAA4B,sDAAM;AACjD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,qCAAqC,4DAAY;AACjD,sCAAsC,4DAAY;AAClD;AACA;;;;;;;;;;;;;;;;;;;;ACtCA;AACA;AACA;AACA;;AAEA;AACA;AACA;AAC8C;AACF;;AAEO;AACE;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,kDAAkD;AAC1D;AACA;AACA;AACe,uBAAuB,sDAAM;AAC5C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oEAAoE,+DAAU,GAAG,gEAAW;AAC5F,qEAAqE,gEAAW,GAAG,+DAAU;;AAE7F;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,QAAQ;AACpB,YAAY,QAAQ;AACpB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,wDAAU;;AAE9B;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA,IAAI;AACJ;AACA;;;;;;;;;;;AC9EA;;;;;;;;;;ACAA;;;;;;;;;;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;;AAE6C;AACc;AACV;AACM","file":"indent.js","sourcesContent":["export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zM1.632 6.95 5.02 9.358a.4.4 0 0 1-.013.661l-3.39 2.207A.4.4 0 0 1 1 11.892V7.275a.4.4 0 0 1 .632-.326z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zm1.618-9.55L.98 9.358a.4.4 0 0 0 .013.661l3.39 2.207A.4.4 0 0 0 5 11.892V7.275a.4.4 0 0 0-.632-.326z\\\"/></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 indent/indent\n */\n\nimport { Plugin } from 'ckeditor5/src/core';\n\nimport IndentEditing from './indentediting';\nimport IndentUI from './indentui';\n\n/**\n * The indent feature.\n *\n * This plugin acts as a single entry point plugin for other features that implement indentation of elements like lists or paragraphs.\n *\n * The compatible features are:\n *\n * * The {@link module:list/list~List} or {@link module:list/list/listediting~ListEditing} feature for list indentation.\n * * The {@link module:indent/indentblock~IndentBlock} feature for block indentation.\n *\n * This is a \"glue\" plugin that loads the following plugins:\n *\n * * The {@link module:indent/indentediting~IndentEditing indent editing feature}.\n * * The {@link module:indent/indentui~IndentUI indent UI feature}.\n *\n * The dependent plugins register the `'indent'` and `'outdent'` commands and introduce the `'indent'` and `'outdent'` buttons\n * that allow to increase or decrease text indentation of supported elements.\n *\n * **Note**: In order for the commands and buttons to work, at least one of compatible features is required.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class Indent extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'Indent';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get requires() {\n\t\treturn [ IndentEditing, IndentUI ];\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 indent/indentblock\n */\n\nimport { Plugin } from 'ckeditor5/src/core';\nimport { addMarginRules } from 'ckeditor5/src/engine';\n\nimport IndentBlockCommand from './indentblockcommand';\nimport IndentUsingOffset from './indentcommandbehavior/indentusingoffset';\nimport IndentUsingClasses from './indentcommandbehavior/indentusingclasses';\n\nconst DEFAULT_ELEMENTS = [ 'paragraph', 'heading1', 'heading2', 'heading3', 'heading4', 'heading5', 'heading6' ];\n\n/**\n * The block indentation feature.\n *\n * It registers the `'indentBlock'` and `'outdentBlock'` commands.\n *\n * If the plugin {@link module:indent/indent~Indent} is defined, it also attaches the `'indentBlock'` and `'outdentBlock'` commands to\n * the `'indent'` and `'outdent'` commands.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class IndentBlock extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tconstructor( editor ) {\n\t\tsuper( editor );\n\n\t\teditor.config.define( 'indentBlock', {\n\t\t\toffset: 40,\n\t\t\tunit: 'px'\n\t\t} );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'IndentBlock';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst configuration = editor.config.get( 'indentBlock' );\n\n\t\tconst useOffsetConfig = !configuration.classes || !configuration.classes.length;\n\n\t\tconst indentConfig = Object.assign( { direction: 'forward' }, configuration );\n\t\tconst outdentConfig = Object.assign( { direction: 'backward' }, configuration );\n\n\t\tif ( useOffsetConfig ) {\n\t\t\teditor.data.addStyleProcessorRules( addMarginRules );\n\t\t\tthis._setupConversionUsingOffset( editor.conversion );\n\n\t\t\teditor.commands.add( 'indentBlock', new IndentBlockCommand( editor, new IndentUsingOffset( indentConfig ) ) );\n\t\t\teditor.commands.add( 'outdentBlock', new IndentBlockCommand( editor, new IndentUsingOffset( outdentConfig ) ) );\n\t\t} else {\n\t\t\tthis._setupConversionUsingClasses( configuration.classes );\n\t\t\teditor.commands.add( 'indentBlock', new IndentBlockCommand( editor, new IndentUsingClasses( indentConfig ) ) );\n\t\t\teditor.commands.add( 'outdentBlock', new IndentBlockCommand( editor, new IndentUsingClasses( outdentConfig ) ) );\n\t\t}\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tafterInit() {\n\t\tconst editor = this.editor;\n\t\tconst schema = editor.model.schema;\n\n\t\tconst indentCommand = editor.commands.get( 'indent' );\n\t\tconst outdentCommand = editor.commands.get( 'outdent' );\n\n\t\t// Enable block indentation to heading configuration options. If it is not defined enable in paragraph and default headings.\n\t\tconst options = editor.config.get( 'heading.options' );\n\t\tconst configuredElements = options && options.map( option => option.model );\n\t\tconst knownElements = configuredElements || DEFAULT_ELEMENTS;\n\n\t\tknownElements.forEach( elementName => {\n\t\t\tif ( schema.isRegistered( elementName ) ) {\n\t\t\t\tschema.extend( elementName, { allowAttributes: 'blockIndent' } );\n\t\t\t}\n\t\t} );\n\n\t\tschema.setAttributeProperties( 'blockIndent', { isFormatting: true } );\n\n\t\tindentCommand.registerChildCommand( editor.commands.get( 'indentBlock' ) );\n\t\toutdentCommand.registerChildCommand( editor.commands.get( 'outdentBlock' ) );\n\t}\n\n\t/**\n\t * Setups conversion for using offset indents.\n\t *\n\t * @private\n\t */\n\t_setupConversionUsingOffset() {\n\t\tconst conversion = this.editor.conversion;\n\t\tconst locale = this.editor.locale;\n\t\tconst marginProperty = locale.contentLanguageDirection === 'rtl' ? 'margin-right' : 'margin-left';\n\n\t\tconversion.for( 'upcast' ).attributeToAttribute( {\n\t\t\tview: {\n\t\t\t\tstyles: {\n\t\t\t\t\t[ marginProperty ]: /[\\s\\S]+/\n\t\t\t\t}\n\t\t\t},\n\t\t\tmodel: {\n\t\t\t\tkey: 'blockIndent',\n\t\t\t\tvalue: viewElement => viewElement.getStyle( marginProperty )\n\t\t\t}\n\t\t} );\n\n\t\tconversion.for( 'downcast' ).attributeToAttribute( {\n\t\t\tmodel: 'blockIndent',\n\t\t\tview: modelAttributeValue => {\n\t\t\t\treturn {\n\t\t\t\t\tkey: 'style',\n\t\t\t\t\tvalue: {\n\t\t\t\t\t\t[ marginProperty ]: modelAttributeValue\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 * Setups conversion for using classes.\n\t *\n\t * @param {Array.<String>} classes\n\t * @private\n\t */\n\t_setupConversionUsingClasses( classes ) {\n\t\tconst definition = {\n\t\t\tmodel: {\n\t\t\t\tkey: 'blockIndent',\n\t\t\t\tvalues: []\n\t\t\t},\n\t\t\tview: {}\n\t\t};\n\n\t\tfor ( const className of classes ) {\n\t\t\tdefinition.model.values.push( className );\n\t\t\tdefinition.view[ className ] = {\n\t\t\t\tkey: 'class',\n\t\t\t\tvalue: [ className ]\n\t\t\t};\n\t\t}\n\n\t\tthis.editor.conversion.attributeToAttribute( definition );\n\t}\n}\n\n/**\n * The configuration of the {@link module:indent/indentblock~IndentBlock block indentation feature}.\n *\n * Read more in {@link module:indent/indentblock~IndentBlockConfig}.\n *\n * @member {module:indent/indentblock~IndentBlockConfig} module:core/editor/editorconfig~EditorConfig#indentBlock\n */\n\n/**\n * The configuration of the block indentation feature.\n *\n * If no {@link module:indent/indentblock~IndentBlockConfig#classes} are set, the block indentation feature will use\n * {@link module:indent/indentblock~IndentBlockConfig#offset} and {@link module:indent/indentblock~IndentBlockConfig#unit} to\n * create indentation steps.\n *\n *\t\tClassicEditor\n *\t\t\t.create( editorElement, {\n * \t\t\t\tindentBlock: {\n *\t\t\t\t\toffset: 2,\n *\t\t\t\t\tunit: 'em'\n * \t\t\t\t}\n *\t\t\t} )\n *\t\t\t.then( ... )\n *\t\t\t.catch( ... );\n *\n * Alternatively, the block indentation feature may set one of defined {@link module:indent/indentblock~IndentBlockConfig#classes} as\n * indentation steps:\n *\n *\t\tClassicEditor\n *\t\t\t.create( editorElement, {\n * \t\t\t\tindentBlock: {\n *\t\t\t\t\tclasses: [\n *\t\t\t\t\t\t'indent-a', // The first step - smallest indentation.\n *\t\t\t\t\t\t'indent-b',\n *\t\t\t\t\t\t'indent-c',\n *\t\t\t\t\t\t'indent-d',\n *\t\t\t\t\t\t'indent-e' // The last step - biggest indentation.\n *\t\t\t\t\t]\n * \t\t\t\t}\n *\t\t\t} )\n *\t\t\t.then( ... )\n *\t\t\t.catch( ... );\n *\n * In the example above only 5 indentation steps will be available.\n *\n * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.\n *\n * @interface IndentBlockConfig\n */\n\n/**\n * The size of indentation {@link module:indent/indentblock~IndentBlockConfig#unit units} for each indentation step.\n *\n * @default 40\n * @member {Number} module:indent/indentblock~IndentBlockConfig#offset\n */\n\n/**\n * The unit used for indentation {@link module:indent/indentblock~IndentBlockConfig#offset}.\n *\n * @default 'px'\n * @member {String} module:indent/indentblock~IndentBlockConfig#unit\n */\n\n/**\n * An optional list of classes to use for indenting the editor content. If not set or set to an empty array, no classes will be used.\n * The {@link module:indent/indentblock~IndentBlockConfig#unit `indentBlock.unit`} and\n * {@link module:indent/indentblock~IndentBlockConfig#offset `indentBlock.offset`} properties will be used instead.\n *\n * @default undefined\n * @member {Array.<String>|undefined} module:indent/indentblock~IndentBlockConfig#classes\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 indent/indentblockcommand\n */\n\nimport { Command } from 'ckeditor5/src/core';\nimport { first } from 'ckeditor5/src/utils';\n\n/**\n * The indent block command.\n *\n * The command is registered by the {@link module:indent/indentblock~IndentBlock} as `'indentBlock'` for indenting blocks and\n * `'outdentBlock'` for outdenting blocks.\n *\n * To increase block indentation at the current selection, execute the command:\n *\n *\t\teditor.execute( 'indentBlock' );\n *\n * To decrease block indentation at the current selection, execute the command:\n *\n *\t\teditor.execute( 'outdentBlock' );\n *\n * @extends module:core/command~Command\n */\nexport default class IndentBlockCommand extends Command {\n\t/**\n\t * Creates an instance of the command.\n\t *\n\t * @param {module:core/editor/editor~Editor} editor The editor instance.\n\t * @param {module:indent/indentblockcommand~IndentBehavior} indentBehavior\n\t */\n\tconstructor( editor, indentBehavior ) {\n\t\tsuper( editor );\n\n\t\t/**\n\t\t * The command's indentation behavior.\n\t\t *\n\t\t * @type {module:indent/indentblockcommand~IndentBehavior}\n\t\t * @private\n\t\t */\n\t\tthis._indentBehavior = indentBehavior;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\trefresh() {\n\t\t// Check whether any of the position's ancestors is a list item.\n\t\tconst editor = this.editor;\n\t\tconst model = editor.model;\n\n\t\tconst block = first( model.document.selection.getSelectedBlocks() );\n\n\t\tif ( !block || !model.schema.checkAttribute( block, 'blockIndent' ) ) {\n\t\t\tthis.isEnabled = false;\n\n\t\t\treturn;\n\t\t}\n\n\t\tthis.isEnabled = this._indentBehavior.checkEnabled( block.getAttribute( 'blockIndent' ) );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\texecute() {\n\t\tconst model = this.editor.model;\n\n\t\tconst blocksToChange = getBlocksToChange( model );\n\n\t\tmodel.change( writer => {\n\t\t\tfor ( const block of blocksToChange ) {\n\t\t\t\tconst currentIndent = block.getAttribute( 'blockIndent' );\n\n\t\t\t\tconst nextIndent = this._indentBehavior.getNextIndent( currentIndent );\n\n\t\t\t\tif ( nextIndent ) {\n\t\t\t\t\twriter.setAttribute( 'blockIndent', nextIndent, block );\n\t\t\t\t} else {\n\t\t\t\t\twriter.removeAttribute( 'blockIndent', block );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n}\n\n// Returns blocks from selection that should have blockIndent selection set.\n//\n// @param {module:engine/model/model~model} model A model.\nfunction getBlocksToChange( model ) {\n\tconst selection = model.document.selection;\n\tconst schema = model.schema;\n\tconst blocksInSelection = Array.from( selection.getSelectedBlocks() );\n\n\treturn blocksInSelection.filter( block => schema.checkAttribute( block, 'blockIndent' ) );\n}\n\n/**\n * Provides indentation behavior to {@link module:indent/indentblockcommand~IndentBlockCommand}.\n *\n * @interface module:indent/indentblockcommand~IndentBehavior\n */\n\n/**\n * Checks if the command should be enabled.\n *\n * @method #checkEnabled\n * @param {String} indentAttributeValue The current indent attribute value.\n * @returns {Boolean}\n */\n\n/**\n * Returns a new indent attribute value based on the current indent. This method returns `undefined` when the indentation should be removed.\n *\n * @method #getNextIndent\n * @param {String} indentAttributeValue The current indent attribute value.\n * @returns {String|undefined}\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 indent/indentcommandbehavior/indentusingclasses\n */\n\n/**\n * The block indentation behavior that uses classes to set indentation.\n *\n * @implements module:indent/indentblockcommand~IndentBehavior\n */\nexport default class IndentUsingClasses {\n\t/**\n\t * Creates an instance of the indentation behavior.\n\t *\n\t * @param {Object} config\n\t * @param {String} config.direction The direction of indentation.\n\t * @param {Array.<String>} config.classes A list of classes used for indentation.\n\t */\n\tconstructor( config ) {\n\t\t/**\n\t\t * The direction of indentation.\n\t\t *\n\t\t * @type {Boolean}\n\t\t */\n\t\tthis.isForward = config.direction === 'forward';\n\n\t\t/**\n\t\t * A list of classes used for indentation.\n\t\t *\n\t\t * @type {Array.<String>}\n\t\t */\n\t\tthis.classes = config.classes;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tcheckEnabled( indentAttributeValue ) {\n\t\tconst currentIndex = this.classes.indexOf( indentAttributeValue );\n\n\t\tif ( this.isForward ) {\n\t\t\treturn currentIndex < this.classes.length - 1;\n\t\t} else {\n\t\t\treturn currentIndex >= 0;\n\t\t}\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tgetNextIndent( indentAttributeValue ) {\n\t\tconst currentIndex = this.classes.indexOf( indentAttributeValue );\n\t\tconst indexStep = this.isForward ? 1 : -1;\n\n\t\treturn this.classes[ currentIndex + indexStep ];\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 indent/indentcommandbehavior/indentusingoffset\n */\n\n/**\n * The block indentation behavior that uses offsets to set indentation.\n *\n * @implements module:indent/indentblockcommand~IndentBehavior\n */\nexport default class IndentUsingOffset {\n\t/**\n\t * Creates an instance of the indentation behavior.\n\t *\n\t * @param {Object} config\n\t * @param {String} config.direction The direction of indentation.\n\t * @param {Number} config.offset The offset of the next indentation step.\n\t * @param {String} config.unit Indentation unit.\n\t */\n\tconstructor( config ) {\n\t\t/**\n\t\t * The direction of indentation.\n\t\t *\n\t\t * @type {Boolean}\n\t\t */\n\t\tthis.isForward = config.direction === 'forward';\n\n\t\t/**\n\t\t * The offset of the next indentation step.\n\t\t *\n\t\t * @type {Number}\n\t\t */\n\t\tthis.offset = config.offset;\n\n\t\t/**\n\t\t * Indentation unit.\n\t\t *\n\t\t * @type {String}\n\t\t */\n\t\tthis.unit = config.unit;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tcheckEnabled( indentAttributeValue ) {\n\t\tconst currentOffset = parseFloat( indentAttributeValue || 0 );\n\n\t\t// The command is always enabled for forward indentation.\n\t\treturn this.isForward || currentOffset > 0;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tgetNextIndent( indentAttributeValue ) {\n\t\tconst currentOffset = parseFloat( indentAttributeValue || 0 );\n\t\tconst isSameUnit = !indentAttributeValue || indentAttributeValue.endsWith( this.unit );\n\n\t\tif ( !isSameUnit ) {\n\t\t\treturn this.isForward ? this.offset + this.unit : undefined;\n\t\t}\n\n\t\tconst nextOffset = this.isForward ? this.offset : -this.offset;\n\n\t\tconst offsetToSet = currentOffset + nextOffset;\n\n\t\treturn offsetToSet > 0 ? offsetToSet + this.unit : undefined;\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 indent/indentediting\n */\n\nimport { Plugin, MultiCommand } from 'ckeditor5/src/core';\n\n/**\n * The indent editing feature.\n *\n * This plugin registers the `'indent'` and `'outdent'` commands.\n *\n * **Note**: In order for the commands to work, at least one of the compatible features is required. Read more in the\n * {@link module:indent/indent~Indent indent feature} API documentation.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class IndentEditing extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'IndentEditing';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tconst editor = this.editor;\n\n\t\teditor.commands.add( 'indent', new MultiCommand( editor ) );\n\t\teditor.commands.add( 'outdent', new MultiCommand( 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 indent/indentui\n */\nimport { ButtonView } from 'ckeditor5/src/ui';\nimport { Plugin } from 'ckeditor5/src/core';\n\nimport indentIcon from '../theme/icons/indent.svg';\nimport outdentIcon from '../theme/icons/outdent.svg';\n\n/**\n * The indent UI feature.\n *\n * This plugin registers the `'indent'` and `'outdent'` buttons.\n *\n * **Note**: In order for the commands to work, at least one of the compatible features is required. Read more in\n * the {@link module:indent/indent~Indent indent feature} API documentation.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class IndentUI extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'IndentUI';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst locale = editor.locale;\n\t\tconst t = editor.t;\n\n\t\tconst localizedIndentIcon = locale.uiLanguageDirection == 'ltr' ? indentIcon : outdentIcon;\n\t\tconst localizedOutdentIcon = locale.uiLanguageDirection == 'ltr' ? outdentIcon : indentIcon;\n\n\t\tthis._defineButton( 'indent', t( 'Increase indent' ), localizedIndentIcon );\n\t\tthis._defineButton( 'outdent', t( 'Decrease indent' ), localizedOutdentIcon );\n\t}\n\n\t/**\n\t * Defines a UI button.\n\t *\n\t * @param {String} commandName\n\t * @param {String} label\n\t * @param {String} icon\n\t * @private\n\t */\n\t_defineButton( commandName, label, icon ) {\n\t\tconst editor = this.editor;\n\n\t\teditor.ui.componentFactory.add( commandName, locale => {\n\t\t\tconst command = editor.commands.get( commandName );\n\t\t\tconst view = new ButtonView( locale );\n\n\t\t\tview.set( {\n\t\t\t\tlabel,\n\t\t\t\ticon,\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\tthis.listenTo( view, 'execute', () => {\n\t\t\t\teditor.execute( commandName );\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/engine.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 indent\n */\n\nexport { default as Indent } from './indent';\nexport { default as IndentEditing } from './indentediting';\nexport { default as IndentUI } from './indentui';\nexport { default as IndentBlock } from './indentblock';\n"],"sourceRoot":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-indent",
3
- "version": "38.0.1",
3
+ "version": "38.1.1",
4
4
  "description": "Block indentation feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -12,20 +12,7 @@
12
12
  ],
13
13
  "main": "src/index.js",
14
14
  "dependencies": {
15
- "ckeditor5": "^38.0.1"
16
- },
17
- "devDependencies": {
18
- "@ckeditor/ckeditor5-core": "^38.0.1",
19
- "@ckeditor/ckeditor5-dev-utils": "^37.0.0",
20
- "@ckeditor/ckeditor5-editor-classic": "^38.0.1",
21
- "@ckeditor/ckeditor5-engine": "^38.0.1",
22
- "@ckeditor/ckeditor5-heading": "^38.0.1",
23
- "@ckeditor/ckeditor5-paragraph": "^38.0.1",
24
- "@ckeditor/ckeditor5-theme-lark": "^38.0.1",
25
- "@ckeditor/ckeditor5-ui": "^38.0.1",
26
- "typescript": "^4.8.4",
27
- "webpack": "^5.58.1",
28
- "webpack-cli": "^4.9.0"
15
+ "ckeditor5": "38.1.1"
29
16
  },
30
17
  "engines": {
31
18
  "node": ">=16.0.0",
@@ -49,10 +36,5 @@
49
36
  "ckeditor5-metadata.json",
50
37
  "CHANGELOG.md"
51
38
  ],
52
- "scripts": {
53
- "dll:build": "webpack",
54
- "build": "tsc -p ./tsconfig.json",
55
- "postversion": "npm run build"
56
- },
57
39
  "types": "src/index.d.ts"
58
40
  }
@@ -1,24 +1,24 @@
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 { IndentBlockConfig, Indent, IndentBlock, IndentUI, IndentBlockCommand } from './index';
6
- declare module '@ckeditor/ckeditor5-core' {
7
- interface EditorConfig {
8
- /**
9
- * The configuration of the {@link module:indent/indentblock~IndentBlock block indentation feature}.
10
- *
11
- * Read more in {@link module:indent/indentconfig~IndentBlockConfig}.
12
- */
13
- indentBlock?: IndentBlockConfig;
14
- }
15
- interface PluginsMap {
16
- [Indent.pluginName]: Indent;
17
- [IndentBlock.pluginName]: IndentBlock;
18
- [IndentUI.pluginName]: IndentUI;
19
- }
20
- interface CommandsMap {
21
- indentBlock: IndentBlockCommand;
22
- outdentBlock: IndentBlockCommand;
23
- }
24
- }
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 { IndentBlockConfig, Indent, IndentBlock, IndentUI, IndentBlockCommand } from './index';
6
+ declare module '@ckeditor/ckeditor5-core' {
7
+ interface EditorConfig {
8
+ /**
9
+ * The configuration of the {@link module:indent/indentblock~IndentBlock block indentation feature}.
10
+ *
11
+ * Read more in {@link module:indent/indentconfig~IndentBlockConfig}.
12
+ */
13
+ indentBlock?: IndentBlockConfig;
14
+ }
15
+ interface PluginsMap {
16
+ [Indent.pluginName]: Indent;
17
+ [IndentBlock.pluginName]: IndentBlock;
18
+ [IndentUI.pluginName]: IndentUI;
19
+ }
20
+ interface CommandsMap {
21
+ indentBlock: IndentBlockCommand;
22
+ outdentBlock: IndentBlockCommand;
23
+ }
24
+ }
@@ -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/indent.d.ts CHANGED
@@ -1,40 +1,40 @@
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 indent/indent
7
- */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import IndentEditing from './indentediting';
10
- import IndentUI from './indentui';
11
- /**
12
- * The indent feature.
13
- *
14
- * This plugin acts as a single entry point plugin for other features that implement indentation of elements like lists or paragraphs.
15
- *
16
- * The compatible features are:
17
- *
18
- * * The {@link module:list/list~List} or {@link module:list/list/listediting~ListEditing} feature for list indentation.
19
- * * The {@link module:indent/indentblock~IndentBlock} feature for block indentation.
20
- *
21
- * This is a "glue" plugin that loads the following plugins:
22
- *
23
- * * The {@link module:indent/indentediting~IndentEditing indent editing feature}.
24
- * * The {@link module:indent/indentui~IndentUI indent UI feature}.
25
- *
26
- * The dependent plugins register the `'indent'` and `'outdent'` commands and introduce the `'indent'` and `'outdent'` buttons
27
- * that allow to increase or decrease text indentation of supported elements.
28
- *
29
- * **Note**: In order for the commands and buttons to work, at least one of compatible features is required.
30
- */
31
- export default class Indent extends Plugin {
32
- /**
33
- * @inheritDoc
34
- */
35
- static get pluginName(): 'Indent';
36
- /**
37
- * @inheritDoc
38
- */
39
- static get requires(): readonly [typeof IndentEditing, typeof IndentUI];
40
- }
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 indent/indent
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core';
9
+ import IndentEditing from './indentediting';
10
+ import IndentUI from './indentui';
11
+ /**
12
+ * The indent feature.
13
+ *
14
+ * This plugin acts as a single entry point plugin for other features that implement indentation of elements like lists or paragraphs.
15
+ *
16
+ * The compatible features are:
17
+ *
18
+ * * The {@link module:list/list~List} or {@link module:list/list/listediting~ListEditing} feature for list indentation.
19
+ * * The {@link module:indent/indentblock~IndentBlock} feature for block indentation.
20
+ *
21
+ * This is a "glue" plugin that loads the following plugins:
22
+ *
23
+ * * The {@link module:indent/indentediting~IndentEditing indent editing feature}.
24
+ * * The {@link module:indent/indentui~IndentUI indent UI feature}.
25
+ *
26
+ * The dependent plugins register the `'indent'` and `'outdent'` commands and introduce the `'indent'` and `'outdent'` buttons
27
+ * that allow to increase or decrease text indentation of supported elements.
28
+ *
29
+ * **Note**: In order for the commands and buttons to work, at least one of compatible features is required.
30
+ */
31
+ export default class Indent extends Plugin {
32
+ /**
33
+ * @inheritDoc
34
+ */
35
+ static get pluginName(): "Indent";
36
+ /**
37
+ * @inheritDoc
38
+ */
39
+ static get requires(): readonly [typeof IndentEditing, typeof IndentUI];
40
+ }
package/src/indent.js CHANGED
@@ -1,44 +1,44 @@
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 indent/indent
7
- */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import IndentEditing from './indentediting';
10
- import IndentUI from './indentui';
11
- /**
12
- * The indent feature.
13
- *
14
- * This plugin acts as a single entry point plugin for other features that implement indentation of elements like lists or paragraphs.
15
- *
16
- * The compatible features are:
17
- *
18
- * * The {@link module:list/list~List} or {@link module:list/list/listediting~ListEditing} feature for list indentation.
19
- * * The {@link module:indent/indentblock~IndentBlock} feature for block indentation.
20
- *
21
- * This is a "glue" plugin that loads the following plugins:
22
- *
23
- * * The {@link module:indent/indentediting~IndentEditing indent editing feature}.
24
- * * The {@link module:indent/indentui~IndentUI indent UI feature}.
25
- *
26
- * The dependent plugins register the `'indent'` and `'outdent'` commands and introduce the `'indent'` and `'outdent'` buttons
27
- * that allow to increase or decrease text indentation of supported elements.
28
- *
29
- * **Note**: In order for the commands and buttons to work, at least one of compatible features is required.
30
- */
31
- export default class Indent extends Plugin {
32
- /**
33
- * @inheritDoc
34
- */
35
- static get pluginName() {
36
- return 'Indent';
37
- }
38
- /**
39
- * @inheritDoc
40
- */
41
- static get requires() {
42
- return [IndentEditing, IndentUI];
43
- }
44
- }
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 indent/indent
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core';
9
+ import IndentEditing from './indentediting';
10
+ import IndentUI from './indentui';
11
+ /**
12
+ * The indent feature.
13
+ *
14
+ * This plugin acts as a single entry point plugin for other features that implement indentation of elements like lists or paragraphs.
15
+ *
16
+ * The compatible features are:
17
+ *
18
+ * * The {@link module:list/list~List} or {@link module:list/list/listediting~ListEditing} feature for list indentation.
19
+ * * The {@link module:indent/indentblock~IndentBlock} feature for block indentation.
20
+ *
21
+ * This is a "glue" plugin that loads the following plugins:
22
+ *
23
+ * * The {@link module:indent/indentediting~IndentEditing indent editing feature}.
24
+ * * The {@link module:indent/indentui~IndentUI indent UI feature}.
25
+ *
26
+ * The dependent plugins register the `'indent'` and `'outdent'` commands and introduce the `'indent'` and `'outdent'` buttons
27
+ * that allow to increase or decrease text indentation of supported elements.
28
+ *
29
+ * **Note**: In order for the commands and buttons to work, at least one of compatible features is required.
30
+ */
31
+ export default class Indent extends Plugin {
32
+ /**
33
+ * @inheritDoc
34
+ */
35
+ static get pluginName() {
36
+ return 'Indent';
37
+ }
38
+ /**
39
+ * @inheritDoc
40
+ */
41
+ static get requires() {
42
+ return [IndentEditing, IndentUI];
43
+ }
44
+ }
@@ -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
- /**
6
- * @module indent/indentblock
7
- */
8
- import { Plugin, type Editor } from 'ckeditor5/src/core';
9
- /**
10
- * The block indentation feature.
11
- *
12
- * It registers the `'indentBlock'` and `'outdentBlock'` commands.
13
- *
14
- * If the plugin {@link module:indent/indent~Indent} is defined, it also attaches the `'indentBlock'` and `'outdentBlock'` commands to
15
- * the `'indent'` and `'outdent'` commands.
16
- */
17
- export default class IndentBlock extends Plugin {
18
- /**
19
- * @inheritDoc
20
- */
21
- constructor(editor: Editor);
22
- /**
23
- * @inheritDoc
24
- */
25
- static get pluginName(): 'IndentBlock';
26
- /**
27
- * @inheritDoc
28
- */
29
- init(): void;
30
- /**
31
- * @inheritDoc
32
- */
33
- afterInit(): void;
34
- /**
35
- * Setups conversion for using offset indents.
36
- */
37
- private _setupConversionUsingOffset;
38
- /**
39
- * Setups conversion for using classes.
40
- */
41
- private _setupConversionUsingClasses;
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
+ /**
6
+ * @module indent/indentblock
7
+ */
8
+ import { Plugin, type Editor } from 'ckeditor5/src/core';
9
+ /**
10
+ * The block indentation feature.
11
+ *
12
+ * It registers the `'indentBlock'` and `'outdentBlock'` commands.
13
+ *
14
+ * If the plugin {@link module:indent/indent~Indent} is defined, it also attaches the `'indentBlock'` and `'outdentBlock'` commands to
15
+ * the `'indent'` and `'outdent'` commands.
16
+ */
17
+ export default class IndentBlock extends Plugin {
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ constructor(editor: Editor);
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ static get pluginName(): "IndentBlock";
26
+ /**
27
+ * @inheritDoc
28
+ */
29
+ init(): void;
30
+ /**
31
+ * @inheritDoc
32
+ */
33
+ afterInit(): void;
34
+ /**
35
+ * Setups conversion for using offset indents.
36
+ */
37
+ private _setupConversionUsingOffset;
38
+ /**
39
+ * Setups conversion for using classes.
40
+ */
41
+ private _setupConversionUsingClasses;
42
+ }