@ckeditor/ckeditor5-font 41.2.0 → 41.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.
Files changed (32) hide show
  1. package/dist/content-index.css +16 -0
  2. package/dist/editor-index.css +4 -0
  3. package/dist/index.css +27 -0
  4. package/dist/index.css.map +1 -0
  5. package/dist/index.js +1640 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/types/augmentation.d.ts +58 -0
  8. package/dist/types/font.d.ts +33 -0
  9. package/dist/types/fontbackgroundcolor/fontbackgroundcolorcommand.d.ts +26 -0
  10. package/dist/types/fontbackgroundcolor/fontbackgroundcolorediting.d.ts +26 -0
  11. package/dist/types/fontbackgroundcolor/fontbackgroundcolorui.d.ts +22 -0
  12. package/dist/types/fontbackgroundcolor.d.ts +30 -0
  13. package/dist/types/fontcolor/fontcolorcommand.d.ts +25 -0
  14. package/dist/types/fontcolor/fontcolorediting.d.ts +26 -0
  15. package/dist/types/fontcolor/fontcolorui.d.ts +22 -0
  16. package/dist/types/fontcolor.d.ts +29 -0
  17. package/dist/types/fontcommand.d.ts +48 -0
  18. package/dist/types/fontconfig.d.ts +373 -0
  19. package/dist/types/fontfamily/fontfamilycommand.d.ts +25 -0
  20. package/dist/types/fontfamily/fontfamilyediting.d.ts +39 -0
  21. package/dist/types/fontfamily/fontfamilyui.d.ts +30 -0
  22. package/dist/types/fontfamily/utils.d.ts +15 -0
  23. package/dist/types/fontfamily.d.ts +29 -0
  24. package/dist/types/fontsize/fontsizecommand.d.ts +25 -0
  25. package/dist/types/fontsize/fontsizeediting.d.ts +44 -0
  26. package/dist/types/fontsize/fontsizeui.d.ts +31 -0
  27. package/dist/types/fontsize/utils.d.ts +12 -0
  28. package/dist/types/fontsize.d.ts +37 -0
  29. package/dist/types/index.d.ts +27 -0
  30. package/dist/types/ui/colorui.d.ts +63 -0
  31. package/dist/types/utils.d.ts +80 -0
  32. package/package.json +3 -2
@@ -0,0 +1,373 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, 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 font/fontconfig
7
+ */
8
+ import type { ColorOption, ColorPickerConfig } from 'ckeditor5/src/ui.js';
9
+ import type { MatcherPattern, ViewElementDefinition } from 'ckeditor5/src/engine.js';
10
+ /**
11
+ * The configuration of the font color and font background color features.
12
+ * This option is used by the {@link module:font/fontcolor/fontcolorediting~FontColorEditing} and
13
+ * {@link module:font/fontbackgroundcolor/fontbackgroundcolorediting~FontBackgroundColorEditing} features.
14
+ *
15
+ * ```ts
16
+ * ClassicEditor
17
+ * .create( {
18
+ * fontColor: ... // Font color feature configuration.
19
+ * fontBackgroundColor: ... // Font background color feature configuration.
20
+ * } )
21
+ * .then( ... )
22
+ * .catch( ... );
23
+ * ```
24
+ *
25
+ * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
26
+ */
27
+ export interface FontColorConfig {
28
+ /**
29
+ * Available font colors defined as an array of strings or objects.
30
+ *
31
+ * The default value registers the following colors:
32
+ *
33
+ * ```ts
34
+ * const fontColorConfig = {
35
+ * colors: [
36
+ * {
37
+ * color: 'hsl(0, 0%, 0%)',
38
+ * label: 'Black'
39
+ * },
40
+ * {
41
+ * color: 'hsl(0, 0%, 30%)',
42
+ * label: 'Dim grey'
43
+ * },
44
+ * {
45
+ * color: 'hsl(0, 0%, 60%)',
46
+ * label: 'Grey'
47
+ * },
48
+ * {
49
+ * color: 'hsl(0, 0%, 90%)',
50
+ * label: 'Light grey'
51
+ * },
52
+ * {
53
+ * color: 'hsl(0, 0%, 100%)',
54
+ * label: 'White',
55
+ * hasBorder: true
56
+ * },
57
+ * {
58
+ * color: 'hsl(0, 75%, 60%)',
59
+ * label: 'Red'
60
+ * },
61
+ * {
62
+ * color: 'hsl(30, 75%, 60%)',
63
+ * label: 'Orange'
64
+ * },
65
+ * {
66
+ * color: 'hsl(60, 75%, 60%)',
67
+ * label: 'Yellow'
68
+ * },
69
+ * {
70
+ * color: 'hsl(90, 75%, 60%)',
71
+ * label: 'Light green'
72
+ * },
73
+ * {
74
+ * color: 'hsl(120, 75%, 60%)',
75
+ * label: 'Green'
76
+ * },
77
+ * {
78
+ * color: 'hsl(150, 75%, 60%)',
79
+ * label: 'Aquamarine'
80
+ * },
81
+ * {
82
+ * color: 'hsl(180, 75%, 60%)',
83
+ * label: 'Turquoise'
84
+ * },
85
+ * {
86
+ * color: 'hsl(210, 75%, 60%)',
87
+ * label: 'Light blue'
88
+ * },
89
+ * {
90
+ * color: 'hsl(240, 75%, 60%)',
91
+ * label: 'Blue'
92
+ * },
93
+ * {
94
+ * color: 'hsl(270, 75%, 60%)',
95
+ * label: 'Purple'
96
+ * }
97
+ * ]
98
+ * };
99
+ * ```
100
+ *
101
+ * **Note**: The colors are displayed in the `'fontColor'` dropdown.
102
+ */
103
+ colors?: Array<string | ColorOption>;
104
+ /**
105
+ * Determines the maximum number of available document colors.
106
+ * Setting it to `0` will disable the document colors feature.
107
+ *
108
+ * By default it equals to the {@link module:font/fontconfig~FontColorConfig#columns} value.
109
+ *
110
+ * Examples:
111
+ *
112
+ * ```ts
113
+ * // 1) Neither document colors nor columns are defined in the configuration.
114
+ * // Document colors will equal 5,
115
+ * // because the value will be inherited from columns,
116
+ * // which has a predefined value of 5.
117
+ * const fontColorConfig = {}
118
+ *
119
+ * // 2) Document colors will equal 8, because the value will be inherited from columns.
120
+ * const fontColorConfig = {
121
+ * columns: 8
122
+ * }
123
+ *
124
+ * // 3) Document colors will equal 24, because it has its own value defined.
125
+ * const fontColorConfig = {
126
+ * columns: 8,
127
+ * documentColors: 24
128
+ * }
129
+ *
130
+ * // 4) The document colors feature will be disabled.
131
+ * const fontColorConfig = {
132
+ * columns: 8,
133
+ * documentColors: 0
134
+ * }
135
+ * ```
136
+ */
137
+ documentColors?: number;
138
+ /**
139
+ * Represents the number of columns in the font color dropdown.
140
+ *
141
+ * The default value is:
142
+ *
143
+ * ```ts
144
+ * const fontColorConfig = {
145
+ * columns: 5
146
+ * }
147
+ * ```
148
+ */
149
+ columns?: number;
150
+ /**
151
+ * Configuration of the color picker feature.
152
+ *
153
+ * If set to `false` the picker will not appear.
154
+ */
155
+ colorPicker?: false | ColorPickerConfig;
156
+ }
157
+ /**
158
+ * The configuration of the font family feature.
159
+ * This option is used by the {@link module:font/fontfamily/fontfamilyediting~FontFamilyEditing} feature.
160
+ *
161
+ * ```ts
162
+ * ClassicEditor
163
+ * .create( {
164
+ * fontFamily: ... // Font family feature configuration.
165
+ * } )
166
+ * .then( ... )
167
+ * .catch( ... );
168
+ * ```
169
+ *
170
+ * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
171
+ */
172
+ export interface FontFamilyConfig {
173
+ /**
174
+ * Available font family options defined as an array of strings. The default value is:
175
+ *
176
+ * ```ts
177
+ * const fontFamilyConfig = {
178
+ * options: [
179
+ * 'default',
180
+ * 'Arial, Helvetica, sans-serif',
181
+ * 'Courier New, Courier, monospace',
182
+ * 'Georgia, serif',
183
+ * 'Lucida Sans Unicode, Lucida Grande, sans-serif',
184
+ * 'Tahoma, Geneva, sans-serif',
185
+ * 'Times New Roman, Times, serif',
186
+ * 'Trebuchet MS, Helvetica, sans-serif',
187
+ * 'Verdana, Geneva, sans-serif'
188
+ * ]
189
+ * };
190
+ * ```
191
+ *
192
+ * which configures 8 font family options. Each option consists of one or more comma–separated font family names. The first font name is
193
+ * used as the dropdown item description in the UI.
194
+ *
195
+ * **Note:** The family names that consist of spaces should not have quotes (as opposed to the CSS standard). The necessary quotes
196
+ * will be added automatically in the view. For example, the `"Lucida Sans Unicode"` will render as follows:
197
+ *
198
+ * ```html
199
+ * <span style="font-family:'Lucida Sans Unicode', 'Lucida Grande', sans-serif">...</span>
200
+ * ```
201
+ *
202
+ * The "default" option removes the `fontFamily` attribute from the selection. In such case, the text will
203
+ * be rendered in the view using the default font family defined in the styles of the web page.
204
+ *
205
+ * Font family can be applied using the command API. To do that, use the `fontFamily` command and pass the desired family as a `value`.
206
+ * For example, the following code will apply the `fontFamily` attribute with the `'Arial'` `value` to the current selection:
207
+ *
208
+ * ```ts
209
+ * editor.execute( 'fontFamily', { value: 'Arial' } );
210
+ * ```
211
+ *
212
+ * Executing the `'fontFamily'` command without any value will remove the `fontFamily` attribute from the current selection.
213
+ */
214
+ options?: Array<string | FontFamilyOption>;
215
+ /**
216
+ * By default the plugin removes any `font-family` value that does not match the plugin's configuration.
217
+ * It means that if you paste content with font families that the editor does not understand, the `font-family` attribute
218
+ * will be removed and the content will be displayed with the default font.
219
+ *
220
+ * You can preserve pasted font family values by switching the `supportAllValues` option to `true`:
221
+ *
222
+ * ```ts
223
+ * const fontFamilyConfig = {
224
+ * supportAllValues: true
225
+ * };
226
+ * ```
227
+ *
228
+ * With this configuration font families not specified in the editor configuration will not be removed when pasting the content.
229
+ */
230
+ supportAllValues?: boolean;
231
+ }
232
+ /**
233
+ * The font family option descriptor.
234
+ */
235
+ export interface FontFamilyOption {
236
+ /**
237
+ * The user-readable title of the option.
238
+ */
239
+ title: string;
240
+ /**
241
+ * The attribute's unique value in the model.
242
+ */
243
+ model?: string;
244
+ /**
245
+ * View element configuration.
246
+ */
247
+ view?: ViewElementDefinition;
248
+ /**
249
+ * An array with all matched elements that the view-to-model conversion should also accept.
250
+ */
251
+ upcastAlso?: Array<MatcherPattern>;
252
+ }
253
+ /**
254
+ * The configuration of the font size feature.
255
+ * This option is used by the {@link module:font/fontsize/fontsizeediting~FontSizeEditing} feature.
256
+ *
257
+ * ```ts
258
+ * ClassicEditor
259
+ * .create( {
260
+ * fontSize: ... // Font size feature configuration.
261
+ * } )
262
+ * .then( ... )
263
+ * .catch( ... );
264
+ * ```
265
+ *
266
+ * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
267
+ */
268
+ export interface FontSizeConfig {
269
+ /**
270
+ * Available font size options. Expressed as predefined presets, numerical "pixel" values
271
+ * or the {@link module:font/fontconfig~FontSizeOption}.
272
+ *
273
+ * The default value is:
274
+ *
275
+ * ```ts
276
+ * const fontSizeConfig = {
277
+ * options: [
278
+ * 'tiny',
279
+ * 'small',
280
+ * 'default',
281
+ * 'big',
282
+ * 'huge'
283
+ * ]
284
+ * };
285
+ * ```
286
+ *
287
+ * It defines 4 sizes: **tiny**, **small**, **big**, and **huge**. These values will be rendered as `<span>` elements in the view.
288
+ * The **default** defines a text without the `fontSize` attribute.
289
+ *
290
+ * Each `<span>` has the the `class` attribute set to the corresponding size name. For instance, this is what the **small** size looks
291
+ * like in the view:
292
+ *
293
+ * ```html
294
+ * <span class="text-small">...</span>
295
+ * ```
296
+ *
297
+ * As an alternative, the font size might be defined using numerical values (either as a `Number` or as a `String`):
298
+ *
299
+ * ```ts
300
+ * const fontSizeConfig = {
301
+ * options: [ 9, 10, 11, 12, 13, 14, 15 ]
302
+ * };
303
+ * ```
304
+ *
305
+ * Also, you can define a label in the dropdown for numerical values:
306
+ *
307
+ * ```ts
308
+ * const fontSizeConfig = {
309
+ * options: [
310
+ * {
311
+ * title: 'Small',
312
+ * model: '8px'
313
+ * },
314
+ * 'default',
315
+ * {
316
+ * title: 'Big',
317
+ * model: '14px'
318
+ * }
319
+ * ]
320
+ * };
321
+ * ```
322
+ *
323
+ * Font size can be applied using the command API. To do that, use the `'fontSize'` command and pass the desired font size as a `value`.
324
+ * For example, the following code will apply the `fontSize` attribute with the **tiny** value to the current selection:
325
+ *
326
+ * ```ts
327
+ * editor.execute( 'fontSize', { value: 'tiny' } );
328
+ * ```
329
+ *
330
+ * Executing the `fontSize` command without value will remove the `fontSize` attribute from the current selection.
331
+ */
332
+ options?: Array<string | number | FontSizeOption>;
333
+ /**
334
+ * By default the plugin removes any `font-size` value that does not match the plugin's configuration.
335
+ * It means that if you paste content with font sizes that the editor does not understand, the `font-size` attribute
336
+ * will be removed and the content will be displayed with the default size.
337
+ *
338
+ * You can preserve pasted font size values by switching the `supportAllValues` option to `true`:
339
+ *
340
+ * ```ts
341
+ * const fontSizeConfig = {
342
+ * options: [ 9, 10, 11, 12, 'default', 14, 15 ],
343
+ * supportAllValues: true
344
+ * };
345
+ * ```
346
+ *
347
+ * **Note:** This option can only be used with numerical values as font size options.
348
+ *
349
+ * With this configuration font sizes not specified in the editor configuration will not be removed when pasting the content.
350
+ */
351
+ supportAllValues?: boolean;
352
+ }
353
+ /**
354
+ * The font size option descriptor.
355
+ */
356
+ export interface FontSizeOption {
357
+ /**
358
+ * The user-readable title of the option.
359
+ */
360
+ title: string;
361
+ /**
362
+ * The attribute's unique value in the model.
363
+ */
364
+ model?: string;
365
+ /**
366
+ * View element configuration.
367
+ */
368
+ view?: ViewElementDefinition;
369
+ /**
370
+ * An array with all matched elements that the view-to-model conversion should also accept.
371
+ */
372
+ upcastAlso?: Array<MatcherPattern>;
373
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, 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 font/fontfamily/fontfamilycommand
7
+ */
8
+ import type { Editor } from 'ckeditor5/src/core.js';
9
+ import FontCommand from '../fontcommand.js';
10
+ /**
11
+ * The font family command. It is used by {@link module:font/fontfamily/fontfamilyediting~FontFamilyEditing}
12
+ * to apply the font family.
13
+ *
14
+ * ```ts
15
+ * editor.execute( 'fontFamily', { value: 'Arial' } );
16
+ * ```
17
+ *
18
+ * **Note**: Executing the command without the value removes the attribute from the model.
19
+ */
20
+ export default class FontFamilyCommand extends FontCommand {
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ constructor(editor: Editor);
25
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, 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 font/fontfamily/fontfamilyediting
7
+ */
8
+ import { type Editor, Plugin } from 'ckeditor5/src/core.js';
9
+ /**
10
+ * The font family editing feature.
11
+ *
12
+ * It introduces the {@link module:font/fontfamily/fontfamilycommand~FontFamilyCommand command} and
13
+ * the `fontFamily` attribute in the {@link module:engine/model/model~Model model} which renders
14
+ * in the {@link module:engine/view/view view} as an inline `<span>` element (`<span style="font-family: Arial">`),
15
+ * depending on the {@link module:font/fontconfig~FontFamilyConfig configuration}.
16
+ */
17
+ export default class FontFamilyEditing extends Plugin {
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ static get pluginName(): "FontFamilyEditing";
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ constructor(editor: Editor);
26
+ /**
27
+ * @inheritDoc
28
+ */
29
+ init(): void;
30
+ /**
31
+ * These converters enable keeping any value found as `style="font-family: *"` as a value of an attribute on a text even
32
+ * if it is not defined in the plugin configuration.
33
+ */
34
+ private _prepareAnyValueConverters;
35
+ /**
36
+ * Adds support for legacy `<font face="..">` formatting.
37
+ */
38
+ private _prepareCompatibilityConverter;
39
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, 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 font/fontfamily/fontfamilyui
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ /**
10
+ * The font family UI plugin. It introduces the `'fontFamily'` dropdown.
11
+ */
12
+ export default class FontFamilyUI extends Plugin {
13
+ /**
14
+ * @inheritDoc
15
+ */
16
+ static get pluginName(): "FontFamilyUI";
17
+ /**
18
+ * @inheritDoc
19
+ */
20
+ init(): void;
21
+ /**
22
+ * Returns options as defined in `config.fontFamily.options` but processed to account for
23
+ * editor localization, i.e. to display {@link module:font/fontconfig~FontFamilyOption}
24
+ * in the correct language.
25
+ *
26
+ * Note: The reason behind this method is that there is no way to use {@link module:utils/locale~Locale#t}
27
+ * when the user configuration is defined because the editor does not exist yet.
28
+ */
29
+ private _getLocalizedOptions;
30
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, 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 { FontFamilyOption } from '../fontconfig.js';
6
+ /**
7
+ * @module font/fontfamily/utils
8
+ */
9
+ /**
10
+ * Normalizes the {@link module:font/fontconfig~FontFamilyConfig#options configuration options}
11
+ * to the {@link module:font/fontconfig~FontFamilyOption} format.
12
+ *
13
+ * @param configuredOptions An array of options taken from the configuration.
14
+ */
15
+ export declare function normalizeOptions(configuredOptions: Array<string | FontFamilyOption>): Array<FontFamilyOption>;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, 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 font/fontfamily
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ import FontFamilyEditing from './fontfamily/fontfamilyediting.js';
10
+ import FontFamilyUI from './fontfamily/fontfamilyui.js';
11
+ /**
12
+ * The font family plugin.
13
+ *
14
+ * For a detailed overview, check the {@glink features/font font feature} documentatiom
15
+ * and the {@glink api/font package page}.
16
+ *
17
+ * This is a "glue" plugin which loads the {@link module:font/fontfamily/fontfamilyediting~FontFamilyEditing} and
18
+ * {@link module:font/fontfamily/fontfamilyui~FontFamilyUI} features in the editor.
19
+ */
20
+ export default class FontFamily extends Plugin {
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ static get requires(): readonly [typeof FontFamilyEditing, typeof FontFamilyUI];
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ static get pluginName(): "FontFamily";
29
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, 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 font/fontsize/fontsizecommand
7
+ */
8
+ import type { Editor } from 'ckeditor5/src/core.js';
9
+ import FontCommand from '../fontcommand.js';
10
+ /**
11
+ * The font size command. It is used by {@link module:font/fontsize/fontsizeediting~FontSizeEditing}
12
+ * to apply the font size.
13
+ *
14
+ * ```ts
15
+ * editor.execute( 'fontSize', { value: 'small' } );
16
+ * ```
17
+ *
18
+ * **Note**: Executing the command without the value removes the attribute from the model.
19
+ */
20
+ export default class FontSizeCommand extends FontCommand {
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ constructor(editor: Editor);
25
+ }
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, 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 font/fontsize/fontsizeediting
7
+ */
8
+ import { Plugin, type Editor } from 'ckeditor5/src/core.js';
9
+ /**
10
+ * The font size editing feature.
11
+ *
12
+ * It introduces the {@link module:font/fontsize/fontsizecommand~FontSizeCommand command} and the `fontSize`
13
+ * attribute in the {@link module:engine/model/model~Model model} which renders in the {@link module:engine/view/view view}
14
+ * as a `<span>` element with either:
15
+ * * a style attribute (`<span style="font-size:12px">...</span>`),
16
+ * * or a class attribute (`<span class="text-small">...</span>`)
17
+ *
18
+ * depending on the {@link module:font/fontconfig~FontSizeConfig configuration}.
19
+ */
20
+ export default class FontSizeEditing extends Plugin {
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ static get pluginName(): "FontSizeEditing";
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ constructor(editor: Editor);
29
+ /**
30
+ * @inheritDoc
31
+ */
32
+ init(): void;
33
+ /**
34
+ * These converters enable keeping any value found as `style="font-size: *"` as a value of an attribute on a text even
35
+ * if it is not defined in the plugin configuration.
36
+ *
37
+ * @param definition Converter definition out of input data.
38
+ */
39
+ private _prepareAnyValueConverters;
40
+ /**
41
+ * Adds support for legacy `<font size="..">` formatting.
42
+ */
43
+ private _prepareCompatibilityConverter;
44
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, 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 font/fontsize/fontsizeui
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ import '../../theme/fontsize.css';
10
+ /**
11
+ * The font size UI plugin. It introduces the `'fontSize'` dropdown.
12
+ */
13
+ export default class FontSizeUI extends Plugin {
14
+ /**
15
+ * @inheritDoc
16
+ */
17
+ static get pluginName(): "FontSizeUI";
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ init(): void;
22
+ /**
23
+ * Returns options as defined in `config.fontSize.options` but processed to account for
24
+ * editor localization, i.e. to display {@link module:font/fontconfig~FontSizeOption}
25
+ * in the correct language.
26
+ *
27
+ * Note: The reason behind this method is that there is no way to use {@link module:utils/locale~Locale#t}
28
+ * when the user configuration is defined because the editor does not exist yet.
29
+ */
30
+ private _getLocalizedOptions;
31
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, 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 FontSizeOption } from '../fontconfig.js';
6
+ /**
7
+ * Normalizes and translates the {@link module:font/fontconfig~FontSizeConfig#options configuration options}
8
+ * to the {@link module:font/fontconfig~FontSizeOption} format.
9
+ *
10
+ * @param configuredOptions An array of options taken from the configuration.
11
+ */
12
+ export declare function normalizeOptions(configuredOptions: Array<string | number | FontSizeOption>): Array<FontSizeOption>;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, 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 font/fontsize
7
+ */
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
+ /**
13
+ * The font size plugin.
14
+ *
15
+ * For a detailed overview, check the {@glink features/font font feature} documentation
16
+ * and the {@glink api/font package page}.
17
+ *
18
+ * This is a "glue" plugin which loads the {@link module:font/fontsize/fontsizeediting~FontSizeEditing} and
19
+ * {@link module:font/fontsize/fontsizeui~FontSizeUI} features in the editor.
20
+ */
21
+ export default class FontSize extends Plugin {
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ static get requires(): readonly [typeof FontSizeEditing, typeof FontSizeUI];
26
+ /**
27
+ * @inheritDoc
28
+ */
29
+ static get pluginName(): "FontSize";
30
+ /**
31
+ * Normalizes and translates the {@link module:font/fontconfig~FontSizeConfig#options configuration options}
32
+ * to the {@link module:font/fontconfig~FontSizeOption} format.
33
+ *
34
+ * @param configuredOptions An array of options taken from the configuration.
35
+ */
36
+ normalizeSizeOptions(options: Array<string | number | FontSizeOption>): Array<FontSizeOption>;
37
+ }