@ckeditor/ckeditor5-html-support 38.2.0-alpha.1 → 39.0.1
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/README.md +0 -1
- package/build/html-support.js +1 -1
- package/build/translations/ug.js +1 -0
- package/lang/translations/ug.po +21 -0
- package/package.json +3 -4
- package/src/augmentation.d.ts +1 -1
- package/src/converters.d.ts +4 -4
- package/src/converters.js +2 -2
- package/src/datafilter.d.ts +5 -5
- package/src/datafilter.js +7 -7
- package/src/dataschema.d.ts +2 -2
- package/src/dataschema.js +3 -3
- package/src/fullpage.d.ts +1 -1
- package/src/fullpage.js +3 -3
- package/src/generalhtmlsupport.d.ts +14 -14
- package/src/generalhtmlsupport.js +14 -14
- package/src/generalhtmlsupportconfig.d.ts +1 -1
- package/src/htmlcomment.d.ts +3 -4
- package/src/htmlcomment.js +4 -6
- package/src/htmlpagedataprocessor.d.ts +1 -1
- package/src/htmlpagedataprocessor.js +1 -1
- package/src/index.d.ts +18 -18
- package/src/index.js +7 -7
- package/src/integrations/codeblock.d.ts +2 -2
- package/src/integrations/codeblock.js +3 -3
- package/src/integrations/customelement.d.ts +3 -3
- package/src/integrations/customelement.js +5 -5
- package/src/integrations/documentlist.d.ts +2 -2
- package/src/integrations/documentlist.js +3 -3
- package/src/integrations/dualcontent.d.ts +2 -2
- package/src/integrations/dualcontent.js +5 -5
- package/src/integrations/heading.d.ts +3 -3
- package/src/integrations/heading.js +3 -3
- package/src/integrations/image.d.ts +2 -2
- package/src/integrations/image.js +34 -17
- package/src/integrations/integrationutils.d.ts +1 -1
- package/src/integrations/mediaembed.d.ts +2 -2
- package/src/integrations/mediaembed.js +5 -5
- package/src/integrations/script.d.ts +2 -2
- package/src/integrations/script.js +3 -3
- package/src/integrations/style.d.ts +2 -2
- package/src/integrations/style.js +3 -3
- package/src/integrations/table.d.ts +2 -2
- package/src/integrations/table.js +4 -4
- package/src/schemadefinitions.d.ts +1 -1
- package/src/utils.d.ts +1 -1
|
@@ -5,20 +5,20 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module html-support/generalhtmlsupport
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core
|
|
9
|
-
import { type ArrayOrItem } from 'ckeditor5/src/utils
|
|
10
|
-
import DataFilter from './datafilter
|
|
11
|
-
import CodeBlockElementSupport from './integrations/codeblock
|
|
12
|
-
import DualContentModelElementSupport from './integrations/dualcontent
|
|
13
|
-
import HeadingElementSupport from './integrations/heading
|
|
14
|
-
import ImageElementSupport from './integrations/image
|
|
15
|
-
import MediaEmbedElementSupport from './integrations/mediaembed
|
|
16
|
-
import ScriptElementSupport from './integrations/script
|
|
17
|
-
import TableElementSupport from './integrations/table
|
|
18
|
-
import StyleElementSupport from './integrations/style
|
|
19
|
-
import DocumentListElementSupport from './integrations/documentlist
|
|
20
|
-
import CustomElementSupport from './integrations/customelement
|
|
21
|
-
import type { Selectable } from 'ckeditor5/src/engine
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
+
import { type ArrayOrItem } from 'ckeditor5/src/utils';
|
|
10
|
+
import DataFilter from './datafilter';
|
|
11
|
+
import CodeBlockElementSupport from './integrations/codeblock';
|
|
12
|
+
import DualContentModelElementSupport from './integrations/dualcontent';
|
|
13
|
+
import HeadingElementSupport from './integrations/heading';
|
|
14
|
+
import ImageElementSupport from './integrations/image';
|
|
15
|
+
import MediaEmbedElementSupport from './integrations/mediaembed';
|
|
16
|
+
import ScriptElementSupport from './integrations/script';
|
|
17
|
+
import TableElementSupport from './integrations/table';
|
|
18
|
+
import StyleElementSupport from './integrations/style';
|
|
19
|
+
import DocumentListElementSupport from './integrations/documentlist';
|
|
20
|
+
import CustomElementSupport from './integrations/customelement';
|
|
21
|
+
import type { Selectable } from 'ckeditor5/src/engine';
|
|
22
22
|
/**
|
|
23
23
|
* The General HTML Support feature.
|
|
24
24
|
*
|
|
@@ -5,20 +5,20 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module html-support/generalhtmlsupport
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core
|
|
9
|
-
import { toArray } from 'ckeditor5/src/utils
|
|
10
|
-
import DataFilter from './datafilter
|
|
11
|
-
import CodeBlockElementSupport from './integrations/codeblock
|
|
12
|
-
import DualContentModelElementSupport from './integrations/dualcontent
|
|
13
|
-
import HeadingElementSupport from './integrations/heading
|
|
14
|
-
import ImageElementSupport from './integrations/image
|
|
15
|
-
import MediaEmbedElementSupport from './integrations/mediaembed
|
|
16
|
-
import ScriptElementSupport from './integrations/script
|
|
17
|
-
import TableElementSupport from './integrations/table
|
|
18
|
-
import StyleElementSupport from './integrations/style
|
|
19
|
-
import DocumentListElementSupport from './integrations/documentlist
|
|
20
|
-
import CustomElementSupport from './integrations/customelement
|
|
21
|
-
import { getHtmlAttributeName, modifyGhsAttribute } from './utils
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
+
import { toArray } from 'ckeditor5/src/utils';
|
|
10
|
+
import DataFilter from './datafilter';
|
|
11
|
+
import CodeBlockElementSupport from './integrations/codeblock';
|
|
12
|
+
import DualContentModelElementSupport from './integrations/dualcontent';
|
|
13
|
+
import HeadingElementSupport from './integrations/heading';
|
|
14
|
+
import ImageElementSupport from './integrations/image';
|
|
15
|
+
import MediaEmbedElementSupport from './integrations/mediaembed';
|
|
16
|
+
import ScriptElementSupport from './integrations/script';
|
|
17
|
+
import TableElementSupport from './integrations/table';
|
|
18
|
+
import StyleElementSupport from './integrations/style';
|
|
19
|
+
import DocumentListElementSupport from './integrations/documentlist';
|
|
20
|
+
import CustomElementSupport from './integrations/customelement';
|
|
21
|
+
import { getHtmlAttributeName, modifyGhsAttribute } from './utils';
|
|
22
22
|
/**
|
|
23
23
|
* The General HTML Support feature.
|
|
24
24
|
*
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module html-support/generalhtmlsupportconfig
|
|
7
7
|
*/
|
|
8
|
-
import type { MatcherObjectPattern } from 'ckeditor5/src/engine
|
|
8
|
+
import type { MatcherObjectPattern } from 'ckeditor5/src/engine';
|
|
9
9
|
/**
|
|
10
10
|
* The configuration of the General HTML Support feature.
|
|
11
11
|
* The option is used by the {@link module:html-support/generalhtmlsupport~GeneralHtmlSupport} feature.
|
package/src/htmlcomment.d.ts
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module html-support/htmlcomment
|
|
7
7
|
*/
|
|
8
|
-
import type { Position, Range } from 'ckeditor5/src/engine
|
|
9
|
-
import { Plugin } from 'ckeditor5/src/core
|
|
8
|
+
import type { Position, Range } from 'ckeditor5/src/engine';
|
|
9
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
10
10
|
/**
|
|
11
11
|
* The HTML comment feature. It preserves the HTML comments (`<!-- -->`) in the editor data.
|
|
12
12
|
*
|
|
@@ -45,13 +45,12 @@ export default class HtmlComment extends Plugin {
|
|
|
45
45
|
* Gets the HTML comment data for the comment with a given ID.
|
|
46
46
|
*
|
|
47
47
|
* Returns `null` if the comment does not exist.
|
|
48
|
-
*
|
|
49
48
|
*/
|
|
50
49
|
getHtmlCommentData(commentID: string): HtmlCommentData | null;
|
|
51
50
|
/**
|
|
52
51
|
* Gets all HTML comments in the given range.
|
|
53
52
|
*
|
|
54
|
-
* By default it includes comments at the range boundaries.
|
|
53
|
+
* By default, it includes comments at the range boundaries.
|
|
55
54
|
*
|
|
56
55
|
* @param range
|
|
57
56
|
* @param options.skipBoundaries When set to `true` the range boundaries will be skipped.
|
package/src/htmlcomment.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2023, 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 { uid } from 'ckeditor5/src/utils
|
|
5
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
6
|
+
import { uid } from 'ckeditor5/src/utils';
|
|
7
7
|
/**
|
|
8
8
|
* The HTML comment feature. It preserves the HTML comments (`<!-- -->`) in the editor data.
|
|
9
9
|
*
|
|
@@ -175,7 +175,6 @@ export default class HtmlComment extends Plugin {
|
|
|
175
175
|
* Gets the HTML comment data for the comment with a given ID.
|
|
176
176
|
*
|
|
177
177
|
* Returns `null` if the comment does not exist.
|
|
178
|
-
*
|
|
179
178
|
*/
|
|
180
179
|
getHtmlCommentData(commentID) {
|
|
181
180
|
const editor = this.editor;
|
|
@@ -184,8 +183,7 @@ export default class HtmlComment extends Plugin {
|
|
|
184
183
|
return null;
|
|
185
184
|
}
|
|
186
185
|
let content = '';
|
|
187
|
-
for (const
|
|
188
|
-
const root = editor.model.document.getRoot(rootName);
|
|
186
|
+
for (const root of this.editor.model.document.getRoots()) {
|
|
189
187
|
if (root.hasAttribute(commentID)) {
|
|
190
188
|
content = root.getAttribute(commentID);
|
|
191
189
|
break;
|
|
@@ -199,7 +197,7 @@ export default class HtmlComment extends Plugin {
|
|
|
199
197
|
/**
|
|
200
198
|
* Gets all HTML comments in the given range.
|
|
201
199
|
*
|
|
202
|
-
* By default it includes comments at the range boundaries.
|
|
200
|
+
* By default, it includes comments at the range boundaries.
|
|
203
201
|
*
|
|
204
202
|
* @param range
|
|
205
203
|
* @param options.skipBoundaries When set to `true` the range boundaries will be skipped.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module html-support/htmlpagedataprocessor
|
|
7
7
|
*/
|
|
8
|
-
import { HtmlDataProcessor, type ViewDocumentFragment } from 'ckeditor5/src/engine
|
|
8
|
+
import { HtmlDataProcessor, type ViewDocumentFragment } from 'ckeditor5/src/engine';
|
|
9
9
|
/**
|
|
10
10
|
* The full page HTML data processor class.
|
|
11
11
|
* This data processor implementation uses HTML as input and output data.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module html-support/htmlpagedataprocessor
|
|
7
7
|
*/
|
|
8
|
-
import { HtmlDataProcessor, UpcastWriter } from 'ckeditor5/src/engine
|
|
8
|
+
import { HtmlDataProcessor, UpcastWriter } from 'ckeditor5/src/engine';
|
|
9
9
|
/**
|
|
10
10
|
* The full page HTML data processor class.
|
|
11
11
|
* This data processor implementation uses HTML as input and output data.
|
package/src/index.d.ts
CHANGED
|
@@ -5,21 +5,21 @@
|
|
|
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 DocumentListElementSupport } from './integrations/documentlist
|
|
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';
|
|
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 DocumentListElementSupport } from './integrations/documentlist';
|
|
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';
|
package/src/index.js
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
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';
|
|
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';
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2023, 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';
|
|
6
|
+
import DataFilter from '../datafilter';
|
|
7
7
|
/**
|
|
8
8
|
* Provides the General HTML Support integration with {@link module:code-block/codeblock~CodeBlock Code Block} feature.
|
|
9
9
|
*/
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2023, 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';
|
|
6
|
+
import { updateViewAttributes } from '../utils';
|
|
7
|
+
import DataFilter from '../datafilter';
|
|
8
8
|
/**
|
|
9
9
|
* Provides the General HTML Support integration with {@link module:code-block/codeblock~CodeBlock Code Block} feature.
|
|
10
10
|
*/
|
|
@@ -5,9 +5,9 @@
|
|
|
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';
|
|
9
|
+
import DataSchema from '../dataschema';
|
|
10
|
+
import DataFilter from '../datafilter';
|
|
11
11
|
/**
|
|
12
12
|
* Provides the General HTML Support for custom elements (not registered in the {@link module:html-support/dataschema~DataSchema}).
|
|
13
13
|
*/
|
|
@@ -6,11 +6,11 @@
|
|
|
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';
|
|
10
|
+
import { UpcastWriter } from 'ckeditor5/src/engine';
|
|
11
|
+
import DataSchema from '../dataschema';
|
|
12
|
+
import DataFilter from '../datafilter';
|
|
13
|
+
import { setViewAttributes } from '../utils';
|
|
14
14
|
/**
|
|
15
15
|
* Provides the General HTML Support for custom elements (not registered in the {@link module:html-support/dataschema~DataSchema}).
|
|
16
16
|
*/
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2023, 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';
|
|
6
|
+
import DataFilter from '../datafilter';
|
|
7
7
|
/**
|
|
8
8
|
* Provides the General HTML Support integration with the {@link module:list/documentlist~DocumentList Document List} feature.
|
|
9
9
|
*/
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* @module html-support/integrations/documentlist
|
|
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';
|
|
10
|
+
import { getHtmlAttributeName, setViewAttributes } from '../utils';
|
|
11
|
+
import DataFilter from '../datafilter';
|
|
12
12
|
/**
|
|
13
13
|
* Provides the General HTML Support integration with the {@link module:list/documentlist~DocumentList Document List} feature.
|
|
14
14
|
*/
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2023, 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';
|
|
6
|
+
import DataFilter from '../datafilter';
|
|
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).
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2023, 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';
|
|
6
|
+
import { priorities } from 'ckeditor5/src/utils';
|
|
7
|
+
import { modelToViewBlockAttributeConverter, viewToModelBlockAttributeConverter } from '../converters';
|
|
8
|
+
import DataFilter from '../datafilter';
|
|
9
|
+
import { getHtmlAttributeName } from '../utils';
|
|
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).
|
|
@@ -5,9 +5,9 @@
|
|
|
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';
|
|
9
|
+
import { Enter } from 'ckeditor5/src/enter';
|
|
10
|
+
import DataSchema from '../dataschema';
|
|
11
11
|
/**
|
|
12
12
|
* Provides the General HTML Support integration with {@link module:heading/heading~Heading Heading} feature.
|
|
13
13
|
*/
|
|
@@ -5,9 +5,9 @@
|
|
|
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';
|
|
9
|
+
import { Enter } from 'ckeditor5/src/enter';
|
|
10
|
+
import DataSchema from '../dataschema';
|
|
11
11
|
/**
|
|
12
12
|
* Provides the General HTML Support integration with {@link module:heading/heading~Heading Heading} feature.
|
|
13
13
|
*/
|
|
@@ -5,8 +5,8 @@
|
|
|
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';
|
|
9
|
+
import DataFilter from '../datafilter';
|
|
10
10
|
/**
|
|
11
11
|
* Provides the General HTML Support integration with the {@link module:image/image~Image Image} feature.
|
|
12
12
|
*/
|
|
@@ -5,10 +5,10 @@
|
|
|
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';
|
|
9
|
+
import DataFilter from '../datafilter';
|
|
10
|
+
import { setViewAttributes, updateViewAttributes } from '../utils';
|
|
11
|
+
import { getDescendantElement } from './integrationutils';
|
|
12
12
|
/**
|
|
13
13
|
* Provides the General HTML Support integration with the {@link module:image/image~Image Image} feature.
|
|
14
14
|
*/
|
|
@@ -66,6 +66,9 @@ export default class ImageElementSupport extends Plugin {
|
|
|
66
66
|
}
|
|
67
67
|
conversion.for('upcast').add(viewToModelImageAttributeConverter(dataFilter));
|
|
68
68
|
conversion.for('downcast').add(modelToViewImageAttributeConverter());
|
|
69
|
+
if (editor.plugins.has('LinkImage')) {
|
|
70
|
+
conversion.for('upcast').add(viewToModelLinkImageAttributeConverter(dataFilter, editor));
|
|
71
|
+
}
|
|
69
72
|
evt.stop();
|
|
70
73
|
});
|
|
71
74
|
}
|
|
@@ -83,21 +86,35 @@ function viewToModelImageAttributeConverter(dataFilter) {
|
|
|
83
86
|
return;
|
|
84
87
|
}
|
|
85
88
|
const viewImageElement = data.viewItem;
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
preserveLinkAttributes(viewContainerElement);
|
|
89
|
+
const viewAttributes = dataFilter.processViewAttributes(viewImageElement, conversionApi);
|
|
90
|
+
if (viewAttributes) {
|
|
91
|
+
conversionApi.writer.setAttribute('htmlImgAttributes', viewAttributes, data.modelRange);
|
|
90
92
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
}, { priority: 'low' });
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* View-to-model conversion helper preserving allowed attributes on {@link module:image/image~Image Image}
|
|
98
|
+
* feature model element from link view element.
|
|
99
|
+
*
|
|
100
|
+
* @returns Returns a conversion callback.
|
|
101
|
+
*/
|
|
102
|
+
function viewToModelLinkImageAttributeConverter(dataFilter, editor) {
|
|
103
|
+
const imageUtils = editor.plugins.get('ImageUtils');
|
|
104
|
+
return (dispatcher) => {
|
|
105
|
+
dispatcher.on('element:a', (evt, data, conversionApi) => {
|
|
106
|
+
const viewLink = data.viewItem;
|
|
107
|
+
const viewImage = imageUtils.findViewImgElement(viewLink);
|
|
108
|
+
if (!viewImage) {
|
|
109
|
+
return;
|
|
96
110
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
111
|
+
const modelImage = data.modelCursor.parent;
|
|
112
|
+
if (!modelImage.is('element', 'imageBlock')) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const viewAttributes = dataFilter.processViewAttributes(viewLink, conversionApi);
|
|
116
|
+
if (viewAttributes) {
|
|
117
|
+
conversionApi.writer.setAttribute('htmlLinkAttributes', viewAttributes, modelImage);
|
|
101
118
|
}
|
|
102
119
|
}, { priority: 'low' });
|
|
103
120
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2023, 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';
|
|
6
6
|
/**
|
|
7
7
|
* @module html-support/integrations/integrationutils
|
|
8
8
|
*/
|
|
@@ -5,8 +5,8 @@
|
|
|
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';
|
|
9
|
+
import DataFilter from '../datafilter';
|
|
10
10
|
/**
|
|
11
11
|
* Provides the General HTML Support integration with {@link module:media-embed/mediaembed~MediaEmbed Media Embed} feature.
|
|
12
12
|
*/
|
|
@@ -5,11 +5,11 @@
|
|
|
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';
|
|
9
|
+
import DataFilter from '../datafilter';
|
|
10
|
+
import DataSchema from '../dataschema';
|
|
11
|
+
import { updateViewAttributes, getHtmlAttributeName } from '../utils';
|
|
12
|
+
import { getDescendantElement } from './integrationutils';
|
|
13
13
|
/**
|
|
14
14
|
* Provides the General HTML Support integration with {@link module:media-embed/mediaembed~MediaEmbed Media Embed} feature.
|
|
15
15
|
*/
|
|
@@ -5,8 +5,8 @@
|
|
|
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';
|
|
9
|
+
import DataFilter from '../datafilter';
|
|
10
10
|
/**
|
|
11
11
|
* Provides the General HTML Support for `script` elements.
|
|
12
12
|
*/
|
|
@@ -5,9 +5,9 @@
|
|
|
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';
|
|
9
|
+
import { createObjectView, modelToViewBlockAttributeConverter, viewToModelBlockAttributeConverter, viewToModelObjectConverter } from '../converters';
|
|
10
|
+
import DataFilter from '../datafilter';
|
|
11
11
|
/**
|
|
12
12
|
* Provides the General HTML Support for `script` elements.
|
|
13
13
|
*/
|
|
@@ -5,8 +5,8 @@
|
|
|
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';
|
|
9
|
+
import DataFilter from '../datafilter';
|
|
10
10
|
/**
|
|
11
11
|
* Provides the General HTML Support for `style` elements.
|
|
12
12
|
*/
|
|
@@ -5,9 +5,9 @@
|
|
|
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';
|
|
9
|
+
import { createObjectView, modelToViewBlockAttributeConverter, viewToModelBlockAttributeConverter, viewToModelObjectConverter } from '../converters';
|
|
10
|
+
import DataFilter from '../datafilter';
|
|
11
11
|
/**
|
|
12
12
|
* Provides the General HTML Support for `style` elements.
|
|
13
13
|
*/
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2023, 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';
|
|
6
|
+
import DataFilter from '../datafilter';
|
|
7
7
|
/**
|
|
8
8
|
* Provides the General HTML Support integration with {@link module:table/table~Table Table} feature.
|
|
9
9
|
*/
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2023, 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';
|
|
6
|
+
import { updateViewAttributes } from '../utils';
|
|
7
|
+
import DataFilter from '../datafilter';
|
|
8
|
+
import { getDescendantElement } from './integrationutils';
|
|
9
9
|
/**
|
|
10
10
|
* Provides the General HTML Support integration with {@link module:table/table~Table Table} feature.
|
|
11
11
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2023, 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';
|
|
6
6
|
/**
|
|
7
7
|
* @module html-support/schemadefinitions
|
|
8
8
|
*/
|
package/src/utils.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
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';
|
|
9
9
|
export interface GHSViewAttributes {
|
|
10
10
|
attributes?: Record<string, unknown>;
|
|
11
11
|
classes?: Array<string>;
|