@ckeditor/ckeditor5-html-support 45.2.1-alpha.9 → 46.0.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/build/html-support.js +2 -2
- package/dist/index.js +66 -13
- package/dist/index.js.map +1 -1
- package/package.json +13 -12
- package/src/converters.d.ts +21 -11
- package/src/converters.js +10 -0
- package/src/datafilter.d.ts +6 -6
- package/src/datafilter.js +7 -5
- package/src/dataschema.d.ts +14 -14
- package/src/dataschema.js +2 -2
- package/src/emptyblock.d.ts +1 -1
- package/src/emptyblock.js +1 -1
- package/src/fullpage.d.ts +1 -1
- package/src/fullpage.js +4 -4
- package/src/generalhtmlsupport.d.ts +20 -16
- package/src/generalhtmlsupport.js +21 -14
- package/src/generalhtmlsupportconfig.d.ts +5 -5
- package/src/htmlcomment.d.ts +6 -6
- package/src/htmlcomment.js +1 -1
- package/src/htmlpagedataprocessor.d.ts +1 -1
- package/src/htmlpagedataprocessor.js +3 -3
- package/src/index.d.ts +23 -19
- package/src/index.js +11 -7
- package/src/integrations/codeblock.d.ts +2 -2
- package/src/integrations/codeblock.js +2 -2
- package/src/integrations/customelement.d.ts +3 -3
- package/src/integrations/customelement.js +7 -6
- package/src/integrations/dualcontent.d.ts +6 -5
- package/src/integrations/dualcontent.js +6 -5
- package/src/integrations/heading.d.ts +2 -2
- package/src/integrations/heading.js +2 -2
- package/src/integrations/horizontalline.d.ts +2 -2
- package/src/integrations/horizontalline.js +2 -2
- package/src/integrations/image.d.ts +2 -2
- package/src/integrations/image.js +2 -2
- package/src/integrations/integrationutils.d.ts +2 -2
- package/src/integrations/list.d.ts +2 -2
- package/src/integrations/list.js +2 -2
- package/src/integrations/mediaembed.d.ts +2 -2
- package/src/integrations/mediaembed.js +3 -3
- package/src/integrations/script.d.ts +2 -2
- package/src/integrations/script.js +4 -3
- package/src/integrations/style.d.ts +2 -2
- package/src/integrations/style.js +4 -3
- package/src/integrations/table.d.ts +2 -2
- package/src/integrations/table.js +2 -2
- package/src/schemadefinitions.d.ts +4 -5
- package/src/schemadefinitions.js +5 -2
- package/src/utils.d.ts +26 -7
- package/src/utils.js +30 -0
package/src/htmlcomment.d.ts
CHANGED
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module html-support/htmlcomment
|
|
7
7
|
*/
|
|
8
|
-
import type {
|
|
8
|
+
import type { ModelPosition, ModelRange } from 'ckeditor5/src/engine.js';
|
|
9
9
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
10
10
|
/**
|
|
11
11
|
* The HTML comment feature. It preserves the HTML comments (`<!-- -->`) in the editor data.
|
|
12
12
|
*
|
|
13
13
|
* For a detailed overview, check the {@glink features/html/html-comments HTML comment feature documentation}.
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export declare class HtmlComment extends Plugin {
|
|
16
16
|
/**
|
|
17
17
|
* @inheritDoc
|
|
18
18
|
*/
|
|
@@ -32,7 +32,7 @@ export default class HtmlComment extends Plugin {
|
|
|
32
32
|
*
|
|
33
33
|
* @returns Comment ID. This ID can be later used to e.g. remove the comment from the content.
|
|
34
34
|
*/
|
|
35
|
-
createHtmlComment(position:
|
|
35
|
+
createHtmlComment(position: ModelPosition, content: string): string;
|
|
36
36
|
/**
|
|
37
37
|
* Removes an HTML comment with the given comment ID.
|
|
38
38
|
*
|
|
@@ -61,16 +61,16 @@ export default class HtmlComment extends Plugin {
|
|
|
61
61
|
* @param options.skipBoundaries When set to `true` the range boundaries will be skipped.
|
|
62
62
|
* @returns HTML comment IDs
|
|
63
63
|
*/
|
|
64
|
-
getHtmlCommentsInRange(range:
|
|
64
|
+
getHtmlCommentsInRange(range: ModelRange, { skipBoundaries }?: {
|
|
65
65
|
skipBoundaries?: boolean | undefined;
|
|
66
66
|
}): Array<string>;
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
69
69
|
* An interface for the HTML comments data.
|
|
70
70
|
*
|
|
71
|
-
* It consists of the {@link module:engine/model/position~
|
|
71
|
+
* It consists of the {@link module:engine/model/position~ModelPosition `position`} and `content`.
|
|
72
72
|
*/
|
|
73
73
|
export interface HtmlCommentData {
|
|
74
|
-
position:
|
|
74
|
+
position: ModelPosition;
|
|
75
75
|
content: string;
|
|
76
76
|
}
|
package/src/htmlcomment.js
CHANGED
|
@@ -9,7 +9,7 @@ import { uid } from 'ckeditor5/src/utils.js';
|
|
|
9
9
|
*
|
|
10
10
|
* For a detailed overview, check the {@glink features/html/html-comments HTML comment feature documentation}.
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export class HtmlComment extends Plugin {
|
|
13
13
|
/**
|
|
14
14
|
* @inheritDoc
|
|
15
15
|
*/
|
|
@@ -10,7 +10,7 @@ import { HtmlDataProcessor, type ViewDocumentFragment } from 'ckeditor5/src/engi
|
|
|
10
10
|
* The full page HTML data processor class.
|
|
11
11
|
* This data processor implementation uses HTML as input and output data.
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export declare class HtmlPageDataProcessor extends HtmlDataProcessor {
|
|
14
14
|
/**
|
|
15
15
|
* @inheritDoc
|
|
16
16
|
*/
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module html-support/htmlpagedataprocessor
|
|
7
7
|
*/
|
|
8
|
-
import { HtmlDataProcessor,
|
|
8
|
+
import { HtmlDataProcessor, ViewUpcastWriter } from 'ckeditor5/src/engine.js';
|
|
9
9
|
/**
|
|
10
10
|
* The full page HTML data processor class.
|
|
11
11
|
* This data processor implementation uses HTML as input and output data.
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export class HtmlPageDataProcessor extends HtmlDataProcessor {
|
|
14
14
|
/**
|
|
15
15
|
* @inheritDoc
|
|
16
16
|
*/
|
|
@@ -34,7 +34,7 @@ export default class HtmlPageDataProcessor extends HtmlDataProcessor {
|
|
|
34
34
|
const domFragment = this._toDom(data);
|
|
35
35
|
// Convert DOM DocumentFragment to view DocumentFragment.
|
|
36
36
|
const viewFragment = this.domConverter.domToView(domFragment, { skipComments: this.skipComments });
|
|
37
|
-
const writer = new
|
|
37
|
+
const writer = new ViewUpcastWriter(viewFragment.document);
|
|
38
38
|
// Using the DOM document with body content extracted as a skeleton of the page.
|
|
39
39
|
writer.setCustomProperty('$fullPageDocument', domFragment.ownerDocument.documentElement.outerHTML, viewFragment);
|
|
40
40
|
// List of `<style>` elements extracted from document's `<head>` element.
|
package/src/index.d.ts
CHANGED
|
@@ -5,23 +5,27 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module html-support
|
|
7
7
|
*/
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export type { GeneralHtmlSupportConfig } from './generalhtmlsupportconfig.js';
|
|
16
|
-
export type {
|
|
17
|
-
export type {
|
|
18
|
-
export type {
|
|
19
|
-
export type {
|
|
20
|
-
export type {
|
|
21
|
-
export type {
|
|
22
|
-
export type {
|
|
23
|
-
export type {
|
|
24
|
-
export type {
|
|
25
|
-
export type {
|
|
26
|
-
export type {
|
|
8
|
+
export { GeneralHtmlSupport } from './generalhtmlsupport.js';
|
|
9
|
+
export { DataFilter, type HtmlSupportDataFilterRegisterEvent } from './datafilter.js';
|
|
10
|
+
export { DataSchema, type HtmlSupportDataSchemaBlockElementDefinition, type HtmlSupportDataSchemaDefinition, type HtmlSupportDataSchemaInlineElementDefinition } from './dataschema.js';
|
|
11
|
+
export { HtmlComment, type HtmlCommentData } from './htmlcomment.js';
|
|
12
|
+
export { FullPage } from './fullpage.js';
|
|
13
|
+
export { HtmlPageDataProcessor } from './htmlpagedataprocessor.js';
|
|
14
|
+
export { EmptyBlock } from './emptyblock.js';
|
|
15
|
+
export type { GeneralHtmlSupportConfig, GHSFullPageConfig, GHSCssSanitizeOutput } from './generalhtmlsupportconfig.js';
|
|
16
|
+
export type { CodeBlockElementSupport } from './integrations/codeblock.js';
|
|
17
|
+
export type { CustomElementSupport } from './integrations/customelement.js';
|
|
18
|
+
export type { ListElementSupport } from './integrations/list.js';
|
|
19
|
+
export type { DualContentModelElementSupport } from './integrations/dualcontent.js';
|
|
20
|
+
export type { HeadingElementSupport } from './integrations/heading.js';
|
|
21
|
+
export type { ImageElementSupport } from './integrations/image.js';
|
|
22
|
+
export type { MediaEmbedElementSupport } from './integrations/mediaembed.js';
|
|
23
|
+
export type { ScriptElementSupport } from './integrations/script.js';
|
|
24
|
+
export type { StyleElementSupport } from './integrations/style.js';
|
|
25
|
+
export type { TableElementSupport } from './integrations/table.js';
|
|
26
|
+
export type { HorizontalLineElementSupport } from './integrations/horizontalline.js';
|
|
27
|
+
export { viewToModelObjectConverter as _viewToModelObjectContentHtmlSupportConverter, toObjectWidgetConverter as _toObjectWidgetHtmlSupportConverter, createObjectView as _createObjectHtmlSupportView, viewToAttributeInlineConverter as _viewToAttributeInlineHtmlSupportConverter, emptyInlineModelElementToViewConverter as _emptyInlineModelElementToViewHtmlSupportConverter, attributeToViewInlineConverter as _attributeToInlineHtmlSupportConverter, viewToModelBlockAttributeConverter as _viewToModelBlockAttributeHtmlSupportConverter, modelToViewBlockAttributeConverter as _modelToViewBlockAttributeHtmlSupportConverter } from './converters.js';
|
|
28
|
+
export { getDescendantElement as _getHtmlSupportDescendantElement } from './integrations/integrationutils.js';
|
|
29
|
+
export { defaultConfig as _HTML_SUPPORT_SCHEMA_DEFINITIONS } from './schemadefinitions.js';
|
|
30
|
+
export { updateViewAttributes as _updateHtmlSupportViewAttributes, setViewAttributes as _setHtmlSupportViewAttributes, removeViewAttributes as _removeHtmlSupportViewAttributes, mergeViewElementAttributes as _mergeHtmlSupportViewElementAttributes, modifyGhsAttribute as _modifyHtmlSupportGhsAttribute, toPascalCase as _toHtmlSupportPascalCase, getHtmlAttributeName as _getHtmlSupportAttributeName, type GHSViewAttributes } from './utils.js';
|
|
27
31
|
import './augmentation.js';
|
package/src/index.js
CHANGED
|
@@ -5,11 +5,15 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module html-support
|
|
7
7
|
*/
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
8
|
+
export { GeneralHtmlSupport } from './generalhtmlsupport.js';
|
|
9
|
+
export { DataFilter } from './datafilter.js';
|
|
10
|
+
export { DataSchema } from './dataschema.js';
|
|
11
|
+
export { HtmlComment } from './htmlcomment.js';
|
|
12
|
+
export { FullPage } from './fullpage.js';
|
|
13
|
+
export { HtmlPageDataProcessor } from './htmlpagedataprocessor.js';
|
|
14
|
+
export { EmptyBlock } from './emptyblock.js';
|
|
15
|
+
export { viewToModelObjectConverter as _viewToModelObjectContentHtmlSupportConverter, toObjectWidgetConverter as _toObjectWidgetHtmlSupportConverter, createObjectView as _createObjectHtmlSupportView, viewToAttributeInlineConverter as _viewToAttributeInlineHtmlSupportConverter, emptyInlineModelElementToViewConverter as _emptyInlineModelElementToViewHtmlSupportConverter, attributeToViewInlineConverter as _attributeToInlineHtmlSupportConverter, viewToModelBlockAttributeConverter as _viewToModelBlockAttributeHtmlSupportConverter, modelToViewBlockAttributeConverter as _modelToViewBlockAttributeHtmlSupportConverter } from './converters.js';
|
|
16
|
+
export { getDescendantElement as _getHtmlSupportDescendantElement } from './integrations/integrationutils.js';
|
|
17
|
+
export { defaultConfig as _HTML_SUPPORT_SCHEMA_DEFINITIONS } from './schemadefinitions.js';
|
|
18
|
+
export { updateViewAttributes as _updateHtmlSupportViewAttributes, setViewAttributes as _setHtmlSupportViewAttributes, removeViewAttributes as _removeHtmlSupportViewAttributes, mergeViewElementAttributes as _mergeHtmlSupportViewElementAttributes, modifyGhsAttribute as _modifyHtmlSupportGhsAttribute, toPascalCase as _toHtmlSupportPascalCase, getHtmlAttributeName as _getHtmlSupportAttributeName } from './utils.js';
|
|
15
19
|
import './augmentation.js';
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
5
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
6
|
-
import DataFilter from '../datafilter.js';
|
|
6
|
+
import { DataFilter } from '../datafilter.js';
|
|
7
7
|
/**
|
|
8
8
|
* Provides the General HTML Support integration with {@link module:code-block/codeblock~CodeBlock Code Block} feature.
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export declare class CodeBlockElementSupport extends Plugin {
|
|
11
11
|
/**
|
|
12
12
|
* @inheritDoc
|
|
13
13
|
*/
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
6
6
|
import { updateViewAttributes } from '../utils.js';
|
|
7
|
-
import DataFilter from '../datafilter.js';
|
|
7
|
+
import { DataFilter } from '../datafilter.js';
|
|
8
8
|
/**
|
|
9
9
|
* Provides the General HTML Support integration with {@link module:code-block/codeblock~CodeBlock Code Block} feature.
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
11
|
+
export class CodeBlockElementSupport extends Plugin {
|
|
12
12
|
/**
|
|
13
13
|
* @inheritDoc
|
|
14
14
|
*/
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
* @module html-support/integrations/customelement
|
|
7
7
|
*/
|
|
8
8
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import DataSchema from '../dataschema.js';
|
|
10
|
-
import DataFilter from '../datafilter.js';
|
|
9
|
+
import { DataSchema } from '../dataschema.js';
|
|
10
|
+
import { DataFilter } from '../datafilter.js';
|
|
11
11
|
/**
|
|
12
12
|
* Provides the General HTML Support for custom elements (not registered in the {@link module:html-support/dataschema~DataSchema}).
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export declare class CustomElementSupport extends Plugin {
|
|
15
15
|
/**
|
|
16
16
|
* @inheritDoc
|
|
17
17
|
*/
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
* @module html-support/integrations/customelement
|
|
7
7
|
*/
|
|
8
8
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import {
|
|
10
|
-
import DataSchema from '../dataschema.js';
|
|
11
|
-
import DataFilter from '../datafilter.js';
|
|
9
|
+
import { ViewUpcastWriter } from 'ckeditor5/src/engine.js';
|
|
10
|
+
import { DataSchema } from '../dataschema.js';
|
|
11
|
+
import { DataFilter } from '../datafilter.js';
|
|
12
12
|
import { setViewAttributes } from '../utils.js';
|
|
13
13
|
/**
|
|
14
14
|
* Provides the General HTML Support for custom elements (not registered in the {@link module:html-support/dataschema~DataSchema}).
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export class CustomElementSupport extends Plugin {
|
|
17
17
|
/**
|
|
18
18
|
* @inheritDoc
|
|
19
19
|
*/
|
|
@@ -91,8 +91,9 @@ export default class CustomElementSupport extends Plugin {
|
|
|
91
91
|
htmlContent = viewElement.getCustomProperty('$rawContent');
|
|
92
92
|
}
|
|
93
93
|
else {
|
|
94
|
-
// Store the whole element in the attribute so that
|
|
95
|
-
|
|
94
|
+
// Store the whole element in the attribute so that ViewDomConverter
|
|
95
|
+
// will be able to use the pre like element context.
|
|
96
|
+
const viewWriter = new ViewUpcastWriter(viewElement.document);
|
|
96
97
|
const documentFragment = viewWriter.createDocumentFragment(viewElement);
|
|
97
98
|
const domFragment = editor.data.htmlProcessor.domConverter.viewToDom(documentFragment);
|
|
98
99
|
const domElement = domFragment.firstChild;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
5
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
6
|
-
import DataFilter from '../datafilter.js';
|
|
6
|
+
import { DataFilter } from '../datafilter.js';
|
|
7
7
|
/**
|
|
8
8
|
* Provides the General HTML Support integration for elements which can behave like sectioning element (e.g. article) or
|
|
9
9
|
* element accepting only inline content (e.g. paragraph).
|
|
@@ -16,12 +16,13 @@ import DataFilter from '../datafilter.js';
|
|
|
16
16
|
* * model element HTML is semantically correct and easier to work with.
|
|
17
17
|
*
|
|
18
18
|
* If element contains any block element, it will be treated as a sectioning element and registered using
|
|
19
|
-
* {@link module:html-support/dataschema~
|
|
20
|
-
* {@link module:html-support/dataschema~
|
|
21
|
-
* Otherwise, it will be registered under
|
|
19
|
+
* {@link module:html-support/dataschema~HtmlSupportDataSchemaDefinition#model} and
|
|
20
|
+
* {@link module:html-support/dataschema~HtmlSupportDataSchemaDefinition#modelSchema} in editor schema.
|
|
21
|
+
* Otherwise, it will be registered under
|
|
22
|
+
* {@link module:html-support/dataschema~HtmlSupportDataSchemaBlockElementDefinition#paragraphLikeModel} model
|
|
22
23
|
* name with model schema accepting only inline content (inheriting from `$block`).
|
|
23
24
|
*/
|
|
24
|
-
export
|
|
25
|
+
export declare class DualContentModelElementSupport extends Plugin {
|
|
25
26
|
/**
|
|
26
27
|
* @inheritDoc
|
|
27
28
|
*/
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
6
6
|
import { priorities } from 'ckeditor5/src/utils.js';
|
|
7
7
|
import { modelToViewBlockAttributeConverter, viewToModelBlockAttributeConverter } from '../converters.js';
|
|
8
|
-
import DataFilter from '../datafilter.js';
|
|
8
|
+
import { DataFilter } from '../datafilter.js';
|
|
9
9
|
import { getHtmlAttributeName } from '../utils.js';
|
|
10
10
|
/**
|
|
11
11
|
* Provides the General HTML Support integration for elements which can behave like sectioning element (e.g. article) or
|
|
@@ -19,12 +19,13 @@ import { getHtmlAttributeName } from '../utils.js';
|
|
|
19
19
|
* * model element HTML is semantically correct and easier to work with.
|
|
20
20
|
*
|
|
21
21
|
* If element contains any block element, it will be treated as a sectioning element and registered using
|
|
22
|
-
* {@link module:html-support/dataschema~
|
|
23
|
-
* {@link module:html-support/dataschema~
|
|
24
|
-
* Otherwise, it will be registered under
|
|
22
|
+
* {@link module:html-support/dataschema~HtmlSupportDataSchemaDefinition#model} and
|
|
23
|
+
* {@link module:html-support/dataschema~HtmlSupportDataSchemaDefinition#modelSchema} in editor schema.
|
|
24
|
+
* Otherwise, it will be registered under
|
|
25
|
+
* {@link module:html-support/dataschema~HtmlSupportDataSchemaBlockElementDefinition#paragraphLikeModel} model
|
|
25
26
|
* name with model schema accepting only inline content (inheriting from `$block`).
|
|
26
27
|
*/
|
|
27
|
-
export
|
|
28
|
+
export class DualContentModelElementSupport extends Plugin {
|
|
28
29
|
/**
|
|
29
30
|
* @inheritDoc
|
|
30
31
|
*/
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
9
|
import { Enter } from 'ckeditor5/src/enter.js';
|
|
10
|
-
import DataSchema from '../dataschema.js';
|
|
10
|
+
import { DataSchema } from '../dataschema.js';
|
|
11
11
|
/**
|
|
12
12
|
* Provides the General HTML Support integration with {@link module:heading/heading~Heading Heading} feature.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export declare class HeadingElementSupport extends Plugin {
|
|
15
15
|
/**
|
|
16
16
|
* @inheritDoc
|
|
17
17
|
*/
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
9
|
import { Enter } from 'ckeditor5/src/enter.js';
|
|
10
|
-
import DataSchema from '../dataschema.js';
|
|
10
|
+
import { DataSchema } from '../dataschema.js';
|
|
11
11
|
/**
|
|
12
12
|
* Provides the General HTML Support integration with {@link module:heading/heading~Heading Heading} feature.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export class HeadingElementSupport extends Plugin {
|
|
15
15
|
/**
|
|
16
16
|
* @inheritDoc
|
|
17
17
|
*/
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* @module html-support/integrations/horizontalline
|
|
7
7
|
*/
|
|
8
8
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import DataFilter from '../datafilter.js';
|
|
9
|
+
import { DataFilter } from '../datafilter.js';
|
|
10
10
|
/**
|
|
11
11
|
* Provides the General HTML Support integration with the {@link module:horizontal-line/horizontalline~HorizontalLine} feature.
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export declare class HorizontalLineElementSupport extends Plugin {
|
|
14
14
|
/**
|
|
15
15
|
* @inheritDoc
|
|
16
16
|
*/
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
* @module html-support/integrations/horizontalline
|
|
7
7
|
*/
|
|
8
8
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import DataFilter from '../datafilter.js';
|
|
9
|
+
import { DataFilter } from '../datafilter.js';
|
|
10
10
|
import { updateViewAttributes } from '../utils.js';
|
|
11
11
|
import { getDescendantElement } from './integrationutils.js';
|
|
12
12
|
import { viewToModelBlockAttributeConverter } from '../converters.js';
|
|
13
13
|
/**
|
|
14
14
|
* Provides the General HTML Support integration with the {@link module:horizontal-line/horizontalline~HorizontalLine} feature.
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export class HorizontalLineElementSupport extends Plugin {
|
|
17
17
|
/**
|
|
18
18
|
* @inheritDoc
|
|
19
19
|
*/
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* @module html-support/integrations/image
|
|
7
7
|
*/
|
|
8
8
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import DataFilter from '../datafilter.js';
|
|
9
|
+
import { DataFilter } from '../datafilter.js';
|
|
10
10
|
/**
|
|
11
11
|
* Provides the General HTML Support integration with the {@link module:image/image~Image Image} feature.
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export declare class ImageElementSupport extends Plugin {
|
|
14
14
|
/**
|
|
15
15
|
* @inheritDoc
|
|
16
16
|
*/
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
* @module html-support/integrations/image
|
|
7
7
|
*/
|
|
8
8
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import DataFilter from '../datafilter.js';
|
|
9
|
+
import { DataFilter } from '../datafilter.js';
|
|
10
10
|
import { setViewAttributes, updateViewAttributes } from '../utils.js';
|
|
11
11
|
import { getDescendantElement } from './integrationutils.js';
|
|
12
12
|
/**
|
|
13
13
|
* Provides the General HTML Support integration with the {@link module:image/image~Image Image} feature.
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export class ImageElementSupport extends Plugin {
|
|
16
16
|
/**
|
|
17
17
|
* @inheritDoc
|
|
18
18
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
|
-
import type {
|
|
5
|
+
import type { ViewDowncastWriter, ViewElement } from 'ckeditor5/src/engine.js';
|
|
6
6
|
/**
|
|
7
7
|
* @module html-support/integrations/integrationutils
|
|
8
8
|
*/
|
|
@@ -12,4 +12,4 @@ import type { DowncastWriter, ViewElement } from 'ckeditor5/src/engine.js';
|
|
|
12
12
|
*
|
|
13
13
|
* @internal
|
|
14
14
|
*/
|
|
15
|
-
export declare function getDescendantElement(writer:
|
|
15
|
+
export declare function getDescendantElement(writer: ViewDowncastWriter, containerElement: ViewElement, elementName: string): ViewElement | undefined;
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
5
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
6
|
-
import DataFilter from '../datafilter.js';
|
|
6
|
+
import { DataFilter } from '../datafilter.js';
|
|
7
7
|
/**
|
|
8
8
|
* Provides the General HTML Support integration with the {@link module:list/list~List List} feature.
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export declare class ListElementSupport extends Plugin {
|
|
11
11
|
/**
|
|
12
12
|
* @inheritDoc
|
|
13
13
|
*/
|
package/src/integrations/list.js
CHANGED
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
import { isEqual } from 'es-toolkit/compat';
|
|
9
9
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
10
10
|
import { getHtmlAttributeName, setViewAttributes } from '../utils.js';
|
|
11
|
-
import DataFilter from '../datafilter.js';
|
|
11
|
+
import { DataFilter } from '../datafilter.js';
|
|
12
12
|
/**
|
|
13
13
|
* Provides the General HTML Support integration with the {@link module:list/list~List List} feature.
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export class ListElementSupport extends Plugin {
|
|
16
16
|
/**
|
|
17
17
|
* @inheritDoc
|
|
18
18
|
*/
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* @module html-support/integrations/mediaembed
|
|
7
7
|
*/
|
|
8
8
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import DataFilter from '../datafilter.js';
|
|
9
|
+
import { DataFilter } from '../datafilter.js';
|
|
10
10
|
/**
|
|
11
11
|
* Provides the General HTML Support integration with {@link module:media-embed/mediaembed~MediaEmbed Media Embed} feature.
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export declare class MediaEmbedElementSupport extends Plugin {
|
|
14
14
|
/**
|
|
15
15
|
* @inheritDoc
|
|
16
16
|
*/
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
* @module html-support/integrations/mediaembed
|
|
7
7
|
*/
|
|
8
8
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import DataFilter from '../datafilter.js';
|
|
10
|
-
import DataSchema from '../dataschema.js';
|
|
9
|
+
import { DataFilter } from '../datafilter.js';
|
|
10
|
+
import { DataSchema } from '../dataschema.js';
|
|
11
11
|
import { updateViewAttributes, getHtmlAttributeName } from '../utils.js';
|
|
12
12
|
import { getDescendantElement } from './integrationutils.js';
|
|
13
13
|
/**
|
|
14
14
|
* Provides the General HTML Support integration with {@link module:media-embed/mediaembed~MediaEmbed Media Embed} feature.
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export class MediaEmbedElementSupport extends Plugin {
|
|
17
17
|
/**
|
|
18
18
|
* @inheritDoc
|
|
19
19
|
*/
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* @module html-support/integrations/script
|
|
7
7
|
*/
|
|
8
8
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import DataFilter from '../datafilter.js';
|
|
9
|
+
import { DataFilter } from '../datafilter.js';
|
|
10
10
|
/**
|
|
11
11
|
* Provides the General HTML Support for `script` elements.
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export declare class ScriptElementSupport extends Plugin {
|
|
14
14
|
/**
|
|
15
15
|
* @inheritDoc
|
|
16
16
|
*/
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
9
|
import { createObjectView, modelToViewBlockAttributeConverter, viewToModelBlockAttributeConverter, viewToModelObjectConverter } from '../converters.js';
|
|
10
|
-
import DataFilter from '../datafilter.js';
|
|
10
|
+
import { DataFilter } from '../datafilter.js';
|
|
11
11
|
/**
|
|
12
12
|
* Provides the General HTML Support for `script` elements.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export class ScriptElementSupport extends Plugin {
|
|
15
15
|
/**
|
|
16
16
|
* @inheritDoc
|
|
17
17
|
*/
|
|
@@ -58,7 +58,8 @@ export default class ScriptElementSupport extends Plugin {
|
|
|
58
58
|
return createObjectView('script', modelElement, writer);
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
|
-
conversion.for('downcast')
|
|
61
|
+
conversion.for('downcast')
|
|
62
|
+
.add(modelToViewBlockAttributeConverter(definition));
|
|
62
63
|
evt.stop();
|
|
63
64
|
});
|
|
64
65
|
}
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* @module html-support/integrations/style
|
|
7
7
|
*/
|
|
8
8
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import DataFilter from '../datafilter.js';
|
|
9
|
+
import { DataFilter } from '../datafilter.js';
|
|
10
10
|
/**
|
|
11
11
|
* Provides the General HTML Support for `style` elements.
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export declare class StyleElementSupport extends Plugin {
|
|
14
14
|
/**
|
|
15
15
|
* @inheritDoc
|
|
16
16
|
*/
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
9
|
import { createObjectView, modelToViewBlockAttributeConverter, viewToModelBlockAttributeConverter, viewToModelObjectConverter } from '../converters.js';
|
|
10
|
-
import DataFilter from '../datafilter.js';
|
|
10
|
+
import { DataFilter } from '../datafilter.js';
|
|
11
11
|
/**
|
|
12
12
|
* Provides the General HTML Support for `style` elements.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export class StyleElementSupport extends Plugin {
|
|
15
15
|
/**
|
|
16
16
|
* @inheritDoc
|
|
17
17
|
*/
|
|
@@ -58,7 +58,8 @@ export default class StyleElementSupport extends Plugin {
|
|
|
58
58
|
return createObjectView('style', modelElement, writer);
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
|
-
conversion.for('downcast')
|
|
61
|
+
conversion.for('downcast')
|
|
62
|
+
.add(modelToViewBlockAttributeConverter(definition));
|
|
62
63
|
evt.stop();
|
|
63
64
|
});
|
|
64
65
|
}
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
5
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
6
|
-
import DataFilter from '../datafilter.js';
|
|
6
|
+
import { DataFilter } from '../datafilter.js';
|
|
7
7
|
/**
|
|
8
8
|
* Provides the General HTML Support integration with {@link module:table/table~Table Table} feature.
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export declare class TableElementSupport extends Plugin {
|
|
11
11
|
/**
|
|
12
12
|
* @inheritDoc
|
|
13
13
|
*/
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
6
6
|
import { updateViewAttributes } from '../utils.js';
|
|
7
|
-
import DataFilter from '../datafilter.js';
|
|
7
|
+
import { DataFilter } from '../datafilter.js';
|
|
8
8
|
import { getDescendantElement } from './integrationutils.js';
|
|
9
9
|
const STYLE_ATTRIBUTES_TO_PROPAGATE = [
|
|
10
10
|
'width',
|
|
@@ -17,7 +17,7 @@ const STYLE_ATTRIBUTES_TO_PROPAGATE = [
|
|
|
17
17
|
/**
|
|
18
18
|
* Provides the General HTML Support integration with {@link module:table/table~Table Table} feature.
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
20
|
+
export class TableElementSupport extends Plugin {
|
|
21
21
|
/**
|
|
22
22
|
* @inheritDoc
|
|
23
23
|
*/
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
|
-
import type {
|
|
5
|
+
import type { HtmlSupportDataSchemaBlockElementDefinition, HtmlSupportDataSchemaInlineElementDefinition } from './dataschema.js';
|
|
6
6
|
/**
|
|
7
7
|
* @module html-support/schemadefinitions
|
|
8
8
|
*/
|
|
9
|
-
declare const
|
|
10
|
-
block:
|
|
11
|
-
inline:
|
|
9
|
+
export declare const defaultConfig: {
|
|
10
|
+
block: HtmlSupportDataSchemaBlockElementDefinition[];
|
|
11
|
+
inline: HtmlSupportDataSchemaInlineElementDefinition[];
|
|
12
12
|
};
|
|
13
|
-
export default _default;
|
package/src/schemadefinitions.js
CHANGED
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
// noscript
|
|
47
47
|
//
|
|
48
48
|
// When adding elements to this list, update the feature guide listing, too.
|
|
49
|
-
export
|
|
49
|
+
export const defaultConfig = {
|
|
50
50
|
block: [
|
|
51
51
|
// Existing features.
|
|
52
52
|
{
|
|
@@ -690,7 +690,10 @@ export default {
|
|
|
690
690
|
model: 'htmlA',
|
|
691
691
|
view: 'a',
|
|
692
692
|
priority: 5,
|
|
693
|
-
coupledAttribute: 'linkHref'
|
|
693
|
+
coupledAttribute: 'linkHref',
|
|
694
|
+
attributeProperties: {
|
|
695
|
+
isFormatting: true
|
|
696
|
+
}
|
|
694
697
|
},
|
|
695
698
|
{
|
|
696
699
|
model: 'htmlStrong',
|