@ckeditor/ckeditor5-heading 48.2.0 → 48.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.
package/dist/title.d.ts CHANGED
@@ -1,130 +1,130 @@
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 heading/title
7
- */
8
- import { Plugin } from '@ckeditor/ckeditor5-core';
9
- import { Paragraph } from '@ckeditor/ckeditor5-paragraph';
6
+ * @module heading/title
7
+ */
8
+ import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
9
+ import { Paragraph } from "@ckeditor/ckeditor5-paragraph";
10
10
  /**
11
- * The Title plugin.
12
- *
13
- * It splits the document into `Title` and `Body` sections.
14
- */
11
+ * The Title plugin.
12
+ *
13
+ * It splits the document into `Title` and `Body` sections.
14
+ */
15
15
  export declare class Title extends Plugin {
16
- /**
17
- * A reference to an empty paragraph in the body
18
- * created when there is no element in the body for the placeholder purposes.
19
- */
20
- private _bodyPlaceholder;
21
- /**
22
- * @inheritDoc
23
- */
24
- static get pluginName(): "Title";
25
- /**
26
- * @inheritDoc
27
- */
28
- static get isOfficialPlugin(): true;
29
- /**
30
- * @inheritDoc
31
- */
32
- static get requires(): readonly [typeof Paragraph];
33
- /**
34
- * @inheritDoc
35
- */
36
- init(): void;
37
- /**
38
- * Logs a single warning when none of the editor's roots can host the title structure. The Title feature
39
- * only operates on roots whose `modelElement` is the default `$root`; roots configured with a custom
40
- * `modelElement` are silently skipped at runtime. If no root supports the structure, the plugin is
41
- * effectively a no-op and the integrator likely wants to know.
42
- */
43
- private _warnIfNoSupportedRoot;
44
- /**
45
- * Returns the title of the document. Note that because this plugin does not allow any formatting inside
46
- * the title element, the output of this method will be a plain text, with no HTML tags.
47
- *
48
- * It is not recommended to use this method together with features that insert markers to the
49
- * data output, like comments or track changes features. If such markers start in the title and end in the
50
- * body, the result of this method might be incorrect.
51
- *
52
- * @param options Additional configuration passed to the conversion process.
53
- * See {@link module:engine/controller/datacontroller~DataController#get `DataController#get`}.
54
- * @returns The title of the document.
55
- */
56
- getTitle(options?: Record<string, unknown>): string;
57
- /**
58
- * Returns the body of the document.
59
- *
60
- * Note that it is not recommended to use this method together with features that insert markers to the
61
- * data output, like comments or track changes features. If such markers start in the title and end in the
62
- * body, the result of this method might be incorrect.
63
- *
64
- * @param options Additional configuration passed to the conversion process.
65
- * See {@link module:engine/controller/datacontroller~DataController#get `DataController#get`}.
66
- * @returns The body of the document.
67
- */
68
- getBody(options?: Record<string, unknown>): string;
69
- /**
70
- * Returns the `title` element when it is in the document. Returns `undefined` otherwise.
71
- */
72
- private _getTitleElement;
73
- /**
74
- * Model post-fixer callback that ensures that `title` has only one `title-content` child.
75
- * All additional children should be moved after the `title` element and renamed to a paragraph.
76
- */
77
- private _fixTitleContent;
78
- /**
79
- * Model post-fixer callback that creates a title element when it is missing,
80
- * takes care of the correct position of it and removes additional title elements.
81
- */
82
- private _fixTitleElement;
83
- /**
84
- * Model post-fixer callback that adds an empty paragraph at the end of the document
85
- * when it is needed for the placeholder purposes.
86
- */
87
- private _fixBodyElement;
88
- /**
89
- * Model post-fixer callback that removes a paragraph from the end of the document
90
- * if it was created for the placeholder purposes and is not needed anymore.
91
- */
92
- private _fixExtraParagraph;
93
- /**
94
- * Attaches the `Title` and `Body` placeholders to the title and/or content.
95
- */
96
- private _attachPlaceholders;
97
- /**
98
- * Creates navigation between the title and body sections using <kbd>Tab</kbd> and <kbd>Shift</kbd>+<kbd>Tab</kbd> keys.
99
- */
100
- private _attachTabPressHandling;
16
+ /**
17
+ * A reference to an empty paragraph in the body
18
+ * created when there is no element in the body for the placeholder purposes.
19
+ */
20
+ private _bodyPlaceholder;
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ static get pluginName(): "Title";
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ static override get isOfficialPlugin(): true;
29
+ /**
30
+ * @inheritDoc
31
+ */
32
+ static get requires(): PluginDependenciesOf<[Paragraph]>;
33
+ /**
34
+ * @inheritDoc
35
+ */
36
+ init(): void;
37
+ /**
38
+ * Logs a single warning when none of the editor's roots can host the title structure. The Title feature
39
+ * only operates on roots whose `modelElement` is the default `$root`; roots configured with a custom
40
+ * `modelElement` are silently skipped at runtime. If no root supports the structure, the plugin is
41
+ * effectively a no-op and the integrator likely wants to know.
42
+ */
43
+ private _warnIfNoSupportedRoot;
44
+ /**
45
+ * Returns the title of the document. Note that because this plugin does not allow any formatting inside
46
+ * the title element, the output of this method will be a plain text, with no HTML tags.
47
+ *
48
+ * It is not recommended to use this method together with features that insert markers to the
49
+ * data output, like comments or track changes features. If such markers start in the title and end in the
50
+ * body, the result of this method might be incorrect.
51
+ *
52
+ * @param options Additional configuration passed to the conversion process.
53
+ * See {@link module:engine/controller/datacontroller~DataController#get `DataController#get`}.
54
+ * @returns The title of the document.
55
+ */
56
+ getTitle(options?: Record<string, unknown>): string;
57
+ /**
58
+ * Returns the body of the document.
59
+ *
60
+ * Note that it is not recommended to use this method together with features that insert markers to the
61
+ * data output, like comments or track changes features. If such markers start in the title and end in the
62
+ * body, the result of this method might be incorrect.
63
+ *
64
+ * @param options Additional configuration passed to the conversion process.
65
+ * See {@link module:engine/controller/datacontroller~DataController#get `DataController#get`}.
66
+ * @returns The body of the document.
67
+ */
68
+ getBody(options?: Record<string, unknown>): string;
69
+ /**
70
+ * Returns the `title` element when it is in the document. Returns `undefined` otherwise.
71
+ */
72
+ private _getTitleElement;
73
+ /**
74
+ * Model post-fixer callback that ensures that `title` has only one `title-content` child.
75
+ * All additional children should be moved after the `title` element and renamed to a paragraph.
76
+ */
77
+ private _fixTitleContent;
78
+ /**
79
+ * Model post-fixer callback that creates a title element when it is missing,
80
+ * takes care of the correct position of it and removes additional title elements.
81
+ */
82
+ private _fixTitleElement;
83
+ /**
84
+ * Model post-fixer callback that adds an empty paragraph at the end of the document
85
+ * when it is needed for the placeholder purposes.
86
+ */
87
+ private _fixBodyElement;
88
+ /**
89
+ * Model post-fixer callback that removes a paragraph from the end of the document
90
+ * if it was created for the placeholder purposes and is not needed anymore.
91
+ */
92
+ private _fixExtraParagraph;
93
+ /**
94
+ * Attaches the `Title` and `Body` placeholders to the title and/or content.
95
+ */
96
+ private _attachPlaceholders;
97
+ /**
98
+ * Creates navigation between the title and body sections using <kbd>Tab</kbd> and <kbd>Shift</kbd>+<kbd>Tab</kbd> keys.
99
+ */
100
+ private _attachTabPressHandling;
101
101
  }
102
102
  /**
103
- * The configuration of the {@link module:heading/title~Title title feature}.
104
- *
105
- * ```ts
106
- * ClassicEditor
107
- * .create( {
108
- * attachTo: document.querySelector( '#editor' ),
109
- * plugins: [ Title, ... ],
110
- * title: {
111
- * placeholder: 'My custom placeholder for the title'
112
- * },
113
- * root: {
114
- * placeholder: 'My custom placeholder for the body'
115
- * }
116
- * } )
117
- * .then( ... )
118
- * .catch( ... );
119
- * ```
120
- *
121
- * See {@link module:core/editor/editorconfig~EditorConfig all editor configuration options}.
122
- */
103
+ * The configuration of the {@link module:heading/title~Title title feature}.
104
+ *
105
+ * ```ts
106
+ * ClassicEditor
107
+ * .create( {
108
+ * attachTo: document.querySelector( '#editor' ),
109
+ * plugins: [ Title, ... ],
110
+ * title: {
111
+ * placeholder: 'My custom placeholder for the title'
112
+ * },
113
+ * root: {
114
+ * placeholder: 'My custom placeholder for the body'
115
+ * }
116
+ * } )
117
+ * .then( ... )
118
+ * .catch( ... );
119
+ * ```
120
+ *
121
+ * See {@link module:core/editor/editorconfig~EditorConfig all editor configuration options}.
122
+ */
123
123
  export interface HeadingTitleConfig {
124
- /**
125
- * Defines a custom value of the placeholder for the title field.
126
- *
127
- * Read more in {@link module:heading/title~HeadingTitleConfig}.
128
- */
129
- placeholder?: string;
124
+ /**
125
+ * Defines a custom value of the placeholder for the title field.
126
+ *
127
+ * Read more in {@link module:heading/title~HeadingTitleConfig}.
128
+ */
129
+ placeholder?: string;
130
130
  }
package/dist/utils.d.ts CHANGED
@@ -1,20 +1,20 @@
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 heading/utils
7
- */
8
- import type { Editor } from '@ckeditor/ckeditor5-core';
9
- import type { HeadingOption } from './headingconfig.js';
6
+ * @module heading/utils
7
+ */
8
+ import type { Editor } from "@ckeditor/ckeditor5-core";
9
+ import type { HeadingOption } from "./headingconfig.js";
10
10
  /**
11
- * Returns heading options as defined in `config.heading.options` but processed to consider
12
- * the editor localization, i.e. to display {@link module:heading/headingconfig~HeadingOption}
13
- * in the correct language.
14
- *
15
- * Note: The reason behind this method is that there is no way to use {@link module:utils/locale~Locale#t}
16
- * when the user configuration is defined because the editor does not exist yet.
17
- *
18
- * @internal
19
- */
11
+ * Returns heading options as defined in `config.heading.options` but processed to consider
12
+ * the editor localization, i.e. to display {@link module:heading/headingconfig~HeadingOption}
13
+ * in the correct language.
14
+ *
15
+ * Note: The reason behind this method is that there is no way to use {@link module:utils/locale~Locale#t}
16
+ * when the user configuration is defined because the editor does not exist yet.
17
+ *
18
+ * @internal
19
+ */
20
20
  export declare function getLocalizedOptions(editor: Editor): Array<HeadingOption>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-heading",
3
- "version": "48.2.0",
3
+ "version": "48.3.0-alpha.0",
4
4
  "description": "Headings feature for CKEditor 5.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "CKSource (http://cksource.com/)",
@@ -26,13 +26,13 @@
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-enter": "48.2.0",
32
- "@ckeditor/ckeditor5-icons": "48.2.0",
33
- "@ckeditor/ckeditor5-paragraph": "48.2.0",
34
- "@ckeditor/ckeditor5-ui": "48.2.0",
35
- "@ckeditor/ckeditor5-utils": "48.2.0"
29
+ "@ckeditor/ckeditor5-core": "48.3.0-alpha.0",
30
+ "@ckeditor/ckeditor5-engine": "48.3.0-alpha.0",
31
+ "@ckeditor/ckeditor5-enter": "48.3.0-alpha.0",
32
+ "@ckeditor/ckeditor5-icons": "48.3.0-alpha.0",
33
+ "@ckeditor/ckeditor5-paragraph": "48.3.0-alpha.0",
34
+ "@ckeditor/ckeditor5-ui": "48.3.0-alpha.0",
35
+ "@ckeditor/ckeditor5-utils": "48.3.0-alpha.0"
36
36
  },
37
37
  "files": [
38
38
  "dist",