@ckeditor/ckeditor5-alignment 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.
- package/dist/alignment.d.ts +28 -28
- package/dist/alignmentcommand.d.ts +38 -38
- package/dist/alignmentconfig.d.ts +64 -64
- package/dist/alignmentediting.d.ts +25 -25
- package/dist/alignmentui.d.ts +64 -64
- package/dist/augmentation.d.ts +21 -21
- package/dist/index-content.css +1 -0
- package/dist/index-editor.css +1 -0
- package/dist/index.css +0 -2
- package/dist/index.d.ts +12 -12
- package/dist/index.js +504 -549
- package/dist/index.js.map +1 -1
- package/dist/utils.d.ts +34 -34
- package/package.json +6 -6
- package/dist/index.css.map +0 -1
package/dist/alignment.d.ts
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
import { Plugin } from
|
|
9
|
-
import { AlignmentEditing } from
|
|
10
|
-
import { AlignmentUI } from
|
|
6
|
+
* @module alignment/alignment
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import { AlignmentEditing } from "./alignmentediting.js";
|
|
10
|
+
import { AlignmentUI } from "./alignmentui.js";
|
|
11
11
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
* The text alignment plugin.
|
|
13
|
+
*
|
|
14
|
+
* For a detailed overview, check the {@glink features/text-alignment Text alignment} feature guide
|
|
15
|
+
* and the {@glink api/alignment package page}.
|
|
16
|
+
*
|
|
17
|
+
* This is a "glue" plugin which loads the {@link module:alignment/alignmentediting~AlignmentEditing} and
|
|
18
|
+
* {@link module:alignment/alignmentui~AlignmentUI} plugins.
|
|
19
|
+
*/
|
|
20
20
|
export declare class Alignment extends Plugin {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
static get requires(): PluginDependenciesOf<[AlignmentEditing, AlignmentUI]>;
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
static get pluginName(): "Alignment";
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
static override get isOfficialPlugin(): true;
|
|
33
33
|
}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
import { Command } from
|
|
9
|
-
import type { AlignmentSupportedOption } from
|
|
6
|
+
* @module alignment/alignmentcommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import type { AlignmentSupportedOption } from "./alignmentconfig.js";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
* The alignment command plugin.
|
|
12
|
+
*/
|
|
13
13
|
export declare class AlignmentCommand extends Command {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
14
|
+
/**
|
|
15
|
+
* A value of the current block's alignment.
|
|
16
|
+
*
|
|
17
|
+
* @observable
|
|
18
|
+
* @readonly
|
|
19
|
+
*/
|
|
20
|
+
value: AlignmentSupportedOption;
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
override refresh(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Executes the command. Applies the alignment `value` to the selected blocks.
|
|
27
|
+
* If no `value` is passed, the `value` is the default one or it is equal to the currently selected block's alignment attribute,
|
|
28
|
+
* the command will remove the attribute from the selected blocks.
|
|
29
|
+
*
|
|
30
|
+
* @param options Options for the executed command.
|
|
31
|
+
* @param options.value The value to apply.
|
|
32
|
+
* @fires execute
|
|
33
|
+
*/
|
|
34
|
+
override execute(options?: {
|
|
35
|
+
value?: AlignmentSupportedOption;
|
|
36
|
+
}): void;
|
|
37
|
+
/**
|
|
38
|
+
* Checks whether a block can have alignment set.
|
|
39
|
+
*
|
|
40
|
+
* @param block The block to be checked.
|
|
41
|
+
*/
|
|
42
|
+
private _canBeAligned;
|
|
43
43
|
}
|
|
@@ -1,72 +1,72 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
7
|
-
|
|
6
|
+
* @module alignment/alignmentconfig
|
|
7
|
+
*/
|
|
8
8
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
9
|
+
* The configuration of the {@link module:alignment/alignment~Alignment alignment feature}.
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* ClassicEditor
|
|
13
|
+
* .create( {
|
|
14
|
+
* alignment: {
|
|
15
|
+
* options: [ 'left', 'right' ]
|
|
16
|
+
* }
|
|
17
|
+
* } )
|
|
18
|
+
* .then( ... )
|
|
19
|
+
* .catch( ... );
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* See {@link module:core/editor/editorconfig~EditorConfig all editor configuration options}.
|
|
23
|
+
*/
|
|
24
24
|
export interface AlignmentConfig {
|
|
25
|
-
|
|
25
|
+
options?: Array<AlignmentSupportedOption | AlignmentFormat>;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
28
|
+
* Available alignment options.
|
|
29
|
+
*
|
|
30
|
+
* The available options are: `'left'`, `'right'`, `'center'` and `'justify'`. Other values are ignored.
|
|
31
|
+
*
|
|
32
|
+
* **Note:** It is recommended to always use `'left'` or `'right'` as these are default values which the user should
|
|
33
|
+
* normally be able to choose depending on the
|
|
34
|
+
* {@glink getting-started/setup/ui-language#setting-the-language-of-the-content language of the editor content}.
|
|
35
|
+
*
|
|
36
|
+
* ```ts
|
|
37
|
+
* ClassicEditor
|
|
38
|
+
* .create( {
|
|
39
|
+
* alignment: {
|
|
40
|
+
* options: [ 'left', 'right' ]
|
|
41
|
+
* }
|
|
42
|
+
* } )
|
|
43
|
+
* .then( ... )
|
|
44
|
+
* .catch( ... );
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* By default the alignment is set inline using the `text-align` CSS property. To further customize the alignment,
|
|
48
|
+
* you can provide names of classes for each alignment option using the `className` property.
|
|
49
|
+
*
|
|
50
|
+
* **Note:** Once you define the `className` property for one option, you need to specify it for all other options.
|
|
51
|
+
*
|
|
52
|
+
* ```ts
|
|
53
|
+
* ClassicEditor
|
|
54
|
+
* .create( {
|
|
55
|
+
* alignment: {
|
|
56
|
+
* options: [
|
|
57
|
+
* { name: 'left', className: 'my-align-left' },
|
|
58
|
+
* { name: 'right', className: 'my-align-right' }
|
|
59
|
+
* ]
|
|
60
|
+
* }
|
|
61
|
+
* } )
|
|
62
|
+
* .then( ... )
|
|
63
|
+
* .catch( ... );
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* See the demo of {@glink features/text-alignment#configuring-alignment-options custom alignment options}.
|
|
67
|
+
*/
|
|
68
68
|
export type AlignmentFormat = {
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
name: AlignmentSupportedOption;
|
|
70
|
+
className?: string;
|
|
71
71
|
};
|
|
72
|
-
export type AlignmentSupportedOption =
|
|
72
|
+
export type AlignmentSupportedOption = "left" | "right" | "center" | "justify";
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
import { Plugin, type Editor } from
|
|
6
|
+
* @module alignment/alignmentediting
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type Editor } from "@ckeditor/ckeditor5-core";
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
* The alignment editing feature. It introduces the {@link module:alignment/alignmentcommand~AlignmentCommand command} and adds
|
|
11
|
+
* the `alignment` attribute for block elements in the {@link module:engine/model/model~Model model}.
|
|
12
|
+
*/
|
|
13
13
|
export declare class AlignmentEditing extends Plugin {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
14
|
+
/**
|
|
15
|
+
* @inheritDoc
|
|
16
|
+
*/
|
|
17
|
+
static get pluginName(): "AlignmentEditing";
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
static override get isOfficialPlugin(): true;
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
constructor(editor: Editor);
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
init(): void;
|
|
30
30
|
}
|
package/dist/alignmentui.d.ts
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
import { Plugin } from
|
|
9
|
-
import type { AlignmentSupportedOption } from
|
|
6
|
+
* @module alignment/alignmentui
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import type { AlignmentSupportedOption } from "./alignmentconfig.js";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
* The default alignment UI plugin.
|
|
12
|
+
*
|
|
13
|
+
* It introduces the `'alignment:left'`, `'alignment:right'`, `'alignment:center'` and `'alignment:justify'` buttons
|
|
14
|
+
* and the `'alignment'` dropdown.
|
|
15
|
+
*/
|
|
16
16
|
export declare class AlignmentUI extends Plugin {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Returns the localized option titles provided by the plugin.
|
|
19
|
+
*
|
|
20
|
+
* The following localized titles corresponding with
|
|
21
|
+
* {@link module:alignment/alignmentconfig~AlignmentConfig#options} are available:
|
|
22
|
+
*
|
|
23
|
+
* * `'left'`,
|
|
24
|
+
* * `'right'`,
|
|
25
|
+
* * `'center'`,
|
|
26
|
+
* * `'justify'`.
|
|
27
|
+
*
|
|
28
|
+
* @readonly
|
|
29
|
+
*/
|
|
30
|
+
get localizedOptionTitles(): Record<AlignmentSupportedOption, string>;
|
|
31
|
+
/**
|
|
32
|
+
* @inheritDoc
|
|
33
|
+
*/
|
|
34
|
+
static get pluginName(): "AlignmentUI";
|
|
35
|
+
/**
|
|
36
|
+
* @inheritDoc
|
|
37
|
+
*/
|
|
38
|
+
static override get isOfficialPlugin(): true;
|
|
39
|
+
/**
|
|
40
|
+
* @inheritDoc
|
|
41
|
+
*/
|
|
42
|
+
init(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Helper method for initializing the button and linking it with an appropriate command.
|
|
45
|
+
*
|
|
46
|
+
* @param option The name of the alignment option for which the button is added.
|
|
47
|
+
*/
|
|
48
|
+
private _addButton;
|
|
49
|
+
/**
|
|
50
|
+
* Helper method for creating the button view element.
|
|
51
|
+
*
|
|
52
|
+
* @param locale Editor locale.
|
|
53
|
+
* @param option The name of the alignment option for which the button is added.
|
|
54
|
+
* @param buttonAttrs Optional parameters passed to button view instance.
|
|
55
|
+
*/
|
|
56
|
+
private _createButton;
|
|
57
|
+
/**
|
|
58
|
+
* Helper method for initializing the toolnar dropdown and linking it with an appropriate command.
|
|
59
|
+
*
|
|
60
|
+
* @param options The name of the alignment option for which the button is added.
|
|
61
|
+
*/
|
|
62
|
+
private _addToolbarDropdown;
|
|
63
|
+
/**
|
|
64
|
+
* Creates a menu for all alignment options to use either in menu bar.
|
|
65
|
+
*
|
|
66
|
+
* @param options Normalized alignment options from config.
|
|
67
|
+
*/
|
|
68
|
+
private _addMenuBarMenu;
|
|
69
69
|
}
|
package/dist/augmentation.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import type { Alignment, AlignmentEditing, AlignmentUI, AlignmentCommand, AlignmentConfig } from
|
|
6
|
-
declare module
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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 { Alignment, AlignmentEditing, AlignmentUI, AlignmentCommand, AlignmentConfig } from "./index.js";
|
|
6
|
+
declare module "@ckeditor/ckeditor5-core" {
|
|
7
|
+
interface EditorConfig {
|
|
8
|
+
/**
|
|
9
|
+
* The configuration of the {@link module:alignment/alignment~Alignment alignment feature}.
|
|
10
|
+
*
|
|
11
|
+
* Read more in {@link module:alignment/alignmentconfig~AlignmentConfig}.
|
|
12
|
+
*/
|
|
13
|
+
alignment?: AlignmentConfig;
|
|
14
|
+
}
|
|
15
|
+
interface PluginsMap {
|
|
16
|
+
[Alignment.pluginName]: Alignment;
|
|
17
|
+
[AlignmentUI.pluginName]: AlignmentUI;
|
|
18
|
+
[AlignmentEditing.pluginName]: AlignmentEditing;
|
|
19
|
+
}
|
|
20
|
+
interface CommandsMap {
|
|
21
|
+
alignment: AlignmentCommand;
|
|
22
|
+
}
|
|
23
23
|
}
|
package/dist/index-content.css
CHANGED
package/dist/index-editor.css
CHANGED
package/dist/index.css
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
export { Alignment } from
|
|
9
|
-
export { AlignmentEditing } from
|
|
10
|
-
export { AlignmentUI } from
|
|
11
|
-
export { AlignmentCommand } from
|
|
12
|
-
export type { AlignmentConfig, AlignmentFormat, AlignmentSupportedOption } from
|
|
13
|
-
export { supportedOptions as _ALIGNMENT_SUPPORTED_OPTIONS, isSupported as _isAlignmentSupported, isDefault as _isDefaultAlignment, normalizeAlignmentOptions as _normalizeAlignmentOptions } from
|
|
14
|
-
import
|
|
6
|
+
* @module alignment
|
|
7
|
+
*/
|
|
8
|
+
export { Alignment } from "./alignment.js";
|
|
9
|
+
export { AlignmentEditing } from "./alignmentediting.js";
|
|
10
|
+
export { AlignmentUI } from "./alignmentui.js";
|
|
11
|
+
export { AlignmentCommand } from "./alignmentcommand.js";
|
|
12
|
+
export type { AlignmentConfig, AlignmentFormat, AlignmentSupportedOption } from "./alignmentconfig.js";
|
|
13
|
+
export { supportedOptions as _ALIGNMENT_SUPPORTED_OPTIONS, isSupported as _isAlignmentSupported, isDefault as _isDefaultAlignment, normalizeAlignmentOptions as _normalizeAlignmentOptions } from "./utils.js";
|
|
14
|
+
import "./augmentation.js";
|