@ckeditor/ckeditor5-html-support 48.2.0-alpha.7 → 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.
@@ -1,191 +1,191 @@
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 html-support/dataschema
7
- */
8
- import { Plugin } from '@ckeditor/ckeditor5-core';
9
- import type { ModelAttributeProperties, ModelSchemaItemDefinition } from '@ckeditor/ckeditor5-engine';
6
+ * @module html-support/dataschema
7
+ */
8
+ import { Plugin } from "@ckeditor/ckeditor5-core";
9
+ import type { ModelAttributeProperties, ModelSchemaItemDefinition } from "@ckeditor/ckeditor5-engine";
10
10
  /**
11
- * Holds representation of the extended HTML document type definitions to be used by the
12
- * editor in HTML support.
13
- *
14
- * Data schema is represented by data schema definitions.
15
- *
16
- * To add new definition for block element,
17
- * use {@link module:html-support/dataschema~DataSchema#registerBlockElement} method:
18
- *
19
- * ```ts
20
- * dataSchema.registerBlockElement( {
21
- * view: 'section',
22
- * model: 'my-section',
23
- * modelSchema: {
24
- * inheritAllFrom: '$block'
25
- * }
26
- * } );
27
- * ```
28
- *
29
- * To add new definition for inline element,
30
- * use {@link module:html-support/dataschema~DataSchema#registerInlineElement} method:
31
- *
32
- * ```
33
- * dataSchema.registerInlineElement( {
34
- * view: 'span',
35
- * model: 'my-span',
36
- * attributeProperties: {
37
- * copyOnEnter: true
38
- * }
39
- * } );
40
- * ```
41
- */
11
+ * Holds representation of the extended HTML document type definitions to be used by the
12
+ * editor in HTML support.
13
+ *
14
+ * Data schema is represented by data schema definitions.
15
+ *
16
+ * To add new definition for block element,
17
+ * use {@link module:html-support/dataschema~DataSchema#registerBlockElement} method:
18
+ *
19
+ * ```ts
20
+ * dataSchema.registerBlockElement( {
21
+ * view: 'section',
22
+ * model: 'my-section',
23
+ * modelSchema: {
24
+ * inheritAllFrom: '$block'
25
+ * }
26
+ * } );
27
+ * ```
28
+ *
29
+ * To add new definition for inline element,
30
+ * use {@link module:html-support/dataschema~DataSchema#registerInlineElement} method:
31
+ *
32
+ * ```
33
+ * dataSchema.registerInlineElement( {
34
+ * view: 'span',
35
+ * model: 'my-span',
36
+ * attributeProperties: {
37
+ * copyOnEnter: true
38
+ * }
39
+ * } );
40
+ * ```
41
+ */
42
42
  export declare class DataSchema extends Plugin {
43
- /**
44
- * A map of registered data schema definitions.
45
- */
46
- private readonly _definitions;
47
- /**
48
- * @inheritDoc
49
- */
50
- static get pluginName(): "DataSchema";
51
- /**
52
- * @inheritDoc
53
- */
54
- static get isOfficialPlugin(): true;
55
- /**
56
- * @inheritDoc
57
- */
58
- init(): void;
59
- /**
60
- * Add new data schema definition describing block element.
61
- */
62
- registerBlockElement(definition: HtmlSupportDataSchemaBlockElementDefinition): void;
63
- /**
64
- * Add new data schema definition describing inline element.
65
- */
66
- registerInlineElement(definition: HtmlSupportDataSchemaInlineElementDefinition): void;
67
- /**
68
- * Updates schema definition describing block element with new properties.
69
- *
70
- * Creates new scheme if it doesn't exist.
71
- * Array properties are concatenated with original values.
72
- *
73
- * @param definition Definition update.
74
- */
75
- extendBlockElement(definition: HtmlSupportDataSchemaBlockElementDefinition): void;
76
- /**
77
- * Updates schema definition describing inline element with new properties.
78
- *
79
- * Creates new scheme if it doesn't exist.
80
- * Array properties are concatenated with original values.
81
- *
82
- * @param definition Definition update.
83
- */
84
- extendInlineElement(definition: HtmlSupportDataSchemaInlineElementDefinition): void;
85
- /**
86
- * Returns all definitions matching the given view name.
87
- *
88
- * @param includeReferences Indicates if this method should also include definitions of referenced models.
89
- */
90
- getDefinitionsForView(viewName: string | RegExp, includeReferences?: boolean): Set<HtmlSupportDataSchemaDefinition>;
91
- /**
92
- * Returns definitions matching the given model name.
93
- */
94
- getDefinitionsForModel(modelName: string): Array<HtmlSupportDataSchemaDefinition>;
95
- /**
96
- * Returns definitions matching the given view name.
97
- */
98
- private _getMatchingViewDefinitions;
99
- /**
100
- * Resolves all definition references registered for the given data schema definition.
101
- *
102
- * @param modelName Data schema model name.
103
- */
104
- private _getReferences;
105
- /**
106
- * Updates schema definition with new properties.
107
- *
108
- * Creates new scheme if it doesn't exist.
109
- * Array properties are concatenated with original values.
110
- *
111
- * @param definition Definition update.
112
- */
113
- private _extendDefinition;
43
+ /**
44
+ * A map of registered data schema definitions.
45
+ */
46
+ private readonly _definitions;
47
+ /**
48
+ * @inheritDoc
49
+ */
50
+ static get pluginName(): "DataSchema";
51
+ /**
52
+ * @inheritDoc
53
+ */
54
+ static override get isOfficialPlugin(): true;
55
+ /**
56
+ * @inheritDoc
57
+ */
58
+ init(): void;
59
+ /**
60
+ * Add new data schema definition describing block element.
61
+ */
62
+ registerBlockElement(definition: HtmlSupportDataSchemaBlockElementDefinition): void;
63
+ /**
64
+ * Add new data schema definition describing inline element.
65
+ */
66
+ registerInlineElement(definition: HtmlSupportDataSchemaInlineElementDefinition): void;
67
+ /**
68
+ * Updates schema definition describing block element with new properties.
69
+ *
70
+ * Creates new scheme if it doesn't exist.
71
+ * Array properties are concatenated with original values.
72
+ *
73
+ * @param definition Definition update.
74
+ */
75
+ extendBlockElement(definition: HtmlSupportDataSchemaBlockElementDefinition): void;
76
+ /**
77
+ * Updates schema definition describing inline element with new properties.
78
+ *
79
+ * Creates new scheme if it doesn't exist.
80
+ * Array properties are concatenated with original values.
81
+ *
82
+ * @param definition Definition update.
83
+ */
84
+ extendInlineElement(definition: HtmlSupportDataSchemaInlineElementDefinition): void;
85
+ /**
86
+ * Returns all definitions matching the given view name.
87
+ *
88
+ * @param includeReferences Indicates if this method should also include definitions of referenced models.
89
+ */
90
+ getDefinitionsForView(viewName: string | RegExp, includeReferences?: boolean): Set<HtmlSupportDataSchemaDefinition>;
91
+ /**
92
+ * Returns definitions matching the given model name.
93
+ */
94
+ getDefinitionsForModel(modelName: string): Array<HtmlSupportDataSchemaDefinition>;
95
+ /**
96
+ * Returns definitions matching the given view name.
97
+ */
98
+ private _getMatchingViewDefinitions;
99
+ /**
100
+ * Resolves all definition references registered for the given data schema definition.
101
+ *
102
+ * @param modelName Data schema model name.
103
+ */
104
+ private _getReferences;
105
+ /**
106
+ * Updates schema definition with new properties.
107
+ *
108
+ * Creates new scheme if it doesn't exist.
109
+ * Array properties are concatenated with original values.
110
+ *
111
+ * @param definition Definition update.
112
+ */
113
+ private _extendDefinition;
114
114
  }
115
115
  /**
116
- * A base definition of {@link module:html-support/dataschema~DataSchema data schema}.
117
- */
116
+ * A base definition of {@link module:html-support/dataschema~DataSchema data schema}.
117
+ */
118
118
  export interface HtmlSupportDataSchemaDefinition {
119
- /**
120
- * Name of the model.
121
- */
122
- model: string;
123
- /**
124
- * Name of the view element.
125
- */
126
- view?: string;
127
- /**
128
- * Indicates that the definition describes object element.
129
- */
130
- isObject?: boolean;
131
- /**
132
- * The model schema item definition describing registered model.
133
- */
134
- modelSchema?: ModelSchemaItemDefinition;
135
- /**
136
- * Indicates that the definition describes block element.
137
- * Set by {@link module:html-support/dataschema~DataSchema#registerBlockElement} method.
138
- */
139
- isBlock?: boolean;
140
- /**
141
- * Indicates that the definition describes inline element.
142
- */
143
- isInline?: boolean;
144
- /**
145
- * Indicates that the definition describes an empty HTML element like `<hr>`.
146
- */
147
- isEmpty?: boolean;
119
+ /**
120
+ * Name of the model.
121
+ */
122
+ model: string;
123
+ /**
124
+ * Name of the view element.
125
+ */
126
+ view?: string;
127
+ /**
128
+ * Indicates that the definition describes object element.
129
+ */
130
+ isObject?: boolean;
131
+ /**
132
+ * The model schema item definition describing registered model.
133
+ */
134
+ modelSchema?: ModelSchemaItemDefinition;
135
+ /**
136
+ * Indicates that the definition describes block element.
137
+ * Set by {@link module:html-support/dataschema~DataSchema#registerBlockElement} method.
138
+ */
139
+ isBlock?: boolean;
140
+ /**
141
+ * Indicates that the definition describes inline element.
142
+ */
143
+ isInline?: boolean;
144
+ /**
145
+ * Indicates that the definition describes an empty HTML element like `<hr>`.
146
+ */
147
+ isEmpty?: boolean;
148
148
  }
149
149
  /**
150
- * A definition of {@link module:html-support/dataschema~DataSchema data schema} for block elements.
151
- */
150
+ * A definition of {@link module:html-support/dataschema~DataSchema data schema} for block elements.
151
+ */
152
152
  export interface HtmlSupportDataSchemaBlockElementDefinition extends HtmlSupportDataSchemaDefinition {
153
- /**
154
- * Should be used when an element can behave both as a sectioning element (e.g. article) and
155
- * element accepting only inline content (e.g. paragraph).
156
- * If an element contains only inline content, this option will be used as a model name.
157
- */
158
- paragraphLikeModel?: string;
153
+ /**
154
+ * Should be used when an element can behave both as a sectioning element (e.g. article) and
155
+ * element accepting only inline content (e.g. paragraph).
156
+ * If an element contains only inline content, this option will be used as a model name.
157
+ */
158
+ paragraphLikeModel?: string;
159
159
  }
160
160
  /**
161
- * A definition of {@link module:html-support/dataschema~DataSchema data schema} for inline elements.
162
- */
161
+ * A definition of {@link module:html-support/dataschema~DataSchema data schema} for inline elements.
162
+ */
163
163
  export interface HtmlSupportDataSchemaInlineElementDefinition extends HtmlSupportDataSchemaDefinition {
164
- /**
165
- * Additional metadata describing the model attribute.
166
- */
167
- attributeProperties?: ModelAttributeProperties;
168
- /**
169
- * Element priority. Decides in what order elements are wrapped by
170
- * {@link module:engine/view/downcastwriter~ViewDowncastWriter}.
171
- * Set by {@link module:html-support/dataschema~DataSchema#registerInlineElement} method.
172
- */
173
- priority?: number;
174
- /**
175
- * The name of the model attribute that generates the same view element. GHS inline attribute
176
- * will be removed from the model tree as soon as the coupled attribute is removed. See
177
- * {@link module:html-support/datafilter~DataFilter#_registerCoupledAttributesPostFixer GHS post-fixer} for more details.
178
- */
179
- coupledAttribute?: string;
180
- /**
181
- * Indicates that element should not be converted as a model text attribute.
182
- * It is used to map view elements that do not have a separate model element but their data is stored in a model attribute.
183
- * For example `<tbody>` element does not have a dedicated model element and GHS stores attributes of `<tbody>`
184
- * in the `htmlTbodyAttributes` model attribute of the `table` model element.
185
- */
186
- appliesToBlock?: boolean | string;
187
- /**
188
- * Indicates that an element should be preserved even if it has no content.
189
- */
190
- allowEmpty?: boolean;
164
+ /**
165
+ * Additional metadata describing the model attribute.
166
+ */
167
+ attributeProperties?: ModelAttributeProperties;
168
+ /**
169
+ * Element priority. Decides in what order elements are wrapped by
170
+ * {@link module:engine/view/downcastwriter~ViewDowncastWriter}.
171
+ * Set by {@link module:html-support/dataschema~DataSchema#registerInlineElement} method.
172
+ */
173
+ priority?: number;
174
+ /**
175
+ * The name of the model attribute that generates the same view element. GHS inline attribute
176
+ * will be removed from the model tree as soon as the coupled attribute is removed. See
177
+ * {@link module:html-support/datafilter~DataFilter#_registerCoupledAttributesPostFixer GHS post-fixer} for more details.
178
+ */
179
+ coupledAttribute?: string;
180
+ /**
181
+ * Indicates that element should not be converted as a model text attribute.
182
+ * It is used to map view elements that do not have a separate model element but their data is stored in a model attribute.
183
+ * For example `<tbody>` element does not have a dedicated model element and GHS stores attributes of `<tbody>`
184
+ * in the `htmlTbodyAttributes` model attribute of the `table` model element.
185
+ */
186
+ appliesToBlock?: boolean | string;
187
+ /**
188
+ * Indicates that an element should be preserved even if it has no content.
189
+ */
190
+ allowEmpty?: boolean;
191
191
  }
@@ -1,60 +1,60 @@
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
- */
5
- import { Plugin } from '@ckeditor/ckeditor5-core';
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
+ import { Plugin } from "@ckeditor/ckeditor5-core";
6
6
  /**
7
- * This plugin allows for preserving empty block elements in the editor content
8
- * instead of automatically filling them with block fillers (`&nbsp;`).
9
- *
10
- * This is useful when you want to:
11
- *
12
- * * Preserve empty block elements exactly as they were in the source HTML.
13
- * * Allow for styling empty blocks with CSS (block fillers can interfere with height/margin).
14
- * * Maintain compatibility with external systems that expect empty blocks to remain empty.
15
- *
16
- * Known limitations:
17
- *
18
- * * Empty blocks may not work correctly with revision history features.
19
- * * Keyboard navigation through the document might behave unexpectedly, especially when
20
- * navigating through structures like lists and tables.
21
- *
22
- * For example, this allows for HTML like:
23
- *
24
- * ```html
25
- * <p></p>
26
- * <p class="spacer"></p>
27
- * <td></td>
28
- * ```
29
- * to remain empty instead of being converted to:
30
- *
31
- * ```html
32
- * <p>&nbsp;</p>
33
- * <p class="spacer">&nbsp;</p>
34
- * <td>&nbsp;</td>
35
- * ```
36
- */
7
+ * This plugin allows for preserving empty block elements in the editor content
8
+ * instead of automatically filling them with block fillers (`&nbsp;`).
9
+ *
10
+ * This is useful when you want to:
11
+ *
12
+ * * Preserve empty block elements exactly as they were in the source HTML.
13
+ * * Allow for styling empty blocks with CSS (block fillers can interfere with height/margin).
14
+ * * Maintain compatibility with external systems that expect empty blocks to remain empty.
15
+ *
16
+ * Known limitations:
17
+ *
18
+ * * Empty blocks may not work correctly with revision history features.
19
+ * * Keyboard navigation through the document might behave unexpectedly, especially when
20
+ * navigating through structures like lists and tables.
21
+ *
22
+ * For example, this allows for HTML like:
23
+ *
24
+ * ```html
25
+ * <p></p>
26
+ * <p class="spacer"></p>
27
+ * <td></td>
28
+ * ```
29
+ * to remain empty instead of being converted to:
30
+ *
31
+ * ```html
32
+ * <p>&nbsp;</p>
33
+ * <p class="spacer">&nbsp;</p>
34
+ * <td>&nbsp;</td>
35
+ * ```
36
+ */
37
37
  export declare class EmptyBlock extends Plugin {
38
- /**
39
- * @inheritDoc
40
- */
41
- static get pluginName(): "EmptyBlock";
42
- /**
43
- * @inheritDoc
44
- */
45
- static get isOfficialPlugin(): true;
46
- /**
47
- * @inheritDoc
48
- */
49
- afterInit(): void;
50
- /**
51
- * Handle clipboard paste events:
52
- *
53
- * * It does not affect *copying* content from the editor, only *pasting*.
54
- * * When content is pasted from another editor instance with `<p></p>`,
55
- * the `&nbsp;` filler is added, so the getData result is `<p>&nbsp;</p>`.
56
- * * When content is pasted from the same editor instance with `<p></p>`,
57
- * the `&nbsp;` filler is not added, so the getData result is `<p></p>`.
58
- */
59
- private _registerClipboardPastingHandler;
38
+ /**
39
+ * @inheritDoc
40
+ */
41
+ static get pluginName(): "EmptyBlock";
42
+ /**
43
+ * @inheritDoc
44
+ */
45
+ static override get isOfficialPlugin(): true;
46
+ /**
47
+ * @inheritDoc
48
+ */
49
+ afterInit(): void;
50
+ /**
51
+ * Handle clipboard paste events:
52
+ *
53
+ * * It does not affect *copying* content from the editor, only *pasting*.
54
+ * * When content is pasted from another editor instance with `<p></p>`,
55
+ * the `&nbsp;` filler is added, so the getData result is `<p>&nbsp;</p>`.
56
+ * * When content is pasted from the same editor instance with `<p></p>`,
57
+ * the `&nbsp;` filler is not added, so the getData result is `<p></p>`.
58
+ */
59
+ private _registerClipboardPastingHandler;
60
60
  }
@@ -1,57 +1,57 @@
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 html-support/fullpage
7
- */
8
- import { Plugin, type Editor } from '@ckeditor/ckeditor5-core';
6
+ * @module html-support/fullpage
7
+ */
8
+ import { Plugin, type Editor } from "@ckeditor/ckeditor5-core";
9
9
  /**
10
- * The full page editing feature. It preserves the whole HTML page in the editor data.
11
- */
10
+ * The full page editing feature. It preserves the whole HTML page in the editor data.
11
+ */
12
12
  export declare class FullPage extends Plugin {
13
- /**
14
- * @inheritDoc
15
- */
16
- static get pluginName(): "FullPage";
17
- /**
18
- * @inheritDoc
19
- * @internal
20
- */
21
- static get licenseFeatureCode(): string;
22
- /**
23
- * @inheritDoc
24
- */
25
- static get isOfficialPlugin(): true;
26
- /**
27
- * @inheritDoc
28
- */
29
- static get isPremiumPlugin(): true;
30
- /**
31
- * @inheritDoc
32
- */
33
- constructor(editor: Editor);
34
- /**
35
- * @inheritDoc
36
- */
37
- init(): void;
38
- /**
39
- * @inheritDoc
40
- */
41
- destroy(): void;
42
- /**
43
- * Checks if in the document exists any `<style>` elements injected by the plugin and removes them,
44
- * so these could be re-rendered later.
45
- * There is used `data-full-page-style-id` attribute to recognize styles injected by the feature.
46
- */
47
- private _removeStyleElementsFromDom;
48
- /**
49
- * Extracts `<style>` elements from the full page data and renders them in the main document `<head>`.
50
- * CSS content is sanitized before rendering.
51
- */
52
- private _renderStyleElementsInDom;
53
- /**
54
- * Removes existing `<style>` elements injected by the plugin and renders new ones from the full page data.
55
- */
56
- private _renderStylesFromHead;
13
+ /**
14
+ * @inheritDoc
15
+ */
16
+ static get pluginName(): "FullPage";
17
+ /**
18
+ * @inheritDoc
19
+ * @internal
20
+ */
21
+ static get licenseFeatureCode(): string;
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ static override get isOfficialPlugin(): true;
26
+ /**
27
+ * @inheritDoc
28
+ */
29
+ static override get isPremiumPlugin(): true;
30
+ /**
31
+ * @inheritDoc
32
+ */
33
+ constructor(editor: Editor);
34
+ /**
35
+ * @inheritDoc
36
+ */
37
+ init(): void;
38
+ /**
39
+ * @inheritDoc
40
+ */
41
+ override destroy(): void;
42
+ /**
43
+ * Checks if in the document exists any `<style>` elements injected by the plugin and removes them,
44
+ * so these could be re-rendered later.
45
+ * There is used `data-full-page-style-id` attribute to recognize styles injected by the feature.
46
+ */
47
+ private _removeStyleElementsFromDom;
48
+ /**
49
+ * Extracts `<style>` elements from the full page data and renders them in the main document `<head>`.
50
+ * CSS content is sanitized before rendering.
51
+ */
52
+ private _renderStyleElementsInDom;
53
+ /**
54
+ * Removes existing `<style>` elements injected by the plugin and renders new ones from the full page data.
55
+ */
56
+ private _renderStylesFromHead;
57
57
  }