@ckeditor/ckeditor5-font 48.2.0 → 48.3.0-alpha.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.
@@ -1,64 +1,64 @@
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 font/ui/colorui
7
- */
8
- import { Plugin, type Editor } from '@ckeditor/ckeditor5-core';
9
- import { type FONT_BACKGROUND_COLOR, type FONT_COLOR } from '../utils.js';
6
+ * @module font/ui/colorui
7
+ */
8
+ import { Plugin, type Editor } from "@ckeditor/ckeditor5-core";
9
+ import { type FONT_BACKGROUND_COLOR, type FONT_COLOR } from "../utils.js";
10
10
  /**
11
- * The color UI plugin which isolates the common logic responsible for displaying dropdowns with color grids.
12
- *
13
- * It is used to create the `'fontBackgroundColor'` and `'fontColor'` dropdowns, each hosting
14
- * a {@link module:ui/colorselector/colorselectorview~ColorSelectorView}.
15
- */
11
+ * The color UI plugin which isolates the common logic responsible for displaying dropdowns with color grids.
12
+ *
13
+ * It is used to create the `'fontBackgroundColor'` and `'fontColor'` dropdowns, each hosting
14
+ * a {@link module:ui/colorselector/colorselectorview~ColorSelectorView}.
15
+ */
16
16
  export declare class FontColorUIBase extends Plugin {
17
- /**
18
- * The name of the command which will be executed when a color tile is clicked.
19
- */
20
- commandName: typeof FONT_BACKGROUND_COLOR | typeof FONT_COLOR;
21
- /**
22
- * The name of this component in the {@link module:ui/componentfactory~ComponentFactory}.
23
- * Also the configuration scope name in `editor.config`.
24
- */
25
- componentName: typeof FONT_BACKGROUND_COLOR | typeof FONT_COLOR;
26
- /**
27
- * The SVG icon used by the dropdown.
28
- */
29
- icon: string;
30
- /**
31
- * The label used by the dropdown.
32
- */
33
- dropdownLabel: string;
34
- /**
35
- * The number of columns in the color grid.
36
- */
37
- columns: number;
38
- /**
39
- * Keeps all changes in color picker in one batch while dropdown is open.
40
- */
41
- private _undoStepBatch;
42
- /**
43
- * Creates a plugin which introduces a dropdown with a pre–configured
44
- * {@link module:ui/colorselector/colorselectorview~ColorSelectorView}.
45
- *
46
- * @param editor An editor instance.
47
- * @param config The configuration object.
48
- * @param config.commandName The name of the command which will be executed when a color tile is clicked.
49
- * @param config.componentName The name of the dropdown in the {@link module:ui/componentfactory~ComponentFactory}
50
- * and the configuration scope name in `editor.config`.
51
- * @param config.icon The SVG icon used by the dropdown.
52
- * @param config.dropdownLabel The label used by the dropdown.
53
- */
54
- constructor(editor: Editor, { commandName, componentName, icon, dropdownLabel }: {
55
- commandName: typeof FONT_BACKGROUND_COLOR | typeof FONT_COLOR;
56
- componentName: typeof FONT_BACKGROUND_COLOR | typeof FONT_COLOR;
57
- icon: string;
58
- dropdownLabel: string;
59
- });
60
- /**
61
- * @inheritDoc
62
- */
63
- init(): void;
17
+ /**
18
+ * The name of the command which will be executed when a color tile is clicked.
19
+ */
20
+ commandName: typeof FONT_BACKGROUND_COLOR | typeof FONT_COLOR;
21
+ /**
22
+ * The name of this component in the {@link module:ui/componentfactory~ComponentFactory}.
23
+ * Also the configuration scope name in `editor.config`.
24
+ */
25
+ componentName: typeof FONT_BACKGROUND_COLOR | typeof FONT_COLOR;
26
+ /**
27
+ * The SVG icon used by the dropdown.
28
+ */
29
+ icon: string;
30
+ /**
31
+ * The label used by the dropdown.
32
+ */
33
+ dropdownLabel: string;
34
+ /**
35
+ * The number of columns in the color grid.
36
+ */
37
+ columns: number;
38
+ /**
39
+ * Keeps all changes in color picker in one batch while dropdown is open.
40
+ */
41
+ private _undoStepBatch;
42
+ /**
43
+ * Creates a plugin which introduces a dropdown with a pre–configured
44
+ * {@link module:ui/colorselector/colorselectorview~ColorSelectorView}.
45
+ *
46
+ * @param editor An editor instance.
47
+ * @param config The configuration object.
48
+ * @param config.commandName The name of the command which will be executed when a color tile is clicked.
49
+ * @param config.componentName The name of the dropdown in the {@link module:ui/componentfactory~ComponentFactory}
50
+ * and the configuration scope name in `editor.config`.
51
+ * @param config.icon The SVG icon used by the dropdown.
52
+ * @param config.dropdownLabel The label used by the dropdown.
53
+ */
54
+ constructor(editor: Editor, { commandName, componentName, icon, dropdownLabel }: {
55
+ commandName: typeof FONT_BACKGROUND_COLOR | typeof FONT_COLOR;
56
+ componentName: typeof FONT_BACKGROUND_COLOR | typeof FONT_COLOR;
57
+ icon: string;
58
+ dropdownLabel: string;
59
+ });
60
+ /**
61
+ * @inheritDoc
62
+ */
63
+ init(): void;
64
64
  }
package/dist/utils.d.ts CHANGED
@@ -1,93 +1,93 @@
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 font/utils
7
- */
8
- import type { FontFamilyOption, FontSizeOption } from './fontconfig.js';
9
- import { ColorSelectorView, type ColorDefinition, type ColorPickerViewConfig, type DropdownView } from '@ckeditor/ckeditor5-ui';
10
- import type { ArrayOrItem } from '@ckeditor/ckeditor5-utils';
11
- import type { ViewAttributeElement, ViewElement, MatcherPattern, ViewElementDefinition, DowncastConversionApi } from '@ckeditor/ckeditor5-engine';
6
+ * @module font/utils
7
+ */
8
+ import type { FontFamilyOption, FontSizeOption } from "./fontconfig.js";
9
+ import { ColorSelectorView, type ColorDefinition, type ColorPickerViewConfig, type DropdownView } from "@ckeditor/ckeditor5-ui";
10
+ import type { ArrayOrItem } from "@ckeditor/ckeditor5-utils";
11
+ import type { ViewAttributeElement, ViewElement, MatcherPattern, ViewElementDefinition, DowncastConversionApi } from "@ckeditor/ckeditor5-engine";
12
12
  /**
13
- * The name of the font size plugin.
14
- */
13
+ * The name of the font size plugin.
14
+ */
15
15
  export declare const FONT_SIZE = "fontSize";
16
16
  /**
17
- * The name of the font family plugin.
18
- */
17
+ * The name of the font family plugin.
18
+ */
19
19
  export declare const FONT_FAMILY = "fontFamily";
20
20
  /**
21
- * The name of the font color plugin.
22
- */
21
+ * The name of the font color plugin.
22
+ */
23
23
  export declare const FONT_COLOR = "fontColor";
24
24
  /**
25
- * The name of the font background color plugin.
26
- */
25
+ * The name of the font background color plugin.
26
+ */
27
27
  export declare const FONT_BACKGROUND_COLOR = "fontBackgroundColor";
28
28
  /**
29
- * Builds a proper converter definition out of input data.
30
- *
31
- * @internal
32
- */
29
+ * Builds a proper converter definition out of input data.
30
+ *
31
+ * @internal
32
+ */
33
33
  export declare function buildDefinition(modelAttributeKey: string, options: Array<FontFamilyOption> | Array<FontSizeOption>): FontConverterDefinition;
34
34
  /**
35
- * @internal
36
- */
35
+ * @internal
36
+ */
37
37
  export type FontConverterDefinition = {
38
- model: {
39
- key: string;
40
- values: Array<string>;
41
- };
42
- view: Record<string, ViewElementDefinition>;
43
- upcastAlso: Record<string, ArrayOrItem<MatcherPattern>>;
38
+ model: {
39
+ key: string;
40
+ values: Array<string>;
41
+ };
42
+ view: Record<string, ViewElementDefinition>;
43
+ upcastAlso: Record<string, ArrayOrItem<MatcherPattern>>;
44
44
  };
45
45
  /**
46
- * A {@link module:font/fontcolor~FontColor font color} and
47
- * {@link module:font/fontbackgroundcolor~FontBackgroundColor font background color} helper
48
- * responsible for upcasting data to the model.
49
- *
50
- * **Note**: The `styleAttr` parameter should be either `'color'` or `'background-color'`.
51
- *
52
- * @internal
53
- */
46
+ * A {@link module:font/fontcolor~FontColor font color} and
47
+ * {@link module:font/fontbackgroundcolor~FontBackgroundColor font background color} helper
48
+ * responsible for upcasting data to the model.
49
+ *
50
+ * **Note**: The `styleAttr` parameter should be either `'color'` or `'background-color'`.
51
+ *
52
+ * @internal
53
+ */
54
54
  export declare function renderUpcastAttribute(styleAttr: string): (viewElement: ViewElement) => string;
55
55
  /**
56
- * A {@link module:font/fontcolor~FontColor font color} and
57
- * {@link module:font/fontbackgroundcolor~FontBackgroundColor font background color} helper
58
- * responsible for downcasting a color attribute to a `<span>` element.
59
- *
60
- * **Note**: The `styleAttr` parameter should be either `'color'` or `'background-color'`.
61
- *
62
- * @internal
63
- */
56
+ * A {@link module:font/fontcolor~FontColor font color} and
57
+ * {@link module:font/fontbackgroundcolor~FontBackgroundColor font background color} helper
58
+ * responsible for downcasting a color attribute to a `<span>` element.
59
+ *
60
+ * **Note**: The `styleAttr` parameter should be either `'color'` or `'background-color'`.
61
+ *
62
+ * @internal
63
+ */
64
64
  export declare function renderDowncastElement(styleAttr: string): (modelAttributeValue: string, { writer }: DowncastConversionApi) => ViewAttributeElement;
65
65
  /**
66
- * A helper that adds {@link module:ui/colorselector/colorselectorview~ColorSelectorView} to the color dropdown with proper initial values.
67
- *
68
- * @param options Configuration options
69
- * @param options.dropdownView The dropdown view to which a {@link module:ui/colorselector/colorselectorview~ColorSelectorView}
70
- * will be added.
71
- * @param options.colors An array with definitions representing colors to be displayed in the color selector.
72
- * @param options.columns The number of columns in the color grid.
73
- * @param options.removeButtonLabel The label for the button responsible for removing the color.
74
- * @param options.colorPickerLabel The label for the color picker button.
75
- * @param options.documentColorsLabel The label for the section with document colors.
76
- * @param options.documentColorsCount The number of document colors inside the dropdown.
77
- * @param options.colorPickerViewConfig Configuration of the color picker view.
78
- * @returns The new color selector view.
79
- * @internal
80
- */
66
+ * A helper that adds {@link module:ui/colorselector/colorselectorview~ColorSelectorView} to the color dropdown with proper initial values.
67
+ *
68
+ * @param options Configuration options
69
+ * @param options.dropdownView The dropdown view to which a {@link module:ui/colorselector/colorselectorview~ColorSelectorView}
70
+ * will be added.
71
+ * @param options.colors An array with definitions representing colors to be displayed in the color selector.
72
+ * @param options.columns The number of columns in the color grid.
73
+ * @param options.removeButtonLabel The label for the button responsible for removing the color.
74
+ * @param options.colorPickerLabel The label for the color picker button.
75
+ * @param options.documentColorsLabel The label for the section with document colors.
76
+ * @param options.documentColorsCount The number of document colors inside the dropdown.
77
+ * @param options.colorPickerViewConfig Configuration of the color picker view.
78
+ * @returns The new color selector view.
79
+ * @internal
80
+ */
81
81
  export declare function addColorSelectorToDropdown({ dropdownView, colors, columns, removeButtonLabel, colorPickerLabel, documentColorsLabel, documentColorsCount, colorPickerViewConfig }: {
82
- dropdownView: FontColorSelectorDropdownView;
83
- colors: Array<ColorDefinition>;
84
- columns: number;
85
- removeButtonLabel: string;
86
- colorPickerLabel: string;
87
- documentColorsLabel?: string;
88
- documentColorsCount?: number;
89
- colorPickerViewConfig: ColorPickerViewConfig | false;
82
+ dropdownView: FontColorSelectorDropdownView;
83
+ colors: Array<ColorDefinition>;
84
+ columns: number;
85
+ removeButtonLabel: string;
86
+ colorPickerLabel: string;
87
+ documentColorsLabel?: string;
88
+ documentColorsCount?: number;
89
+ colorPickerViewConfig: ColorPickerViewConfig | false;
90
90
  }): ColorSelectorView;
91
91
  export type FontColorSelectorDropdownView = DropdownView & {
92
- colorSelectorView?: ColorSelectorView;
92
+ colorSelectorView?: ColorSelectorView;
93
93
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-font",
3
- "version": "48.2.0",
3
+ "version": "48.3.0-alpha.1",
4
4
  "description": "Font feature for CKEditor 5.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "CKSource (http://cksource.com/)",
@@ -26,11 +26,11 @@
26
26
  "./package.json": "./package.json"
27
27
  },
28
28
  "dependencies": {
29
- "@ckeditor/ckeditor5-core": "48.2.0",
30
- "@ckeditor/ckeditor5-engine": "48.2.0",
31
- "@ckeditor/ckeditor5-icons": "48.2.0",
32
- "@ckeditor/ckeditor5-ui": "48.2.0",
33
- "@ckeditor/ckeditor5-utils": "48.2.0"
29
+ "@ckeditor/ckeditor5-core": "48.3.0-alpha.1",
30
+ "@ckeditor/ckeditor5-engine": "48.3.0-alpha.1",
31
+ "@ckeditor/ckeditor5-icons": "48.3.0-alpha.1",
32
+ "@ckeditor/ckeditor5-ui": "48.3.0-alpha.1",
33
+ "@ckeditor/ckeditor5-utils": "48.3.0-alpha.1"
34
34
  },
35
35
  "files": [
36
36
  "dist",