@ckeditor/ckeditor5-alignment 40.0.0 → 40.2.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/CHANGELOG.md +19 -19
- package/LICENSE.md +2 -2
- package/package.json +2 -2
- package/src/alignment.d.ts +29 -29
- package/src/alignment.js +33 -33
- package/src/alignmentcommand.d.ts +43 -43
- package/src/alignmentcommand.js +88 -88
- package/src/alignmentconfig.d.ts +72 -72
- package/src/alignmentconfig.js +5 -5
- package/src/alignmentediting.d.ts +26 -26
- package/src/alignmentediting.js +147 -147
- package/src/alignmentui.d.ts +45 -45
- package/src/alignmentui.js +124 -124
- package/src/augmentation.d.ts +23 -23
- package/src/augmentation.js +5 -5
- package/src/index.d.ts +13 -13
- package/src/index.js +11 -11
- package/src/utils.d.ts +39 -39
- package/src/utils.js +118 -118
- package/build/alignment.js.map +0 -1
package/src/alignmentui.js
CHANGED
|
@@ -1,124 +1,124 @@
|
|
|
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 alignment/alignmentui
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin, icons } from 'ckeditor5/src/core';
|
|
9
|
-
import { ButtonView, createDropdown, addToolbarToDropdown } from 'ckeditor5/src/ui';
|
|
10
|
-
import { isSupported, normalizeAlignmentOptions } from './utils';
|
|
11
|
-
const iconsMap = new Map([
|
|
12
|
-
['left', icons.alignLeft],
|
|
13
|
-
['right', icons.alignRight],
|
|
14
|
-
['center', icons.alignCenter],
|
|
15
|
-
['justify', icons.alignJustify]
|
|
16
|
-
]);
|
|
17
|
-
/**
|
|
18
|
-
* The default alignment UI plugin.
|
|
19
|
-
*
|
|
20
|
-
* It introduces the `'alignment:left'`, `'alignment:right'`, `'alignment:center'` and `'alignment:justify'` buttons
|
|
21
|
-
* and the `'alignment'` dropdown.
|
|
22
|
-
*/
|
|
23
|
-
export default class AlignmentUI extends Plugin {
|
|
24
|
-
/**
|
|
25
|
-
* Returns the localized option titles provided by the plugin.
|
|
26
|
-
*
|
|
27
|
-
* The following localized titles corresponding with
|
|
28
|
-
* {@link module:alignment/alignmentconfig~AlignmentConfig#options} are available:
|
|
29
|
-
*
|
|
30
|
-
* * `'left'`,
|
|
31
|
-
* * `'right'`,
|
|
32
|
-
* * `'center'`,
|
|
33
|
-
* * `'justify'`.
|
|
34
|
-
*
|
|
35
|
-
* @readonly
|
|
36
|
-
*/
|
|
37
|
-
get localizedOptionTitles() {
|
|
38
|
-
const t = this.editor.t;
|
|
39
|
-
return {
|
|
40
|
-
'left': t('Align left'),
|
|
41
|
-
'right': t('Align right'),
|
|
42
|
-
'center': t('Align center'),
|
|
43
|
-
'justify': t('Justify')
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* @inheritDoc
|
|
48
|
-
*/
|
|
49
|
-
static get pluginName() {
|
|
50
|
-
return 'AlignmentUI';
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* @inheritDoc
|
|
54
|
-
*/
|
|
55
|
-
init() {
|
|
56
|
-
const editor = this.editor;
|
|
57
|
-
const componentFactory = editor.ui.componentFactory;
|
|
58
|
-
const t = editor.t;
|
|
59
|
-
const options = normalizeAlignmentOptions(editor.config.get('alignment.options'));
|
|
60
|
-
options
|
|
61
|
-
.map(option => option.name)
|
|
62
|
-
.filter(isSupported)
|
|
63
|
-
.forEach(option => this._addButton(option));
|
|
64
|
-
componentFactory.add('alignment', locale => {
|
|
65
|
-
const dropdownView = createDropdown(locale);
|
|
66
|
-
// Add existing alignment buttons to dropdown's toolbar.
|
|
67
|
-
addToolbarToDropdown(dropdownView, () => options.map(option => componentFactory.create(`alignment:${option.name}`)), {
|
|
68
|
-
enableActiveItemFocusOnDropdownOpen: true,
|
|
69
|
-
isVertical: true,
|
|
70
|
-
ariaLabel: t('Text alignment toolbar')
|
|
71
|
-
});
|
|
72
|
-
// Configure dropdown properties an behavior.
|
|
73
|
-
dropdownView.buttonView.set({
|
|
74
|
-
label: t('Text alignment'),
|
|
75
|
-
tooltip: true
|
|
76
|
-
});
|
|
77
|
-
dropdownView.extendTemplate({
|
|
78
|
-
attributes: {
|
|
79
|
-
class: 'ck-alignment-dropdown'
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
// The default icon depends on the direction of the content.
|
|
83
|
-
const defaultIcon = locale.contentLanguageDirection === 'rtl' ? iconsMap.get('right') : iconsMap.get('left');
|
|
84
|
-
const command = editor.commands.get('alignment');
|
|
85
|
-
// Change icon to reflect current selection's alignment.
|
|
86
|
-
dropdownView.buttonView.bind('icon').to(command, 'value', value => iconsMap.get(value) || defaultIcon);
|
|
87
|
-
// Enable button if any of the buttons is enabled.
|
|
88
|
-
dropdownView.bind('isEnabled').to(command, 'isEnabled');
|
|
89
|
-
// Focus the editable after executing the command.
|
|
90
|
-
// Overrides a default behaviour where the focus is moved to the dropdown button (#12125).
|
|
91
|
-
this.listenTo(dropdownView, 'execute', () => {
|
|
92
|
-
editor.editing.view.focus();
|
|
93
|
-
});
|
|
94
|
-
return dropdownView;
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Helper method for initializing the button and linking it with an appropriate command.
|
|
99
|
-
*
|
|
100
|
-
* @param option The name of the alignment option for which the button is added.
|
|
101
|
-
*/
|
|
102
|
-
_addButton(option) {
|
|
103
|
-
const editor = this.editor;
|
|
104
|
-
editor.ui.componentFactory.add(`alignment:${option}`, locale => {
|
|
105
|
-
const command = editor.commands.get('alignment');
|
|
106
|
-
const buttonView = new ButtonView(locale);
|
|
107
|
-
buttonView.set({
|
|
108
|
-
label: this.localizedOptionTitles[option],
|
|
109
|
-
icon: iconsMap.get(option),
|
|
110
|
-
tooltip: true,
|
|
111
|
-
isToggleable: true
|
|
112
|
-
});
|
|
113
|
-
// Bind button model to command.
|
|
114
|
-
buttonView.bind('isEnabled').to(command);
|
|
115
|
-
buttonView.bind('isOn').to(command, 'value', value => value === option);
|
|
116
|
-
// Execute command.
|
|
117
|
-
this.listenTo(buttonView, 'execute', () => {
|
|
118
|
-
editor.execute('alignment', { value: option });
|
|
119
|
-
editor.editing.view.focus();
|
|
120
|
-
});
|
|
121
|
-
return buttonView;
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
}
|
|
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 alignment/alignmentui
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, icons } from 'ckeditor5/src/core';
|
|
9
|
+
import { ButtonView, createDropdown, addToolbarToDropdown } from 'ckeditor5/src/ui';
|
|
10
|
+
import { isSupported, normalizeAlignmentOptions } from './utils';
|
|
11
|
+
const iconsMap = new Map([
|
|
12
|
+
['left', icons.alignLeft],
|
|
13
|
+
['right', icons.alignRight],
|
|
14
|
+
['center', icons.alignCenter],
|
|
15
|
+
['justify', icons.alignJustify]
|
|
16
|
+
]);
|
|
17
|
+
/**
|
|
18
|
+
* The default alignment UI plugin.
|
|
19
|
+
*
|
|
20
|
+
* It introduces the `'alignment:left'`, `'alignment:right'`, `'alignment:center'` and `'alignment:justify'` buttons
|
|
21
|
+
* and the `'alignment'` dropdown.
|
|
22
|
+
*/
|
|
23
|
+
export default class AlignmentUI extends Plugin {
|
|
24
|
+
/**
|
|
25
|
+
* Returns the localized option titles provided by the plugin.
|
|
26
|
+
*
|
|
27
|
+
* The following localized titles corresponding with
|
|
28
|
+
* {@link module:alignment/alignmentconfig~AlignmentConfig#options} are available:
|
|
29
|
+
*
|
|
30
|
+
* * `'left'`,
|
|
31
|
+
* * `'right'`,
|
|
32
|
+
* * `'center'`,
|
|
33
|
+
* * `'justify'`.
|
|
34
|
+
*
|
|
35
|
+
* @readonly
|
|
36
|
+
*/
|
|
37
|
+
get localizedOptionTitles() {
|
|
38
|
+
const t = this.editor.t;
|
|
39
|
+
return {
|
|
40
|
+
'left': t('Align left'),
|
|
41
|
+
'right': t('Align right'),
|
|
42
|
+
'center': t('Align center'),
|
|
43
|
+
'justify': t('Justify')
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @inheritDoc
|
|
48
|
+
*/
|
|
49
|
+
static get pluginName() {
|
|
50
|
+
return 'AlignmentUI';
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* @inheritDoc
|
|
54
|
+
*/
|
|
55
|
+
init() {
|
|
56
|
+
const editor = this.editor;
|
|
57
|
+
const componentFactory = editor.ui.componentFactory;
|
|
58
|
+
const t = editor.t;
|
|
59
|
+
const options = normalizeAlignmentOptions(editor.config.get('alignment.options'));
|
|
60
|
+
options
|
|
61
|
+
.map(option => option.name)
|
|
62
|
+
.filter(isSupported)
|
|
63
|
+
.forEach(option => this._addButton(option));
|
|
64
|
+
componentFactory.add('alignment', locale => {
|
|
65
|
+
const dropdownView = createDropdown(locale);
|
|
66
|
+
// Add existing alignment buttons to dropdown's toolbar.
|
|
67
|
+
addToolbarToDropdown(dropdownView, () => options.map(option => componentFactory.create(`alignment:${option.name}`)), {
|
|
68
|
+
enableActiveItemFocusOnDropdownOpen: true,
|
|
69
|
+
isVertical: true,
|
|
70
|
+
ariaLabel: t('Text alignment toolbar')
|
|
71
|
+
});
|
|
72
|
+
// Configure dropdown properties an behavior.
|
|
73
|
+
dropdownView.buttonView.set({
|
|
74
|
+
label: t('Text alignment'),
|
|
75
|
+
tooltip: true
|
|
76
|
+
});
|
|
77
|
+
dropdownView.extendTemplate({
|
|
78
|
+
attributes: {
|
|
79
|
+
class: 'ck-alignment-dropdown'
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
// The default icon depends on the direction of the content.
|
|
83
|
+
const defaultIcon = locale.contentLanguageDirection === 'rtl' ? iconsMap.get('right') : iconsMap.get('left');
|
|
84
|
+
const command = editor.commands.get('alignment');
|
|
85
|
+
// Change icon to reflect current selection's alignment.
|
|
86
|
+
dropdownView.buttonView.bind('icon').to(command, 'value', value => iconsMap.get(value) || defaultIcon);
|
|
87
|
+
// Enable button if any of the buttons is enabled.
|
|
88
|
+
dropdownView.bind('isEnabled').to(command, 'isEnabled');
|
|
89
|
+
// Focus the editable after executing the command.
|
|
90
|
+
// Overrides a default behaviour where the focus is moved to the dropdown button (#12125).
|
|
91
|
+
this.listenTo(dropdownView, 'execute', () => {
|
|
92
|
+
editor.editing.view.focus();
|
|
93
|
+
});
|
|
94
|
+
return dropdownView;
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Helper method for initializing the button and linking it with an appropriate command.
|
|
99
|
+
*
|
|
100
|
+
* @param option The name of the alignment option for which the button is added.
|
|
101
|
+
*/
|
|
102
|
+
_addButton(option) {
|
|
103
|
+
const editor = this.editor;
|
|
104
|
+
editor.ui.componentFactory.add(`alignment:${option}`, locale => {
|
|
105
|
+
const command = editor.commands.get('alignment');
|
|
106
|
+
const buttonView = new ButtonView(locale);
|
|
107
|
+
buttonView.set({
|
|
108
|
+
label: this.localizedOptionTitles[option],
|
|
109
|
+
icon: iconsMap.get(option),
|
|
110
|
+
tooltip: true,
|
|
111
|
+
isToggleable: true
|
|
112
|
+
});
|
|
113
|
+
// Bind button model to command.
|
|
114
|
+
buttonView.bind('isEnabled').to(command);
|
|
115
|
+
buttonView.bind('isOn').to(command, 'value', value => value === option);
|
|
116
|
+
// Execute command.
|
|
117
|
+
this.listenTo(buttonView, 'execute', () => {
|
|
118
|
+
editor.execute('alignment', { value: option });
|
|
119
|
+
editor.editing.view.focus();
|
|
120
|
+
});
|
|
121
|
+
return buttonView;
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
package/src/augmentation.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
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 { Alignment, AlignmentEditing, AlignmentUI, AlignmentCommand, AlignmentConfig } from './index';
|
|
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
|
-
}
|
|
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 { Alignment, AlignmentEditing, AlignmentUI, AlignmentCommand, AlignmentConfig } from './index';
|
|
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
|
+
}
|
package/src/augmentation.js
CHANGED
|
@@ -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/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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 alignment
|
|
7
|
-
*/
|
|
8
|
-
export { default as Alignment } from './alignment';
|
|
9
|
-
export { default as AlignmentEditing } from './alignmentediting';
|
|
10
|
-
export { default as AlignmentUI } from './alignmentui';
|
|
11
|
-
export type { default as AlignmentCommand } from './alignmentcommand';
|
|
12
|
-
export type { AlignmentConfig } from './alignmentconfig';
|
|
13
|
-
import './augmentation';
|
|
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 alignment
|
|
7
|
+
*/
|
|
8
|
+
export { default as Alignment } from './alignment';
|
|
9
|
+
export { default as AlignmentEditing } from './alignmentediting';
|
|
10
|
+
export { default as AlignmentUI } from './alignmentui';
|
|
11
|
+
export type { default as AlignmentCommand } from './alignmentcommand';
|
|
12
|
+
export type { AlignmentConfig } from './alignmentconfig';
|
|
13
|
+
import './augmentation';
|
package/src/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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 alignment
|
|
7
|
-
*/
|
|
8
|
-
export { default as Alignment } from './alignment';
|
|
9
|
-
export { default as AlignmentEditing } from './alignmentediting';
|
|
10
|
-
export { default as AlignmentUI } from './alignmentui';
|
|
11
|
-
import './augmentation';
|
|
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 alignment
|
|
7
|
+
*/
|
|
8
|
+
export { default as Alignment } from './alignment';
|
|
9
|
+
export { default as AlignmentEditing } from './alignmentediting';
|
|
10
|
+
export { default as AlignmentUI } from './alignmentui';
|
|
11
|
+
import './augmentation';
|
package/src/utils.d.ts
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
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 Locale } from 'ckeditor5/src/utils';
|
|
6
|
-
import type { AlignmentFormat, SupportedOption } from './alignmentconfig';
|
|
7
|
-
/**
|
|
8
|
-
* @module alignment/utils
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* The list of supported alignment options:
|
|
12
|
-
*
|
|
13
|
-
* * `'left'`,
|
|
14
|
-
* * `'right'`,
|
|
15
|
-
* * `'center'`,
|
|
16
|
-
* * `'justify'`
|
|
17
|
-
*/
|
|
18
|
-
export declare const supportedOptions: ReadonlyArray<SupportedOption>;
|
|
19
|
-
/**
|
|
20
|
-
* Checks whether the passed option is supported by {@link module:alignment/alignmentediting~AlignmentEditing}.
|
|
21
|
-
*
|
|
22
|
-
* @param option The option value to check.
|
|
23
|
-
*/
|
|
24
|
-
export declare function isSupported(option: string): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Checks whether alignment is the default one considering the direction
|
|
27
|
-
* of the editor content.
|
|
28
|
-
*
|
|
29
|
-
* @param alignment The name of the alignment to check.
|
|
30
|
-
* @param locale The {@link module:core/editor/editor~Editor#locale} instance.
|
|
31
|
-
*/
|
|
32
|
-
export declare function isDefault(alignment: string, locale: Locale): boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Brings the configuration to the common form, an array of objects.
|
|
35
|
-
*
|
|
36
|
-
* @param configuredOptions Alignment plugin configuration.
|
|
37
|
-
* @returns Normalized object holding the configuration.
|
|
38
|
-
*/
|
|
39
|
-
export declare function normalizeAlignmentOptions(configuredOptions: Array<string | AlignmentFormat>): Array<AlignmentFormat>;
|
|
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 Locale } from 'ckeditor5/src/utils';
|
|
6
|
+
import type { AlignmentFormat, SupportedOption } from './alignmentconfig';
|
|
7
|
+
/**
|
|
8
|
+
* @module alignment/utils
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* The list of supported alignment options:
|
|
12
|
+
*
|
|
13
|
+
* * `'left'`,
|
|
14
|
+
* * `'right'`,
|
|
15
|
+
* * `'center'`,
|
|
16
|
+
* * `'justify'`
|
|
17
|
+
*/
|
|
18
|
+
export declare const supportedOptions: ReadonlyArray<SupportedOption>;
|
|
19
|
+
/**
|
|
20
|
+
* Checks whether the passed option is supported by {@link module:alignment/alignmentediting~AlignmentEditing}.
|
|
21
|
+
*
|
|
22
|
+
* @param option The option value to check.
|
|
23
|
+
*/
|
|
24
|
+
export declare function isSupported(option: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Checks whether alignment is the default one considering the direction
|
|
27
|
+
* of the editor content.
|
|
28
|
+
*
|
|
29
|
+
* @param alignment The name of the alignment to check.
|
|
30
|
+
* @param locale The {@link module:core/editor/editor~Editor#locale} instance.
|
|
31
|
+
*/
|
|
32
|
+
export declare function isDefault(alignment: string, locale: Locale): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Brings the configuration to the common form, an array of objects.
|
|
35
|
+
*
|
|
36
|
+
* @param configuredOptions Alignment plugin configuration.
|
|
37
|
+
* @returns Normalized object holding the configuration.
|
|
38
|
+
*/
|
|
39
|
+
export declare function normalizeAlignmentOptions(configuredOptions: Array<string | AlignmentFormat>): Array<AlignmentFormat>;
|