@ckeditor/ckeditor5-html-support 40.1.0 → 41.0.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/LICENSE.md +1 -1
- package/build/html-support.js +2 -2
- package/lang/translations/ar.po +1 -1
- package/lang/translations/bg.po +1 -1
- package/lang/translations/bn.po +1 -1
- package/lang/translations/ca.po +1 -1
- package/lang/translations/cs.po +1 -1
- package/lang/translations/da.po +1 -1
- package/lang/translations/de.po +1 -1
- package/lang/translations/el.po +1 -1
- package/lang/translations/en-au.po +1 -1
- package/lang/translations/en.po +1 -1
- package/lang/translations/es.po +1 -1
- package/lang/translations/et.po +1 -1
- package/lang/translations/fi.po +1 -1
- package/lang/translations/fr.po +1 -1
- package/lang/translations/gl.po +1 -1
- package/lang/translations/he.po +1 -1
- package/lang/translations/hi.po +1 -1
- package/lang/translations/hr.po +1 -1
- package/lang/translations/hu.po +1 -1
- package/lang/translations/id.po +1 -1
- package/lang/translations/it.po +1 -1
- package/lang/translations/ja.po +1 -1
- package/lang/translations/jv.po +1 -1
- package/lang/translations/ko.po +1 -1
- package/lang/translations/lt.po +1 -1
- package/lang/translations/lv.po +1 -1
- package/lang/translations/ms.po +1 -1
- package/lang/translations/nl.po +1 -1
- package/lang/translations/no.po +1 -1
- package/lang/translations/pl.po +1 -1
- package/lang/translations/pt-br.po +1 -1
- package/lang/translations/pt.po +1 -1
- package/lang/translations/ro.po +1 -1
- package/lang/translations/ru.po +1 -1
- package/lang/translations/sk.po +1 -1
- package/lang/translations/sr-latn.po +1 -1
- package/lang/translations/sr.po +1 -1
- package/lang/translations/sv.po +1 -1
- package/lang/translations/th.po +1 -1
- package/lang/translations/tr.po +1 -1
- package/lang/translations/ug.po +1 -1
- package/lang/translations/uk.po +1 -1
- package/lang/translations/ur.po +1 -1
- package/lang/translations/vi.po +1 -1
- package/lang/translations/zh-cn.po +1 -1
- package/lang/translations/zh.po +1 -1
- package/package.json +3 -2
- package/src/augmentation.d.ts +3 -3
- package/src/augmentation.js +1 -1
- package/src/converters.d.ts +5 -5
- package/src/converters.js +3 -3
- package/src/datafilter.d.ts +6 -6
- package/src/datafilter.js +38 -9
- package/src/dataschema.d.ts +3 -3
- package/src/dataschema.js +4 -4
- package/src/fullpage.d.ts +2 -2
- package/src/fullpage.js +4 -4
- package/src/generalhtmlsupport.d.ts +16 -16
- package/src/generalhtmlsupport.js +16 -16
- package/src/generalhtmlsupportconfig.d.ts +2 -2
- package/src/generalhtmlsupportconfig.js +1 -1
- package/src/htmlcomment.d.ts +3 -3
- package/src/htmlcomment.js +3 -3
- package/src/htmlpagedataprocessor.d.ts +2 -2
- package/src/htmlpagedataprocessor.js +2 -2
- package/src/index.d.ts +19 -19
- package/src/index.js +8 -8
- package/src/integrations/codeblock.d.ts +3 -3
- package/src/integrations/codeblock.js +4 -4
- package/src/integrations/customelement.d.ts +4 -4
- package/src/integrations/customelement.js +27 -17
- package/src/integrations/dualcontent.d.ts +3 -3
- package/src/integrations/dualcontent.js +6 -6
- package/src/integrations/heading.d.ts +4 -4
- package/src/integrations/heading.js +4 -4
- package/src/integrations/image.d.ts +3 -3
- package/src/integrations/image.js +5 -5
- package/src/integrations/integrationutils.d.ts +2 -2
- package/src/integrations/integrationutils.js +1 -1
- package/src/integrations/{documentlist.d.ts → list.d.ts} +6 -6
- package/src/integrations/{documentlist.js → list.js} +15 -15
- package/src/integrations/mediaembed.d.ts +3 -3
- package/src/integrations/mediaembed.js +6 -6
- package/src/integrations/script.d.ts +3 -3
- package/src/integrations/script.js +4 -4
- package/src/integrations/style.d.ts +3 -3
- package/src/integrations/style.js +4 -4
- package/src/integrations/table.d.ts +3 -3
- package/src/integrations/table.js +5 -5
- package/src/schemadefinitions.d.ts +2 -2
- package/src/schemadefinitions.js +1 -1
- package/src/utils.d.ts +2 -2
- package/src/utils.js +1 -1
- package/theme/datafilter.css +1 -1
package/src/index.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module html-support
|
|
7
7
|
*/
|
|
8
|
-
export { default as GeneralHtmlSupport } from './generalhtmlsupport';
|
|
9
|
-
export { default as DataFilter } from './datafilter';
|
|
10
|
-
export { default as DataSchema, type DataSchemaBlockElementDefinition } from './dataschema';
|
|
11
|
-
export { default as HtmlComment } from './htmlcomment';
|
|
12
|
-
export { default as FullPage } from './fullpage';
|
|
13
|
-
export { default as HtmlPageDataProcessor } from './htmlpagedataprocessor';
|
|
14
|
-
export type { GeneralHtmlSupportConfig } from './generalhtmlsupportconfig';
|
|
15
|
-
export type { default as CodeBlockElementSupport } from './integrations/codeblock';
|
|
16
|
-
export type { default as CustomElementSupport } from './integrations/customelement';
|
|
17
|
-
export type { default as
|
|
18
|
-
export type { default as DualContentModelElementSupport } from './integrations/dualcontent';
|
|
19
|
-
export type { default as HeadingElementSupport } from './integrations/heading';
|
|
20
|
-
export type { default as ImageElementSupport } from './integrations/image';
|
|
21
|
-
export type { default as MediaEmbedElementSupport } from './integrations/mediaembed';
|
|
22
|
-
export type { default as ScriptElementSupport } from './integrations/script';
|
|
23
|
-
export type { default as StyleElementSupport } from './integrations/style';
|
|
24
|
-
export type { default as TableElementSupport } from './integrations/table';
|
|
25
|
-
import './augmentation';
|
|
8
|
+
export { default as GeneralHtmlSupport } from './generalhtmlsupport.js';
|
|
9
|
+
export { default as DataFilter } from './datafilter.js';
|
|
10
|
+
export { default as DataSchema, type DataSchemaBlockElementDefinition } from './dataschema.js';
|
|
11
|
+
export { default as HtmlComment } from './htmlcomment.js';
|
|
12
|
+
export { default as FullPage } from './fullpage.js';
|
|
13
|
+
export { default as HtmlPageDataProcessor } from './htmlpagedataprocessor.js';
|
|
14
|
+
export type { GeneralHtmlSupportConfig } from './generalhtmlsupportconfig.js';
|
|
15
|
+
export type { default as CodeBlockElementSupport } from './integrations/codeblock.js';
|
|
16
|
+
export type { default as CustomElementSupport } from './integrations/customelement.js';
|
|
17
|
+
export type { default as ListElementSupport } from './integrations/list.js';
|
|
18
|
+
export type { default as DualContentModelElementSupport } from './integrations/dualcontent.js';
|
|
19
|
+
export type { default as HeadingElementSupport } from './integrations/heading.js';
|
|
20
|
+
export type { default as ImageElementSupport } from './integrations/image.js';
|
|
21
|
+
export type { default as MediaEmbedElementSupport } from './integrations/mediaembed.js';
|
|
22
|
+
export type { default as ScriptElementSupport } from './integrations/script.js';
|
|
23
|
+
export type { default as StyleElementSupport } from './integrations/style.js';
|
|
24
|
+
export type { default as TableElementSupport } from './integrations/table.js';
|
|
25
|
+
import './augmentation.js';
|
package/src/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module html-support
|
|
7
7
|
*/
|
|
8
|
-
export { default as GeneralHtmlSupport } from './generalhtmlsupport';
|
|
9
|
-
export { default as DataFilter } from './datafilter';
|
|
10
|
-
export { default as DataSchema } from './dataschema';
|
|
11
|
-
export { default as HtmlComment } from './htmlcomment';
|
|
12
|
-
export { default as FullPage } from './fullpage';
|
|
13
|
-
export { default as HtmlPageDataProcessor } from './htmlpagedataprocessor';
|
|
14
|
-
import './augmentation';
|
|
8
|
+
export { default as GeneralHtmlSupport } from './generalhtmlsupport.js';
|
|
9
|
+
export { default as DataFilter } from './datafilter.js';
|
|
10
|
+
export { default as DataSchema } from './dataschema.js';
|
|
11
|
+
export { default as HtmlComment } from './htmlcomment.js';
|
|
12
|
+
export { default as FullPage } from './fullpage.js';
|
|
13
|
+
export { default as HtmlPageDataProcessor } from './htmlpagedataprocessor.js';
|
|
14
|
+
import './augmentation.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
6
|
-
import DataFilter from '../datafilter';
|
|
5
|
+
import { Plugin } from 'ckeditor5/src/core.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
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
6
|
-
import { updateViewAttributes } from '../utils';
|
|
7
|
-
import DataFilter from '../datafilter';
|
|
5
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
6
|
+
import { updateViewAttributes } from '../utils.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
|
*/
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module html-support/integrations/customelement
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import DataSchema from '../dataschema';
|
|
10
|
-
import DataFilter from '../datafilter';
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.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
|
*/
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module html-support/integrations/customelement
|
|
7
7
|
*/
|
|
8
8
|
/* globals document */
|
|
9
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
10
|
-
import { UpcastWriter } from 'ckeditor5/src/engine';
|
|
11
|
-
import DataSchema from '../dataschema';
|
|
12
|
-
import DataFilter from '../datafilter';
|
|
13
|
-
import { setViewAttributes } from '../utils';
|
|
9
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
10
|
+
import { UpcastWriter } from 'ckeditor5/src/engine.js';
|
|
11
|
+
import DataSchema from '../dataschema.js';
|
|
12
|
+
import DataFilter from '../datafilter.js';
|
|
13
|
+
import { setViewAttributes } from '../utils.js';
|
|
14
14
|
/**
|
|
15
15
|
* Provides the General HTML Support for custom elements (not registered in the {@link module:html-support/dataschema~DataSchema}).
|
|
16
16
|
*/
|
|
@@ -45,6 +45,9 @@ export default class CustomElementSupport extends Plugin {
|
|
|
45
45
|
allowAttributes: ['htmlElementName', 'htmlCustomElementAttributes', 'htmlContent'],
|
|
46
46
|
isContent: true
|
|
47
47
|
});
|
|
48
|
+
// For the `<template>` element we use only raw-content because DOM API exposes its content
|
|
49
|
+
// only as a document fragment in the `content` property (or innerHTML).
|
|
50
|
+
editor.data.htmlProcessor.domConverter.registerRawContentMatcher({ name: 'template' });
|
|
48
51
|
// Being executed on the low priority, it will catch all elements that were not caught by other converters.
|
|
49
52
|
conversion.for('upcast').elementToElement({
|
|
50
53
|
view: /.*/,
|
|
@@ -76,10 +79,24 @@ export default class CustomElementSupport extends Plugin {
|
|
|
76
79
|
if (htmlAttributes) {
|
|
77
80
|
conversionApi.writer.setAttribute('htmlCustomElementAttributes', htmlAttributes, modelElement);
|
|
78
81
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
let htmlContent;
|
|
83
|
+
// For the `<template>` element we use only raw-content because DOM API exposes its content
|
|
84
|
+
// only as a document fragment in the `content` property.
|
|
85
|
+
if (viewElement.is('element', 'template') && viewElement.getCustomProperty('$rawContent')) {
|
|
86
|
+
htmlContent = viewElement.getCustomProperty('$rawContent');
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
// Store the whole element in the attribute so that DomConverter will be able to use the pre like element context.
|
|
90
|
+
const viewWriter = new UpcastWriter(viewElement.document);
|
|
91
|
+
const documentFragment = viewWriter.createDocumentFragment(viewElement);
|
|
92
|
+
const domFragment = editor.data.htmlProcessor.domConverter.viewToDom(documentFragment);
|
|
93
|
+
const domElement = domFragment.firstChild;
|
|
94
|
+
while (domElement.firstChild) {
|
|
95
|
+
domFragment.appendChild(domElement.firstChild);
|
|
96
|
+
}
|
|
97
|
+
domElement.remove();
|
|
98
|
+
htmlContent = editor.data.htmlProcessor.htmlWriter.getHtml(domFragment);
|
|
99
|
+
}
|
|
83
100
|
conversionApi.writer.setAttribute('htmlContent', htmlContent, modelElement);
|
|
84
101
|
// Consume the content of the element.
|
|
85
102
|
for (const { item } of editor.editing.view.createRangeIn(viewElement)) {
|
|
@@ -115,13 +132,6 @@ export default class CustomElementSupport extends Plugin {
|
|
|
115
132
|
const htmlContent = modelElement.getAttribute('htmlContent');
|
|
116
133
|
const viewElement = writer.createRawElement(viewName, null, (domElement, domConverter) => {
|
|
117
134
|
domConverter.setContentOf(domElement, htmlContent);
|
|
118
|
-
// Unwrap the custom element content (it was stored in the attribute as the whole custom element).
|
|
119
|
-
// See the upcast conversion for the "htmlContent" attribute to learn more.
|
|
120
|
-
const customElement = domElement.firstChild;
|
|
121
|
-
customElement.remove();
|
|
122
|
-
while (customElement.firstChild) {
|
|
123
|
-
domElement.appendChild(customElement.firstChild);
|
|
124
|
-
}
|
|
125
135
|
});
|
|
126
136
|
if (modelElement.hasAttribute('htmlCustomElementAttributes')) {
|
|
127
137
|
setViewAttributes(writer, modelElement.getAttribute('htmlCustomElementAttributes'), viewElement);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
6
|
-
import DataFilter from '../datafilter';
|
|
5
|
+
import { Plugin } from 'ckeditor5/src/core.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).
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
6
|
-
import { priorities } from 'ckeditor5/src/utils';
|
|
7
|
-
import { modelToViewBlockAttributeConverter, viewToModelBlockAttributeConverter } from '../converters';
|
|
8
|
-
import DataFilter from '../datafilter';
|
|
9
|
-
import { getHtmlAttributeName } from '../utils';
|
|
5
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
6
|
+
import { priorities } from 'ckeditor5/src/utils.js';
|
|
7
|
+
import { modelToViewBlockAttributeConverter, viewToModelBlockAttributeConverter } from '../converters.js';
|
|
8
|
+
import DataFilter from '../datafilter.js';
|
|
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
|
|
12
12
|
* element accepting only inline content (e.g. paragraph).
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module html-support/integrations/heading
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import { Enter } from 'ckeditor5/src/enter';
|
|
10
|
-
import DataSchema from '../dataschema';
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import { Enter } from 'ckeditor5/src/enter.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
|
*/
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module html-support/integrations/heading
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import { Enter } from 'ckeditor5/src/enter';
|
|
10
|
-
import DataSchema from '../dataschema';
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import { Enter } from 'ckeditor5/src/enter.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
|
*/
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module html-support/integrations/image
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import DataFilter from '../datafilter';
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.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
|
*/
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module html-support/integrations/image
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import DataFilter from '../datafilter';
|
|
10
|
-
import { setViewAttributes, updateViewAttributes } from '../utils';
|
|
11
|
-
import { getDescendantElement } from './integrationutils';
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import DataFilter from '../datafilter.js';
|
|
10
|
+
import { setViewAttributes, updateViewAttributes } from '../utils.js';
|
|
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
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
import type { DowncastWriter, ViewElement } from 'ckeditor5/src/engine';
|
|
5
|
+
import type { DowncastWriter, ViewElement } from 'ckeditor5/src/engine.js';
|
|
6
6
|
/**
|
|
7
7
|
* @module html-support/integrations/integrationutils
|
|
8
8
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
6
|
-
import DataFilter from '../datafilter';
|
|
5
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
6
|
+
import DataFilter from '../datafilter.js';
|
|
7
7
|
/**
|
|
8
|
-
* Provides the General HTML Support integration with the {@link module:list/
|
|
8
|
+
* Provides the General HTML Support integration with the {@link module:list/list~List List} feature.
|
|
9
9
|
*/
|
|
10
|
-
export default class
|
|
10
|
+
export default class ListElementSupport extends Plugin {
|
|
11
11
|
/**
|
|
12
12
|
* @inheritDoc
|
|
13
13
|
*/
|
|
@@ -15,7 +15,7 @@ export default class DocumentListElementSupport extends Plugin {
|
|
|
15
15
|
/**
|
|
16
16
|
* @inheritDoc
|
|
17
17
|
*/
|
|
18
|
-
static get pluginName(): "
|
|
18
|
+
static get pluginName(): "ListElementSupport";
|
|
19
19
|
/**
|
|
20
20
|
* @inheritDoc
|
|
21
21
|
*/
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
-
* @module html-support/integrations/
|
|
6
|
+
* @module html-support/integrations/list
|
|
7
7
|
*/
|
|
8
8
|
import { isEqual } from 'lodash-es';
|
|
9
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
10
|
-
import { getHtmlAttributeName, setViewAttributes } from '../utils';
|
|
11
|
-
import DataFilter from '../datafilter';
|
|
9
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
10
|
+
import { getHtmlAttributeName, setViewAttributes } from '../utils.js';
|
|
11
|
+
import DataFilter from '../datafilter.js';
|
|
12
12
|
/**
|
|
13
|
-
* Provides the General HTML Support integration with the {@link module:list/
|
|
13
|
+
* Provides the General HTML Support integration with the {@link module:list/list~List List} feature.
|
|
14
14
|
*/
|
|
15
|
-
export default class
|
|
15
|
+
export default class ListElementSupport extends Plugin {
|
|
16
16
|
/**
|
|
17
17
|
* @inheritDoc
|
|
18
18
|
*/
|
|
@@ -23,34 +23,34 @@ export default class DocumentListElementSupport extends Plugin {
|
|
|
23
23
|
* @inheritDoc
|
|
24
24
|
*/
|
|
25
25
|
static get pluginName() {
|
|
26
|
-
return '
|
|
26
|
+
return 'ListElementSupport';
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* @inheritDoc
|
|
30
30
|
*/
|
|
31
31
|
init() {
|
|
32
32
|
const editor = this.editor;
|
|
33
|
-
if (!editor.plugins.has('
|
|
33
|
+
if (!editor.plugins.has('ListEditing')) {
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
36
|
const schema = editor.model.schema;
|
|
37
37
|
const conversion = editor.conversion;
|
|
38
38
|
const dataFilter = editor.plugins.get(DataFilter);
|
|
39
|
-
const
|
|
39
|
+
const listEditing = editor.plugins.get('ListEditing');
|
|
40
40
|
const viewElements = ['ul', 'ol', 'li'];
|
|
41
41
|
// Register downcast strategy.
|
|
42
42
|
// Note that this must be done before document list editing registers conversion in afterInit.
|
|
43
|
-
|
|
43
|
+
listEditing.registerDowncastStrategy({
|
|
44
44
|
scope: 'item',
|
|
45
45
|
attributeName: 'htmlLiAttributes',
|
|
46
46
|
setAttributeOnDowncast: setViewAttributes
|
|
47
47
|
});
|
|
48
|
-
|
|
48
|
+
listEditing.registerDowncastStrategy({
|
|
49
49
|
scope: 'list',
|
|
50
50
|
attributeName: 'htmlUlAttributes',
|
|
51
51
|
setAttributeOnDowncast: setViewAttributes
|
|
52
52
|
});
|
|
53
|
-
|
|
53
|
+
listEditing.registerDowncastStrategy({
|
|
54
54
|
scope: 'list',
|
|
55
55
|
attributeName: 'htmlOlAttributes',
|
|
56
56
|
setAttributeOnDowncast: setViewAttributes
|
|
@@ -73,7 +73,7 @@ export default class DocumentListElementSupport extends Plugin {
|
|
|
73
73
|
});
|
|
74
74
|
});
|
|
75
75
|
// Make sure that all items in a single list (items at the same level & listType) have the same properties.
|
|
76
|
-
|
|
76
|
+
listEditing.on('postFixer', (evt, { listNodes, writer }) => {
|
|
77
77
|
for (const { node, previousNodeInList } of listNodes) {
|
|
78
78
|
// This is a first item of a nested list.
|
|
79
79
|
if (!previousNodeInList) {
|
|
@@ -99,7 +99,7 @@ export default class DocumentListElementSupport extends Plugin {
|
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
101
|
// Remove `ol` attributes from `ul` elements and vice versa.
|
|
102
|
-
|
|
102
|
+
listEditing.on('postFixer', (evt, { listNodes, writer }) => {
|
|
103
103
|
for (const { node } of listNodes) {
|
|
104
104
|
const listType = node.getAttribute('listType');
|
|
105
105
|
if (listType !== 'numbered' && node.getAttribute('htmlOlAttributes')) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module html-support/integrations/mediaembed
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import DataFilter from '../datafilter';
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.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
|
*/
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module html-support/integrations/mediaembed
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import DataFilter from '../datafilter';
|
|
10
|
-
import DataSchema from '../dataschema';
|
|
11
|
-
import { updateViewAttributes, getHtmlAttributeName } from '../utils';
|
|
12
|
-
import { getDescendantElement } from './integrationutils';
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import DataFilter from '../datafilter.js';
|
|
10
|
+
import DataSchema from '../dataschema.js';
|
|
11
|
+
import { updateViewAttributes, getHtmlAttributeName } from '../utils.js';
|
|
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
|
*/
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module html-support/integrations/script
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import DataFilter from '../datafilter';
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import DataFilter from '../datafilter.js';
|
|
10
10
|
/**
|
|
11
11
|
* Provides the General HTML Support for `script` elements.
|
|
12
12
|
*/
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module html-support/integrations/script
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import { createObjectView, modelToViewBlockAttributeConverter, viewToModelBlockAttributeConverter, viewToModelObjectConverter } from '../converters';
|
|
10
|
-
import DataFilter from '../datafilter';
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import { createObjectView, modelToViewBlockAttributeConverter, viewToModelBlockAttributeConverter, viewToModelObjectConverter } from '../converters.js';
|
|
10
|
+
import DataFilter from '../datafilter.js';
|
|
11
11
|
/**
|
|
12
12
|
* Provides the General HTML Support for `script` elements.
|
|
13
13
|
*/
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module html-support/integrations/style
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import DataFilter from '../datafilter';
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import DataFilter from '../datafilter.js';
|
|
10
10
|
/**
|
|
11
11
|
* Provides the General HTML Support for `style` elements.
|
|
12
12
|
*/
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module html-support/integrations/style
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import { createObjectView, modelToViewBlockAttributeConverter, viewToModelBlockAttributeConverter, viewToModelObjectConverter } from '../converters';
|
|
10
|
-
import DataFilter from '../datafilter';
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import { createObjectView, modelToViewBlockAttributeConverter, viewToModelBlockAttributeConverter, viewToModelObjectConverter } from '../converters.js';
|
|
10
|
+
import DataFilter from '../datafilter.js';
|
|
11
11
|
/**
|
|
12
12
|
* Provides the General HTML Support for `style` elements.
|
|
13
13
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
6
|
-
import DataFilter from '../datafilter';
|
|
5
|
+
import { Plugin } from 'ckeditor5/src/core.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
|
*/
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
6
|
-
import { updateViewAttributes } from '../utils';
|
|
7
|
-
import DataFilter from '../datafilter';
|
|
8
|
-
import { getDescendantElement } from './integrationutils';
|
|
5
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
6
|
+
import { updateViewAttributes } from '../utils.js';
|
|
7
|
+
import DataFilter from '../datafilter.js';
|
|
8
|
+
import { getDescendantElement } from './integrationutils.js';
|
|
9
9
|
/**
|
|
10
10
|
* Provides the General HTML Support integration with {@link module:table/table~Table Table} feature.
|
|
11
11
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
import type { DataSchemaBlockElementDefinition, DataSchemaInlineElementDefinition } from './dataschema';
|
|
5
|
+
import type { DataSchemaBlockElementDefinition, DataSchemaInlineElementDefinition } from './dataschema.js';
|
|
6
6
|
/**
|
|
7
7
|
* @module html-support/schemadefinitions
|
|
8
8
|
*/
|
package/src/schemadefinitions.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
package/src/utils.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module html-support/utils
|
|
7
7
|
*/
|
|
8
|
-
import type { DocumentSelection, DowncastWriter, Item, ViewElement, Writer } from 'ckeditor5/src/engine';
|
|
8
|
+
import type { DocumentSelection, DowncastWriter, Item, ViewElement, Writer } from 'ckeditor5/src/engine.js';
|
|
9
9
|
export interface GHSViewAttributes {
|
|
10
10
|
attributes?: Record<string, unknown>;
|
|
11
11
|
classes?: Array<string>;
|
package/src/utils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
import { startCase, cloneDeep } from 'lodash-es';
|