@ckeditor/ckeditor5-font 41.1.0 → 41.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.
Files changed (36) hide show
  1. package/build/font.js +1 -1
  2. package/build/translations/pt.js +1 -1
  3. package/dist/content-index.css +16 -0
  4. package/dist/editor-index.css +4 -0
  5. package/dist/index.css +27 -0
  6. package/dist/index.css.map +1 -0
  7. package/dist/index.js +1640 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/types/augmentation.d.ts +58 -0
  10. package/dist/types/font.d.ts +33 -0
  11. package/dist/types/fontbackgroundcolor/fontbackgroundcolorcommand.d.ts +26 -0
  12. package/dist/types/fontbackgroundcolor/fontbackgroundcolorediting.d.ts +26 -0
  13. package/dist/types/fontbackgroundcolor/fontbackgroundcolorui.d.ts +22 -0
  14. package/dist/types/fontbackgroundcolor.d.ts +30 -0
  15. package/dist/types/fontcolor/fontcolorcommand.d.ts +25 -0
  16. package/dist/types/fontcolor/fontcolorediting.d.ts +26 -0
  17. package/dist/types/fontcolor/fontcolorui.d.ts +22 -0
  18. package/dist/types/fontcolor.d.ts +29 -0
  19. package/dist/types/fontcommand.d.ts +48 -0
  20. package/dist/types/fontconfig.d.ts +373 -0
  21. package/dist/types/fontfamily/fontfamilycommand.d.ts +25 -0
  22. package/dist/types/fontfamily/fontfamilyediting.d.ts +39 -0
  23. package/dist/types/fontfamily/fontfamilyui.d.ts +30 -0
  24. package/dist/types/fontfamily/utils.d.ts +15 -0
  25. package/dist/types/fontfamily.d.ts +29 -0
  26. package/dist/types/fontsize/fontsizecommand.d.ts +25 -0
  27. package/dist/types/fontsize/fontsizeediting.d.ts +44 -0
  28. package/dist/types/fontsize/fontsizeui.d.ts +31 -0
  29. package/dist/types/fontsize/utils.d.ts +12 -0
  30. package/dist/types/fontsize.d.ts +37 -0
  31. package/dist/types/index.d.ts +27 -0
  32. package/dist/types/ui/colorui.d.ts +63 -0
  33. package/dist/types/utils.d.ts +80 -0
  34. package/lang/translations/he.po +1 -1
  35. package/lang/translations/pt.po +1 -1
  36. package/package.json +3 -2
@@ -0,0 +1,58 @@
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 { Font, FontBackgroundColor, FontBackgroundColorEditing, FontBackgroundColorUI, FontBackgroundColorCommand, FontColor, FontColorEditing, FontColorUI, FontColorCommand, FontColorConfig, FontFamily, FontFamilyEditing, FontFamilyUI, FontFamilyCommand, FontFamilyConfig, FontSize, FontSizeEditing, FontSizeUI, FontSizeCommand, FontSizeConfig, FONT_BACKGROUND_COLOR, FONT_COLOR, FONT_FAMILY, FONT_SIZE } from './index.js';
6
+ declare module '@ckeditor/ckeditor5-core' {
7
+ interface EditorConfig {
8
+ /**
9
+ * The configuration of the font background color feature.
10
+ * It is introduced by the {@link module:font/fontbackgroundcolor/fontbackgroundcolorediting~FontBackgroundColorEditing} feature.
11
+ *
12
+ * Read more in {@link module:font/fontconfig~FontColorConfig}.
13
+ */
14
+ fontBackgroundColor?: FontColorConfig;
15
+ /**
16
+ * The configuration of the font color feature.
17
+ * It is introduced by the {@link module:font/fontcolor/fontcolorediting~FontColorEditing} feature.
18
+ *
19
+ * Read more in {@link module:font/fontconfig~FontColorConfig}.
20
+ */
21
+ fontColor?: FontColorConfig;
22
+ /**
23
+ * The configuration of the font family feature.
24
+ * It is introduced by the {@link module:font/fontfamily/fontfamilyediting~FontFamilyEditing} feature.
25
+ *
26
+ * Read more in {@link module:font/fontconfig~FontFamilyConfig}.
27
+ */
28
+ fontFamily?: FontFamilyConfig;
29
+ /**
30
+ * The configuration of the font size feature.
31
+ * It is introduced by the {@link module:font/fontsize/fontsizeediting~FontSizeEditing} feature.
32
+ *
33
+ * Read more in {@link module:font/fontconfig~FontSizeConfig}.
34
+ */
35
+ fontSize?: FontSizeConfig;
36
+ }
37
+ interface PluginsMap {
38
+ [Font.pluginName]: Font;
39
+ [FontBackgroundColor.pluginName]: FontBackgroundColor;
40
+ [FontBackgroundColorEditing.pluginName]: FontBackgroundColorEditing;
41
+ [FontBackgroundColorUI.pluginName]: FontBackgroundColorUI;
42
+ [FontColor.pluginName]: FontColor;
43
+ [FontColorEditing.pluginName]: FontColorEditing;
44
+ [FontColorUI.pluginName]: FontColorUI;
45
+ [FontFamily.pluginName]: FontFamily;
46
+ [FontFamilyEditing.pluginName]: FontFamilyEditing;
47
+ [FontFamilyUI.pluginName]: FontFamilyUI;
48
+ [FontSize.pluginName]: FontSize;
49
+ [FontSizeEditing.pluginName]: FontSizeEditing;
50
+ [FontSizeUI.pluginName]: FontSizeUI;
51
+ }
52
+ interface CommandsMap {
53
+ [FONT_SIZE]: FontSizeCommand;
54
+ [FONT_FAMILY]: FontFamilyCommand;
55
+ [FONT_COLOR]: FontColorCommand;
56
+ [FONT_BACKGROUND_COLOR]: FontBackgroundColorCommand;
57
+ }
58
+ }
@@ -0,0 +1,33 @@
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/font
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ import FontFamily from './fontfamily.js';
10
+ import FontSize from './fontsize.js';
11
+ import FontColor from './fontcolor.js';
12
+ import FontBackgroundColor from './fontbackgroundcolor.js';
13
+ /**
14
+ * A plugin that enables a set of text styling features:
15
+ *
16
+ * * {@link module:font/fontsize~FontSize},
17
+ * * {@link module:font/fontfamily~FontFamily}.
18
+ * * {@link module:font/fontcolor~FontColor},
19
+ * * {@link module:font/fontbackgroundcolor~FontBackgroundColor}.
20
+ *
21
+ * For a detailed overview, check the {@glink features/font Font feature} documentation
22
+ * and the {@glink api/font package page}.
23
+ */
24
+ export default class Font extends Plugin {
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ static get requires(): readonly [typeof FontFamily, typeof FontSize, typeof FontColor, typeof FontBackgroundColor];
29
+ /**
30
+ * @inheritDoc
31
+ */
32
+ static get pluginName(): "Font";
33
+ }
@@ -0,0 +1,26 @@
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/fontbackgroundcolor/fontbackgroundcolorcommand
7
+ */
8
+ import type { Editor } from 'ckeditor5/src/core.js';
9
+ import FontCommand from '../fontcommand.js';
10
+ /**
11
+ * The font background color command. It is used by
12
+ * {@link module:font/fontbackgroundcolor/fontbackgroundcolorediting~FontBackgroundColorEditing}
13
+ * to apply the font background color.
14
+ *
15
+ * ```ts
16
+ * editor.execute( 'fontBackgroundColor', { value: 'rgb(250, 20, 20)' } );
17
+ * ```
18
+ *
19
+ * **Note**: Executing the command with the `null` value removes the attribute from the model.
20
+ */
21
+ export default class FontBackgroundColorCommand extends FontCommand {
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ constructor(editor: Editor);
26
+ }
@@ -0,0 +1,26 @@
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/fontbackgroundcolor/fontbackgroundcolorediting
7
+ */
8
+ import { Plugin, type Editor } from 'ckeditor5/src/core.js';
9
+ /**
10
+ * The font background color editing feature.
11
+ *
12
+ * It introduces the {@link module:font/fontbackgroundcolor/fontbackgroundcolorcommand~FontBackgroundColorCommand command} and
13
+ * the `fontBackgroundColor` attribute in the {@link module:engine/model/model~Model model} which renders
14
+ * in the {@link module:engine/view/view view} as a `<span>` element (`<span style="background-color: ...">`),
15
+ * depending on the {@link module:font/fontconfig~FontColorConfig configuration}.
16
+ */
17
+ export default class FontBackgroundColorEditing extends Plugin {
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ static get pluginName(): "FontBackgroundColorEditing";
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ constructor(editor: Editor);
26
+ }
@@ -0,0 +1,22 @@
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/fontbackgroundcolor/fontbackgroundcolorui
7
+ */
8
+ import ColorUI from '../ui/colorui.js';
9
+ import type { Editor } from 'ckeditor5/src/core.js';
10
+ /**
11
+ * The font background color UI plugin. It introduces the `'fontBackgroundColor'` dropdown.
12
+ */
13
+ export default class FontBackgroundColorUI extends ColorUI {
14
+ /**
15
+ * @inheritDoc
16
+ */
17
+ constructor(editor: Editor);
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ static get pluginName(): "FontBackgroundColorUI";
22
+ }
@@ -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/fontbackgroundcolor
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ import FontBackgroundColorEditing from './fontbackgroundcolor/fontbackgroundcolorediting.js';
10
+ import FontBackgroundColorUI from './fontbackgroundcolor/fontbackgroundcolorui.js';
11
+ /**
12
+ * The font background color plugin.
13
+ *
14
+ * For a detailed overview, check the {@glink features/font font feature} documentation
15
+ * and the {@glink api/font package page}.
16
+ *
17
+ * This is a "glue" plugin which loads
18
+ * the {@link module:font/fontbackgroundcolor/fontbackgroundcolorediting~FontBackgroundColorEditing} and
19
+ * {@link module:font/fontbackgroundcolor/fontbackgroundcolorui~FontBackgroundColorUI} features in the editor.
20
+ */
21
+ export default class FontBackgroundColor extends Plugin {
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ static get requires(): readonly [typeof FontBackgroundColorEditing, typeof FontBackgroundColorUI];
26
+ /**
27
+ * @inheritDoc
28
+ */
29
+ static get pluginName(): "FontBackgroundColor";
30
+ }
@@ -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/fontcolor/fontcolorcommand
7
+ */
8
+ import type { Editor } from 'ckeditor5/src/core.js';
9
+ import FontCommand from '../fontcommand.js';
10
+ /**
11
+ * The font color command. It is used by {@link module:font/fontcolor/fontcolorediting~FontColorEditing}
12
+ * to apply the font color.
13
+ *
14
+ * ```ts
15
+ * editor.execute( 'fontColor', { value: 'rgb(250, 20, 20)' } );
16
+ * ```
17
+ *
18
+ * **Note**: Executing the command with the `null` value removes the attribute from the model.
19
+ */
20
+ export default class FontColorCommand extends FontCommand {
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ constructor(editor: Editor);
25
+ }
@@ -0,0 +1,26 @@
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/fontcolor/fontcolorediting
7
+ */
8
+ import { Plugin, type Editor } from 'ckeditor5/src/core.js';
9
+ /**
10
+ * The font color editing feature.
11
+ *
12
+ * It introduces the {@link module:font/fontcolor/fontcolorcommand~FontColorCommand command} and
13
+ * the `fontColor` attribute in the {@link module:engine/model/model~Model model} which renders
14
+ * in the {@link module:engine/view/view view} as a `<span>` element (`<span style="color: ...">`),
15
+ * depending on the {@link module:font/fontconfig~FontColorConfig configuration}.
16
+ */
17
+ export default class FontColorEditing extends Plugin {
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ static get pluginName(): "FontColorEditing";
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ constructor(editor: Editor);
26
+ }
@@ -0,0 +1,22 @@
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/fontcolor/fontcolorui
7
+ */
8
+ import ColorUI from '../ui/colorui.js';
9
+ import type { Editor } from 'ckeditor5/src/core.js';
10
+ /**
11
+ * The font color UI plugin. It introduces the `'fontColor'` dropdown.
12
+ */
13
+ export default class FontColorUI extends ColorUI {
14
+ /**
15
+ * @inheritDoc
16
+ */
17
+ constructor(editor: Editor);
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ static get pluginName(): "FontColorUI";
22
+ }
@@ -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/fontcolor
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ import FontColorEditing from './fontcolor/fontcolorediting.js';
10
+ import FontColorUI from './fontcolor/fontcolorui.js';
11
+ /**
12
+ * The font color plugin.
13
+ *
14
+ * For a detailed overview, check the {@glink features/font font feature} documentation
15
+ * and the {@glink api/font package page}.
16
+ *
17
+ * This is a "glue" plugin which loads the {@link module:font/fontcolor/fontcolorediting~FontColorEditing} and
18
+ * {@link module:font/fontcolor/fontcolorui~FontColorUI} features in the editor.
19
+ */
20
+ export default class FontColor extends Plugin {
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ static get requires(): readonly [typeof FontColorEditing, typeof FontColorUI];
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ static get pluginName(): "FontColor";
29
+ }
@@ -0,0 +1,48 @@
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/fontcommand
7
+ */
8
+ import { Command, type Editor } from 'ckeditor5/src/core.js';
9
+ import { type Batch } from 'ckeditor5/src/engine.js';
10
+ /**
11
+ * The base font command.
12
+ */
13
+ export default abstract class FontCommand extends Command {
14
+ /**
15
+ * When set, it reflects the {@link #attributeKey} value of the selection.
16
+ *
17
+ * @observable
18
+ * @readonly
19
+ */
20
+ value: string;
21
+ /**
22
+ * A model attribute on which this command operates.
23
+ */
24
+ readonly attributeKey: string;
25
+ /**
26
+ * Creates an instance of the command.
27
+ *
28
+ * @param editor Editor instance.
29
+ * @param attributeKey The name of a model attribute on which this command operates.
30
+ */
31
+ constructor(editor: Editor, attributeKey: string);
32
+ /**
33
+ * @inheritDoc
34
+ */
35
+ refresh(): void;
36
+ /**
37
+ * Executes the command. Applies the `value` of the {@link #attributeKey} to the selection.
38
+ * If no `value` is passed, it removes the attribute from the selection.
39
+ *
40
+ * @param options Options for the executed command.
41
+ * @param options.value The value to apply.
42
+ * @fires execute
43
+ */
44
+ execute(options?: {
45
+ value?: string;
46
+ batch?: Batch;
47
+ }): void;
48
+ }