@ckeditor/ckeditor5-indent 48.2.0-alpha.7 → 48.3.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,29 +1,29 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
5
- import type { IndentBlockConfig, Indent, IndentBlock, IndentUI, IndentBlockCommand, IndentBlockListIntegration, IndentBlockListCommand, IndentBlockListItemCommand } from './index.js';
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
- [IndentBlockListIntegration.pluginName]: IndentBlockListIntegration;
20
- }
21
- interface CommandsMap {
22
- indentBlock: IndentBlockCommand;
23
- outdentBlock: IndentBlockCommand;
24
- indentBlockList: IndentBlockListCommand;
25
- outdentBlockList: IndentBlockListCommand;
26
- indentBlockListItem: IndentBlockListItemCommand;
27
- outdentBlockListItem: IndentBlockListItemCommand;
28
- }
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
+ import type { IndentBlockConfig, Indent, IndentBlock, IndentUI, IndentBlockCommand, IndentBlockListIntegration, IndentBlockListCommand, IndentBlockListItemCommand } from "./index.js";
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
+ [IndentBlockListIntegration.pluginName]: IndentBlockListIntegration;
20
+ }
21
+ interface CommandsMap {
22
+ indentBlock: IndentBlockCommand;
23
+ outdentBlock: IndentBlockCommand;
24
+ indentBlockList: IndentBlockListCommand;
25
+ outdentBlockList: IndentBlockListCommand;
26
+ indentBlockListItem: IndentBlockListItemCommand;
27
+ outdentBlockListItem: IndentBlockListItemCommand;
28
+ }
29
29
  }
package/dist/indent.d.ts CHANGED
@@ -1,44 +1,44 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module indent/indent
7
- */
8
- import { Plugin } from '@ckeditor/ckeditor5-core';
9
- import { IndentEditing } from './indentediting.js';
10
- import { IndentUI } from './indentui.js';
6
+ * @module indent/indent
7
+ */
8
+ import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
9
+ import { IndentEditing } from "./indentediting.js";
10
+ import { IndentUI } from "./indentui.js";
11
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
- */
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
31
  export declare class Indent extends Plugin {
32
- /**
33
- * @inheritDoc
34
- */
35
- static get pluginName(): "Indent";
36
- /**
37
- * @inheritDoc
38
- */
39
- static get isOfficialPlugin(): true;
40
- /**
41
- * @inheritDoc
42
- */
43
- static get requires(): readonly [typeof IndentEditing, typeof IndentUI];
32
+ /**
33
+ * @inheritDoc
34
+ */
35
+ static get pluginName(): "Indent";
36
+ /**
37
+ * @inheritDoc
38
+ */
39
+ static override get isOfficialPlugin(): true;
40
+ /**
41
+ * @inheritDoc
42
+ */
43
+ static get requires(): PluginDependenciesOf<[IndentEditing, IndentUI]>;
44
44
  }
@@ -1,51 +1,51 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module indent/indentblock
7
- */
8
- import { Plugin, type Editor } from '@ckeditor/ckeditor5-core';
9
- import { IndentBlockListIntegration } from './integrations/indentblocklistintegration.js';
6
+ * @module indent/indentblock
7
+ */
8
+ import { Plugin, type Editor, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
9
+ import { IndentBlockListIntegration } from "./integrations/indentblocklistintegration.js";
10
10
  /**
11
- * The block indentation feature.
12
- *
13
- * It registers the `'indentBlock'` and `'outdentBlock'` commands.
14
- *
15
- * If the plugin {@link module:indent/indent~Indent} is defined, it also attaches the `'indentBlock'` and `'outdentBlock'` commands to
16
- * the `'indent'` and `'outdent'` commands.
17
- */
11
+ * The block indentation feature.
12
+ *
13
+ * It registers the `'indentBlock'` and `'outdentBlock'` commands.
14
+ *
15
+ * If the plugin {@link module:indent/indent~Indent} is defined, it also attaches the `'indentBlock'` and `'outdentBlock'` commands to
16
+ * the `'indent'` and `'outdent'` commands.
17
+ */
18
18
  export declare class IndentBlock extends Plugin {
19
- /**
20
- * @inheritDoc
21
- */
22
- constructor(editor: Editor);
23
- /**
24
- * @inheritDoc
25
- */
26
- static get pluginName(): "IndentBlock";
27
- /**
28
- * @inheritDoc
29
- */
30
- static get isOfficialPlugin(): true;
31
- /**
32
- * @inheritDoc
33
- */
34
- static get requires(): readonly [typeof IndentBlockListIntegration];
35
- /**
36
- * @inheritDoc
37
- */
38
- init(): void;
39
- /**
40
- * @inheritDoc
41
- */
42
- afterInit(): void;
43
- /**
44
- * Setups conversion for using offset indents.
45
- */
46
- private _setupConversionUsingOffset;
47
- /**
48
- * Setups conversion for using classes.
49
- */
50
- private _setupConversionUsingClasses;
19
+ /**
20
+ * @inheritDoc
21
+ */
22
+ constructor(editor: Editor);
23
+ /**
24
+ * @inheritDoc
25
+ */
26
+ static get pluginName(): "IndentBlock";
27
+ /**
28
+ * @inheritDoc
29
+ */
30
+ static override get isOfficialPlugin(): true;
31
+ /**
32
+ * @inheritDoc
33
+ */
34
+ static get requires(): PluginDependenciesOf<[IndentBlockListIntegration]>;
35
+ /**
36
+ * @inheritDoc
37
+ */
38
+ init(): void;
39
+ /**
40
+ * @inheritDoc
41
+ */
42
+ afterInit(): void;
43
+ /**
44
+ * Setups conversion for using offset indents.
45
+ */
46
+ private _setupConversionUsingOffset;
47
+ /**
48
+ * Setups conversion for using classes.
49
+ */
50
+ private _setupConversionUsingClasses;
51
51
  }
@@ -1,56 +1,56 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module indent/indentblockcommand
7
- */
8
- import { Command, type Editor } from '@ckeditor/ckeditor5-core';
9
- import type { IndentBehavior } from './indentcommandbehavior/indentbehavior.js';
6
+ * @module indent/indentblockcommand
7
+ */
8
+ import { Command, type Editor } from "@ckeditor/ckeditor5-core";
9
+ import type { IndentBehavior } from "./indentcommandbehavior/indentbehavior.js";
10
10
  /**
11
- * The indent block command.
12
- *
13
- * The command is registered by the {@link module:indent/indentblock~IndentBlock} as `'indentBlock'` for indenting blocks and
14
- * `'outdentBlock'` for outdenting blocks.
15
- *
16
- * To increase block indentation at the current selection, execute the command:
17
- *
18
- * ```ts
19
- * editor.execute( 'indentBlock' );
20
- * ```
21
- *
22
- * To decrease block indentation at the current selection, execute the command:
23
- *
24
- * ```ts
25
- * editor.execute( 'outdentBlock' );
26
- * ```
27
- */
11
+ * The indent block command.
12
+ *
13
+ * The command is registered by the {@link module:indent/indentblock~IndentBlock} as `'indentBlock'` for indenting blocks and
14
+ * `'outdentBlock'` for outdenting blocks.
15
+ *
16
+ * To increase block indentation at the current selection, execute the command:
17
+ *
18
+ * ```ts
19
+ * editor.execute( 'indentBlock' );
20
+ * ```
21
+ *
22
+ * To decrease block indentation at the current selection, execute the command:
23
+ *
24
+ * ```ts
25
+ * editor.execute( 'outdentBlock' );
26
+ * ```
27
+ */
28
28
  export declare class IndentBlockCommand extends Command {
29
- /**
30
- * The command's indentation behavior.
31
- */
32
- private readonly _indentBehavior;
33
- /**
34
- * Creates an instance of the command.
35
- */
36
- constructor(editor: Editor, indentBehavior: IndentBehavior);
37
- /**
38
- * @inheritDoc
39
- */
40
- refresh(): void;
41
- /**
42
- * @inheritDoc
43
- */
44
- execute(): void;
45
- /**
46
- * Returns blocks from selection that should have blockIndent selection set.
47
- */
48
- private _getBlocksToChange;
49
- /**
50
- * Returns false if indentation cannot be applied, i.e.:
51
- * - for blocks disallowed by schema declaration
52
- * - for blocks in Document Lists (disallowed forward indentation only). See https://github.com/ckeditor/ckeditor5/issues/14155.
53
- * Otherwise returns true.
54
- */
55
- private _isIndentationChangeAllowed;
29
+ /**
30
+ * The command's indentation behavior.
31
+ */
32
+ private readonly _indentBehavior;
33
+ /**
34
+ * Creates an instance of the command.
35
+ */
36
+ constructor(editor: Editor, indentBehavior: IndentBehavior);
37
+ /**
38
+ * @inheritDoc
39
+ */
40
+ override refresh(): void;
41
+ /**
42
+ * @inheritDoc
43
+ */
44
+ override execute(): void;
45
+ /**
46
+ * Returns blocks from selection that should have blockIndent selection set.
47
+ */
48
+ private _getBlocksToChange;
49
+ /**
50
+ * Returns false if indentation cannot be applied, i.e.:
51
+ * - for blocks disallowed by schema declaration
52
+ * - for blocks in Document Lists (disallowed forward indentation only). See https://github.com/ckeditor/ckeditor5/issues/14155.
53
+ * Otherwise returns true.
54
+ */
55
+ private _isIndentationChangeAllowed;
56
56
  }
@@ -1,25 +1,25 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module indent/indentcommandbehavior/indentbehavior
7
- */
6
+ * @module indent/indentcommandbehavior/indentbehavior
7
+ */
8
8
  /**
9
- * Provides indentation behavior to {@link module:indent/indentblockcommand~IndentBlockCommand}.
10
- */
9
+ * Provides indentation behavior to {@link module:indent/indentblockcommand~IndentBlockCommand}.
10
+ */
11
11
  export interface IndentBehavior {
12
- /**
13
- * The direction of indentation.
14
- */
15
- isForward: boolean;
16
- /**
17
- * Checks if the command should be enabled.
18
- */
19
- checkEnabled: (indentAttributeValue: string) => boolean;
20
- /**
21
- * Returns a new indent attribute value based on the current indent.
22
- * This method returns `undefined` when the indentation should be removed.
23
- */
24
- getNextIndent: (indentAttributeValue: string) => string | undefined;
12
+ /**
13
+ * The direction of indentation.
14
+ */
15
+ isForward: boolean;
16
+ /**
17
+ * Checks if the command should be enabled.
18
+ */
19
+ checkEnabled: (indentAttributeValue: string) => boolean;
20
+ /**
21
+ * Returns a new indent attribute value based on the current indent.
22
+ * This method returns `undefined` when the indentation should be removed.
23
+ */
24
+ getNextIndent: (indentAttributeValue: string) => string | undefined;
25
25
  }
@@ -1,41 +1,41 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module indent/indentcommandbehavior/indentusingclasses
7
- */
8
- import type { IndentBehavior } from './indentbehavior.js';
6
+ * @module indent/indentcommandbehavior/indentusingclasses
7
+ */
8
+ import type { IndentBehavior } from "./indentbehavior.js";
9
9
  /**
10
- * The block indentation behavior that uses classes to set indentation.
11
- *
12
- * @internal
13
- */
10
+ * The block indentation behavior that uses classes to set indentation.
11
+ *
12
+ * @internal
13
+ */
14
14
  export declare class IndentUsingClasses implements IndentBehavior {
15
- /**
16
- * The direction of indentation.
17
- */
18
- isForward: boolean;
19
- /**
20
- * A list of classes used for indentation.
21
- */
22
- classes: Array<string>;
23
- /**
24
- * Creates an instance of the indentation behavior.
25
- *
26
- * @param config.direction The direction of indentation.
27
- * @param config.classes A list of classes used for indentation.
28
- */
29
- constructor(config: {
30
- direction: 'forward' | 'backward';
31
- classes: Array<string>;
32
- });
33
- /**
34
- * @inheritDoc
35
- */
36
- checkEnabled(indentAttributeValue: string): boolean;
37
- /**
38
- * @inheritDoc
39
- */
40
- getNextIndent(indentAttributeValue: string): string | undefined;
15
+ /**
16
+ * The direction of indentation.
17
+ */
18
+ isForward: boolean;
19
+ /**
20
+ * A list of classes used for indentation.
21
+ */
22
+ classes: Array<string>;
23
+ /**
24
+ * Creates an instance of the indentation behavior.
25
+ *
26
+ * @param config.direction The direction of indentation.
27
+ * @param config.classes A list of classes used for indentation.
28
+ */
29
+ constructor(config: {
30
+ direction: "forward" | "backward";
31
+ classes: Array<string>;
32
+ });
33
+ /**
34
+ * @inheritDoc
35
+ */
36
+ checkEnabled(indentAttributeValue: string): boolean;
37
+ /**
38
+ * @inheritDoc
39
+ */
40
+ getNextIndent(indentAttributeValue: string): string | undefined;
41
41
  }
@@ -1,47 +1,47 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module indent/indentcommandbehavior/indentusingoffset
7
- */
8
- import type { IndentBehavior } from './indentbehavior.js';
6
+ * @module indent/indentcommandbehavior/indentusingoffset
7
+ */
8
+ import type { IndentBehavior } from "./indentbehavior.js";
9
9
  /**
10
- * The block indentation behavior that uses offsets to set indentation.
11
- *
12
- * @internal
13
- */
10
+ * The block indentation behavior that uses offsets to set indentation.
11
+ *
12
+ * @internal
13
+ */
14
14
  export declare class IndentUsingOffset implements IndentBehavior {
15
- /**
16
- * The direction of indentation.
17
- */
18
- isForward: boolean;
19
- /**
20
- * The offset of the next indentation step.
21
- */
22
- offset: number;
23
- /**
24
- * Indentation unit.
25
- */
26
- unit: string;
27
- /**
28
- * Creates an instance of the indentation behavior.
29
- *
30
- * @param config.direction The direction of indentation.
31
- * @param config.offset The offset of the next indentation step.
32
- * @param config.unit Indentation unit.
33
- */
34
- constructor(config: {
35
- direction: 'forward' | 'backward';
36
- offset: number;
37
- unit: string;
38
- });
39
- /**
40
- * @inheritDoc
41
- */
42
- checkEnabled(indentAttributeValue: string): boolean;
43
- /**
44
- * @inheritDoc
45
- */
46
- getNextIndent(indentAttributeValue: string): string | undefined;
15
+ /**
16
+ * The direction of indentation.
17
+ */
18
+ isForward: boolean;
19
+ /**
20
+ * The offset of the next indentation step.
21
+ */
22
+ offset: number;
23
+ /**
24
+ * Indentation unit.
25
+ */
26
+ unit: string;
27
+ /**
28
+ * Creates an instance of the indentation behavior.
29
+ *
30
+ * @param config.direction The direction of indentation.
31
+ * @param config.offset The offset of the next indentation step.
32
+ * @param config.unit Indentation unit.
33
+ */
34
+ constructor(config: {
35
+ direction: "forward" | "backward";
36
+ offset: number;
37
+ unit: string;
38
+ });
39
+ /**
40
+ * @inheritDoc
41
+ */
42
+ checkEnabled(indentAttributeValue: string): boolean;
43
+ /**
44
+ * @inheritDoc
45
+ */
46
+ getNextIndent(indentAttributeValue: string): string | undefined;
47
47
  }
@@ -1,24 +1,24 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module indent/indentcommandbehavior/resetindentusingclasses
7
- */
8
- import { IndentUsingClasses } from './indentusingclasses.js';
6
+ * @module indent/indentcommandbehavior/resetindentusingclasses
7
+ */
8
+ import { IndentUsingClasses } from "./indentusingclasses.js";
9
9
  /**
10
- * The list item block indentation behavior that resets class-based indentation toward zero.
11
- *
12
- * Unlike {@link module:indent/indentcommandbehavior/indentusingclasses~IndentUsingClasses}, this behavior
13
- * is enabled only in the backward (outdent) direction when a class-based indentation is set.
14
- * This is because class-based indentation values cannot be negative, so the only way to reset
15
- * them to zero is to remove the class by outdenting.
16
- *
17
- * @internal
18
- */
10
+ * The list item block indentation behavior that resets class-based indentation toward zero.
11
+ *
12
+ * Unlike {@link module:indent/indentcommandbehavior/indentusingclasses~IndentUsingClasses}, this behavior
13
+ * is enabled only in the backward (outdent) direction when a class-based indentation is set.
14
+ * This is because class-based indentation values cannot be negative, so the only way to reset
15
+ * them to zero is to remove the class by outdenting.
16
+ *
17
+ * @internal
18
+ */
19
19
  export declare class ResetIndentUsingClasses extends IndentUsingClasses {
20
- /**
21
- * @inheritDoc
22
- */
23
- checkEnabled(indentAttributeValue: string): boolean;
20
+ /**
21
+ * @inheritDoc
22
+ */
23
+ override checkEnabled(indentAttributeValue: string): boolean;
24
24
  }