@ckeditor/ckeditor5-font 40.2.0 → 41.1.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/LICENSE.md +1 -1
- package/build/font.js +2 -2
- package/lang/translations/ar.po +1 -1
- package/lang/translations/az.po +1 -1
- package/lang/translations/bg.po +1 -1
- package/lang/translations/bn.po +1 -1
- package/lang/translations/bs.po +1 -1
- package/lang/translations/ca.po +1 -1
- package/lang/translations/cs.po +1 -1
- package/lang/translations/da.po +1 -1
- package/lang/translations/de-ch.po +1 -1
- package/lang/translations/de.po +1 -1
- package/lang/translations/el.po +1 -1
- package/lang/translations/en-au.po +1 -1
- package/lang/translations/en-gb.po +1 -1
- package/lang/translations/en.po +1 -1
- package/lang/translations/es.po +1 -1
- package/lang/translations/et.po +1 -1
- package/lang/translations/fa.po +1 -1
- package/lang/translations/fi.po +1 -1
- package/lang/translations/fr.po +1 -1
- package/lang/translations/gl.po +1 -1
- package/lang/translations/he.po +1 -1
- package/lang/translations/hi.po +1 -1
- package/lang/translations/hr.po +1 -1
- package/lang/translations/hu.po +1 -1
- package/lang/translations/id.po +1 -1
- package/lang/translations/it.po +1 -1
- package/lang/translations/ja.po +1 -1
- package/lang/translations/jv.po +1 -1
- package/lang/translations/ko.po +1 -1
- package/lang/translations/ku.po +1 -1
- package/lang/translations/lt.po +1 -1
- package/lang/translations/lv.po +1 -1
- package/lang/translations/ms.po +1 -1
- package/lang/translations/nb.po +1 -1
- package/lang/translations/ne.po +1 -1
- package/lang/translations/nl.po +1 -1
- package/lang/translations/no.po +1 -1
- package/lang/translations/pl.po +1 -1
- package/lang/translations/pt-br.po +1 -1
- package/lang/translations/pt.po +1 -1
- package/lang/translations/ro.po +1 -1
- package/lang/translations/ru.po +1 -1
- package/lang/translations/sk.po +1 -1
- package/lang/translations/sl.po +1 -1
- package/lang/translations/sq.po +1 -1
- package/lang/translations/sr-latn.po +1 -1
- package/lang/translations/sr.po +1 -1
- package/lang/translations/sv.po +1 -1
- package/lang/translations/th.po +1 -1
- package/lang/translations/tk.po +1 -1
- package/lang/translations/tr.po +1 -1
- package/lang/translations/ug.po +1 -1
- package/lang/translations/uk.po +1 -1
- package/lang/translations/ur.po +1 -1
- package/lang/translations/uz.po +1 -1
- package/lang/translations/vi.po +1 -1
- package/lang/translations/zh-cn.po +1 -1
- package/lang/translations/zh.po +1 -1
- package/package.json +3 -2
- package/src/augmentation.d.ts +2 -2
- package/src/augmentation.js +1 -1
- package/src/font.d.ts +6 -6
- package/src/font.js +6 -6
- package/src/fontbackgroundcolor/fontbackgroundcolorcommand.d.ts +3 -3
- package/src/fontbackgroundcolor/fontbackgroundcolorcommand.js +3 -3
- package/src/fontbackgroundcolor/fontbackgroundcolorediting.d.ts +2 -2
- package/src/fontbackgroundcolor/fontbackgroundcolorediting.js +5 -5
- package/src/fontbackgroundcolor/fontbackgroundcolorui.d.ts +3 -3
- package/src/fontbackgroundcolor/fontbackgroundcolorui.js +3 -3
- package/src/fontbackgroundcolor.d.ts +4 -4
- package/src/fontbackgroundcolor.js +4 -4
- package/src/fontcolor/fontcolorcommand.d.ts +3 -3
- package/src/fontcolor/fontcolorcommand.js +3 -3
- package/src/fontcolor/fontcolorediting.d.ts +2 -2
- package/src/fontcolor/fontcolorediting.js +4 -4
- package/src/fontcolor/fontcolorui.d.ts +3 -3
- package/src/fontcolor/fontcolorui.js +3 -3
- package/src/fontcolor.d.ts +4 -4
- package/src/fontcolor.js +4 -4
- package/src/fontcommand.d.ts +3 -3
- package/src/fontcommand.js +2 -2
- package/src/fontconfig.d.ts +3 -3
- package/src/fontconfig.js +1 -1
- package/src/fontfamily/fontfamilycommand.d.ts +3 -3
- package/src/fontfamily/fontfamilycommand.js +3 -3
- package/src/fontfamily/fontfamilyediting.d.ts +2 -2
- package/src/fontfamily/fontfamilyediting.js +5 -5
- package/src/fontfamily/fontfamilyui.d.ts +2 -2
- package/src/fontfamily/fontfamilyui.js +7 -7
- package/src/fontfamily/utils.d.ts +2 -2
- package/src/fontfamily/utils.js +1 -1
- package/src/fontfamily.d.ts +4 -4
- package/src/fontfamily.js +4 -4
- package/src/fontsize/fontsizecommand.d.ts +3 -3
- package/src/fontsize/fontsizecommand.js +3 -3
- package/src/fontsize/fontsizeediting.d.ts +2 -2
- package/src/fontsize/fontsizeediting.js +7 -7
- package/src/fontsize/fontsizeui.d.ts +2 -2
- package/src/fontsize/fontsizeui.js +7 -7
- package/src/fontsize/utils.d.ts +2 -2
- package/src/fontsize/utils.js +2 -2
- package/src/fontsize.d.ts +5 -5
- package/src/fontsize.js +5 -5
- package/src/index.d.ts +21 -21
- package/src/index.js +15 -15
- package/src/ui/colorui.d.ts +3 -8
- package/src/ui/colorui.js +12 -13
- package/src/utils.d.ts +5 -5
- package/src/utils.js +2 -2
- package/theme/fontsize.css +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module font/fontsize/fontsizeui
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import {
|
|
10
|
-
import { Collection } from 'ckeditor5/src/utils';
|
|
11
|
-
import { normalizeOptions } from './utils';
|
|
12
|
-
import { FONT_SIZE } from '../utils';
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import { ViewModel, createDropdown, addListToDropdown } from 'ckeditor5/src/ui.js';
|
|
10
|
+
import { Collection } from 'ckeditor5/src/utils.js';
|
|
11
|
+
import { normalizeOptions } from './utils.js';
|
|
12
|
+
import { FONT_SIZE } from '../utils.js';
|
|
13
13
|
import '../../theme/fontsize.css';
|
|
14
14
|
import fontSizeIcon from '../../theme/icons/font-size.svg';
|
|
15
15
|
/**
|
|
@@ -97,7 +97,7 @@ function _prepareListOptions(options, command) {
|
|
|
97
97
|
for (const option of options) {
|
|
98
98
|
const def = {
|
|
99
99
|
type: 'button',
|
|
100
|
-
model: new
|
|
100
|
+
model: new ViewModel({
|
|
101
101
|
commandName: FONT_SIZE,
|
|
102
102
|
commandParam: option.model,
|
|
103
103
|
label: option.title,
|
package/src/fontsize/utils.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
import { type FontSizeOption } from '../fontconfig';
|
|
5
|
+
import { type FontSizeOption } from '../fontconfig.js';
|
|
6
6
|
/**
|
|
7
7
|
* Normalizes and translates the {@link module:font/fontconfig~FontSizeConfig#options configuration options}
|
|
8
8
|
* to the {@link module:font/fontconfig~FontSizeOption} format.
|
package/src/fontsize/utils.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module font/fontsize/utils
|
|
7
7
|
*/
|
|
8
|
-
import { CKEditorError } from 'ckeditor5/src/utils';
|
|
8
|
+
import { CKEditorError } from 'ckeditor5/src/utils.js';
|
|
9
9
|
/**
|
|
10
10
|
* Normalizes and translates the {@link module:font/fontconfig~FontSizeConfig#options configuration options}
|
|
11
11
|
* to the {@link module:font/fontconfig~FontSizeOption} format.
|
package/src/fontsize.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module font/fontsize
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import FontSizeEditing from './fontsize/fontsizeediting';
|
|
10
|
-
import FontSizeUI from './fontsize/fontsizeui';
|
|
11
|
-
import type { FontSizeOption } from './fontconfig';
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import FontSizeEditing from './fontsize/fontsizeediting.js';
|
|
10
|
+
import FontSizeUI from './fontsize/fontsizeui.js';
|
|
11
|
+
import type { FontSizeOption } from './fontconfig.js';
|
|
12
12
|
/**
|
|
13
13
|
* The font size plugin.
|
|
14
14
|
*
|
package/src/fontsize.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module font/fontsize
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import FontSizeEditing from './fontsize/fontsizeediting';
|
|
10
|
-
import FontSizeUI from './fontsize/fontsizeui';
|
|
11
|
-
import { normalizeOptions } from './fontsize/utils';
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import FontSizeEditing from './fontsize/fontsizeediting.js';
|
|
10
|
+
import FontSizeUI from './fontsize/fontsizeui.js';
|
|
11
|
+
import { normalizeOptions } from './fontsize/utils.js';
|
|
12
12
|
/**
|
|
13
13
|
* The font size plugin.
|
|
14
14
|
*
|
package/src/index.d.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module font
|
|
7
7
|
*/
|
|
8
|
-
export { default as Font } from './font';
|
|
9
|
-
export { default as FontBackgroundColor } from './fontbackgroundcolor';
|
|
10
|
-
export { default as FontColor } from './fontcolor';
|
|
11
|
-
export { default as FontFamily } from './fontfamily';
|
|
12
|
-
export { default as FontSize } from './fontsize';
|
|
13
|
-
export { default as FontBackgroundColorEditing } from './fontbackgroundcolor/fontbackgroundcolorediting';
|
|
14
|
-
export { default as FontBackgroundColorUI } from './fontbackgroundcolor/fontbackgroundcolorui';
|
|
15
|
-
export { default as FontColorEditing } from './fontcolor/fontcolorediting';
|
|
16
|
-
export { default as FontColorUI } from './fontcolor/fontcolorui';
|
|
17
|
-
export { default as FontFamilyEditing } from './fontfamily/fontfamilyediting';
|
|
18
|
-
export { default as FontFamilyUI } from './fontfamily/fontfamilyui';
|
|
19
|
-
export { default as FontSizeEditing } from './fontsize/fontsizeediting';
|
|
20
|
-
export { default as FontSizeUI } from './fontsize/fontsizeui';
|
|
21
|
-
export type { default as FontBackgroundColorCommand } from './fontbackgroundcolor/fontbackgroundcolorcommand';
|
|
22
|
-
export type { default as FontColorCommand } from './fontcolor/fontcolorcommand';
|
|
23
|
-
export type { default as FontFamilyCommand } from './fontfamily/fontfamilycommand';
|
|
24
|
-
export type { default as FontSizeCommand } from './fontsize/fontsizecommand';
|
|
25
|
-
export type { FONT_BACKGROUND_COLOR, FONT_COLOR, FONT_FAMILY, FONT_SIZE } from './utils';
|
|
26
|
-
export type { FontColorConfig, FontFamilyConfig, FontSizeConfig } from './fontconfig';
|
|
27
|
-
import './augmentation';
|
|
8
|
+
export { default as Font } from './font.js';
|
|
9
|
+
export { default as FontBackgroundColor } from './fontbackgroundcolor.js';
|
|
10
|
+
export { default as FontColor } from './fontcolor.js';
|
|
11
|
+
export { default as FontFamily } from './fontfamily.js';
|
|
12
|
+
export { default as FontSize } from './fontsize.js';
|
|
13
|
+
export { default as FontBackgroundColorEditing } from './fontbackgroundcolor/fontbackgroundcolorediting.js';
|
|
14
|
+
export { default as FontBackgroundColorUI } from './fontbackgroundcolor/fontbackgroundcolorui.js';
|
|
15
|
+
export { default as FontColorEditing } from './fontcolor/fontcolorediting.js';
|
|
16
|
+
export { default as FontColorUI } from './fontcolor/fontcolorui.js';
|
|
17
|
+
export { default as FontFamilyEditing } from './fontfamily/fontfamilyediting.js';
|
|
18
|
+
export { default as FontFamilyUI } from './fontfamily/fontfamilyui.js';
|
|
19
|
+
export { default as FontSizeEditing } from './fontsize/fontsizeediting.js';
|
|
20
|
+
export { default as FontSizeUI } from './fontsize/fontsizeui.js';
|
|
21
|
+
export type { default as FontBackgroundColorCommand } from './fontbackgroundcolor/fontbackgroundcolorcommand.js';
|
|
22
|
+
export type { default as FontColorCommand } from './fontcolor/fontcolorcommand.js';
|
|
23
|
+
export type { default as FontFamilyCommand } from './fontfamily/fontfamilycommand.js';
|
|
24
|
+
export type { default as FontSizeCommand } from './fontsize/fontsizecommand.js';
|
|
25
|
+
export type { FONT_BACKGROUND_COLOR, FONT_COLOR, FONT_FAMILY, FONT_SIZE } from './utils.js';
|
|
26
|
+
export type { FontColorConfig, FontFamilyConfig, FontSizeConfig } from './fontconfig.js';
|
|
27
|
+
import './augmentation.js';
|
package/src/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module font
|
|
7
7
|
*/
|
|
8
|
-
export { default as Font } from './font';
|
|
9
|
-
export { default as FontBackgroundColor } from './fontbackgroundcolor';
|
|
10
|
-
export { default as FontColor } from './fontcolor';
|
|
11
|
-
export { default as FontFamily } from './fontfamily';
|
|
12
|
-
export { default as FontSize } from './fontsize';
|
|
13
|
-
export { default as FontBackgroundColorEditing } from './fontbackgroundcolor/fontbackgroundcolorediting';
|
|
14
|
-
export { default as FontBackgroundColorUI } from './fontbackgroundcolor/fontbackgroundcolorui';
|
|
15
|
-
export { default as FontColorEditing } from './fontcolor/fontcolorediting';
|
|
16
|
-
export { default as FontColorUI } from './fontcolor/fontcolorui';
|
|
17
|
-
export { default as FontFamilyEditing } from './fontfamily/fontfamilyediting';
|
|
18
|
-
export { default as FontFamilyUI } from './fontfamily/fontfamilyui';
|
|
19
|
-
export { default as FontSizeEditing } from './fontsize/fontsizeediting';
|
|
20
|
-
export { default as FontSizeUI } from './fontsize/fontsizeui';
|
|
21
|
-
import './augmentation';
|
|
8
|
+
export { default as Font } from './font.js';
|
|
9
|
+
export { default as FontBackgroundColor } from './fontbackgroundcolor.js';
|
|
10
|
+
export { default as FontColor } from './fontcolor.js';
|
|
11
|
+
export { default as FontFamily } from './fontfamily.js';
|
|
12
|
+
export { default as FontSize } from './fontsize.js';
|
|
13
|
+
export { default as FontBackgroundColorEditing } from './fontbackgroundcolor/fontbackgroundcolorediting.js';
|
|
14
|
+
export { default as FontBackgroundColorUI } from './fontbackgroundcolor/fontbackgroundcolorui.js';
|
|
15
|
+
export { default as FontColorEditing } from './fontcolor/fontcolorediting.js';
|
|
16
|
+
export { default as FontColorUI } from './fontcolor/fontcolorui.js';
|
|
17
|
+
export { default as FontFamilyEditing } from './fontfamily/fontfamilyediting.js';
|
|
18
|
+
export { default as FontFamilyUI } from './fontfamily/fontfamilyui.js';
|
|
19
|
+
export { default as FontSizeEditing } from './fontsize/fontsizeediting.js';
|
|
20
|
+
export { default as FontSizeUI } from './fontsize/fontsizeui.js';
|
|
21
|
+
import './augmentation.js';
|
package/src/ui/colorui.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module font/ui/colorui
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin, type Editor } from 'ckeditor5/src/core';
|
|
9
|
-
import { type
|
|
10
|
-
import { type FONT_BACKGROUND_COLOR, type FONT_COLOR } from '../utils';
|
|
8
|
+
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
|
9
|
+
import { type FONT_BACKGROUND_COLOR, type FONT_COLOR } from '../utils.js';
|
|
11
10
|
/**
|
|
12
11
|
* The color UI plugin which isolates the common logic responsible for displaying dropdowns with color grids.
|
|
13
12
|
*
|
|
@@ -36,10 +35,6 @@ export default class ColorUI extends Plugin {
|
|
|
36
35
|
* The number of columns in the color grid.
|
|
37
36
|
*/
|
|
38
37
|
columns: number;
|
|
39
|
-
/**
|
|
40
|
-
* Keeps a reference to {@link module:ui/colorselector/colorselectorview~ColorSelectorView}.
|
|
41
|
-
*/
|
|
42
|
-
colorSelectorView: ColorSelectorView | undefined;
|
|
43
38
|
/**
|
|
44
39
|
* Keeps all changes in color picker in one batch while dropdown is open.
|
|
45
40
|
*/
|
package/src/ui/colorui.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module font/ui/colorui
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import { createDropdown, normalizeColorOptions, getLocalizedColorOptions, focusChildOnDropdownOpen } from 'ckeditor5/src/ui';
|
|
10
|
-
import { addColorSelectorToDropdown } from '../utils';
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import { createDropdown, normalizeColorOptions, getLocalizedColorOptions, focusChildOnDropdownOpen } from 'ckeditor5/src/ui.js';
|
|
10
|
+
import { addColorSelectorToDropdown } from '../utils.js';
|
|
11
11
|
/**
|
|
12
12
|
* The color UI plugin which isolates the common logic responsible for displaying dropdowns with color grids.
|
|
13
13
|
*
|
|
@@ -33,7 +33,6 @@ export default class ColorUI extends Plugin {
|
|
|
33
33
|
this.icon = icon;
|
|
34
34
|
this.dropdownLabel = dropdownLabel;
|
|
35
35
|
this.columns = editor.config.get(`${this.componentName}.columns`);
|
|
36
|
-
this.colorSelectorView = undefined;
|
|
37
36
|
}
|
|
38
37
|
/**
|
|
39
38
|
* @inheritDoc
|
|
@@ -53,7 +52,7 @@ export default class ColorUI extends Plugin {
|
|
|
53
52
|
const dropdownView = createDropdown(locale);
|
|
54
53
|
// Font color dropdown rendering is deferred once it gets open to improve performance (#6192).
|
|
55
54
|
let dropdownContentRendered = false;
|
|
56
|
-
|
|
55
|
+
const colorSelectorView = addColorSelectorToDropdown({
|
|
57
56
|
dropdownView,
|
|
58
57
|
colors: localizedColors.map(option => ({
|
|
59
58
|
label: option.label,
|
|
@@ -69,7 +68,7 @@ export default class ColorUI extends Plugin {
|
|
|
69
68
|
documentColorsCount: documentColorsCount === undefined ? this.columns : documentColorsCount,
|
|
70
69
|
colorPickerViewConfig: hasColorPicker ? (componentConfig.colorPicker || {}) : false
|
|
71
70
|
});
|
|
72
|
-
|
|
71
|
+
colorSelectorView.bind('selectedColor').to(command, 'value');
|
|
73
72
|
dropdownView.buttonView.set({
|
|
74
73
|
label: this.dropdownLabel,
|
|
75
74
|
icon: this.icon,
|
|
@@ -81,7 +80,7 @@ export default class ColorUI extends Plugin {
|
|
|
81
80
|
}
|
|
82
81
|
});
|
|
83
82
|
dropdownView.bind('isEnabled').to(command);
|
|
84
|
-
|
|
83
|
+
colorSelectorView.on('execute', (evt, data) => {
|
|
85
84
|
if (dropdownView.isOpen) {
|
|
86
85
|
editor.execute(this.commandName, {
|
|
87
86
|
value: data.value,
|
|
@@ -95,10 +94,10 @@ export default class ColorUI extends Plugin {
|
|
|
95
94
|
dropdownView.isOpen = false;
|
|
96
95
|
}
|
|
97
96
|
});
|
|
98
|
-
|
|
97
|
+
colorSelectorView.on('colorPicker:show', () => {
|
|
99
98
|
this._undoStepBatch = editor.model.createBatch();
|
|
100
99
|
});
|
|
101
|
-
|
|
100
|
+
colorSelectorView.on('colorPicker:cancel', () => {
|
|
102
101
|
if (this._undoStepBatch.operations.length) {
|
|
103
102
|
// We need to close the dropdown before the undo batch.
|
|
104
103
|
// Otherwise, ColorUI treats undo as a selected color change,
|
|
@@ -116,10 +115,10 @@ export default class ColorUI extends Plugin {
|
|
|
116
115
|
}
|
|
117
116
|
if (isVisible) {
|
|
118
117
|
if (documentColorsCount !== 0) {
|
|
119
|
-
|
|
118
|
+
colorSelectorView.updateDocumentColors(editor.model, this.componentName);
|
|
120
119
|
}
|
|
121
|
-
|
|
122
|
-
|
|
120
|
+
colorSelectorView.updateSelectedColors();
|
|
121
|
+
colorSelectorView.showColorGridsFragment();
|
|
123
122
|
}
|
|
124
123
|
});
|
|
125
124
|
// Accessibility: focus the first active color when opening the dropdown.
|
package/src/utils.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module font/utils
|
|
7
7
|
*/
|
|
8
|
-
import type { FontFamilyOption, FontSizeOption } from './fontconfig';
|
|
9
|
-
import { ColorSelectorView, type ColorDefinition, type ColorPickerViewConfig, type DropdownView } from 'ckeditor5/src/ui';
|
|
10
|
-
import type { ArrayOrItem } from 'ckeditor5/src/utils';
|
|
11
|
-
import type { ViewAttributeElement, ViewElement, MatcherPattern, ViewElementDefinition, DowncastConversionApi } from 'ckeditor5/src/engine';
|
|
8
|
+
import type { FontFamilyOption, FontSizeOption } from './fontconfig.js';
|
|
9
|
+
import { ColorSelectorView, type ColorDefinition, type ColorPickerViewConfig, type DropdownView } from 'ckeditor5/src/ui.js';
|
|
10
|
+
import type { ArrayOrItem } from 'ckeditor5/src/utils.js';
|
|
11
|
+
import type { ViewAttributeElement, ViewElement, MatcherPattern, ViewElementDefinition, DowncastConversionApi } from 'ckeditor5/src/engine.js';
|
|
12
12
|
/**
|
|
13
13
|
* The name of the font size plugin.
|
|
14
14
|
*/
|
package/src/utils.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
import { ColorSelectorView } from 'ckeditor5/src/ui';
|
|
5
|
+
import { ColorSelectorView } from 'ckeditor5/src/ui.js';
|
|
6
6
|
/**
|
|
7
7
|
* The name of the font size plugin.
|
|
8
8
|
*/
|
package/theme/fontsize.css
CHANGED