@ckeditor/ckeditor5-html-support 39.0.2 → 40.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/build/html-support.js +1 -1
- package/build/html-support.js.map +1 -0
- package/package.json +2 -2
- package/src/augmentation.d.ts +33 -33
- package/src/augmentation.js +5 -5
- package/src/converters.d.ts +60 -60
- package/src/converters.js +180 -180
- package/src/datafilter.d.ts +304 -304
- package/src/datafilter.js +720 -720
- package/src/dataschema.d.ts +183 -183
- package/src/dataschema.js +196 -196
- package/src/fullpage.d.ts +21 -21
- package/src/fullpage.js +80 -80
- package/src/generalhtmlsupport.d.ts +98 -98
- package/src/generalhtmlsupport.js +240 -240
- package/src/generalhtmlsupportconfig.d.ts +77 -77
- package/src/generalhtmlsupportconfig.js +5 -5
- package/src/htmlcomment.d.ts +71 -71
- package/src/htmlcomment.js +218 -218
- package/src/htmlpagedataprocessor.d.ts +22 -22
- package/src/htmlpagedataprocessor.js +67 -67
- package/src/index.d.ts +25 -25
- package/src/index.js +14 -14
- package/src/integrations/codeblock.d.ts +23 -23
- package/src/integrations/codeblock.js +101 -101
- package/src/integrations/customelement.d.ts +27 -27
- package/src/integrations/customelement.js +146 -146
- package/src/integrations/documentlist.d.ts +27 -27
- package/src/integrations/documentlist.js +178 -203
- package/src/integrations/dualcontent.d.ts +45 -45
- package/src/integrations/dualcontent.js +119 -119
- package/src/integrations/heading.d.ts +31 -31
- package/src/integrations/heading.js +60 -60
- package/src/integrations/image.d.ts +26 -26
- package/src/integrations/image.js +189 -189
- package/src/integrations/integrationutils.d.ts +15 -15
- package/src/integrations/integrationutils.js +21 -21
- package/src/integrations/mediaembed.d.ts +26 -26
- package/src/integrations/mediaembed.js +119 -119
- package/src/integrations/script.d.ts +26 -26
- package/src/integrations/script.js +59 -59
- package/src/integrations/style.d.ts +26 -26
- package/src/integrations/style.js +59 -59
- package/src/integrations/table.d.ts +23 -23
- package/src/integrations/table.js +163 -163
- package/src/schemadefinitions.d.ts +13 -13
- package/src/schemadefinitions.js +956 -956
- package/src/utils.d.ts +72 -72
- package/src/utils.js +139 -139
|
@@ -1,203 +1,178 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module html-support/integrations/documentlist
|
|
7
|
-
*/
|
|
8
|
-
import { isEqual } from 'lodash-es';
|
|
9
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
10
|
-
import { getHtmlAttributeName, setViewAttributes } from '../utils';
|
|
11
|
-
import DataFilter from '../datafilter';
|
|
12
|
-
/**
|
|
13
|
-
* Provides the General HTML Support integration with the {@link module:list/documentlist~DocumentList Document List} feature.
|
|
14
|
-
*/
|
|
15
|
-
export default class DocumentListElementSupport extends Plugin {
|
|
16
|
-
/**
|
|
17
|
-
* @inheritDoc
|
|
18
|
-
*/
|
|
19
|
-
static get requires() {
|
|
20
|
-
return [DataFilter];
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* @inheritDoc
|
|
24
|
-
*/
|
|
25
|
-
static get pluginName() {
|
|
26
|
-
return 'DocumentListElementSupport';
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* @inheritDoc
|
|
30
|
-
*/
|
|
31
|
-
init() {
|
|
32
|
-
const editor = this.editor;
|
|
33
|
-
if (!editor.plugins.has('DocumentListEditing')) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
const schema = editor.model.schema;
|
|
37
|
-
const conversion = editor.conversion;
|
|
38
|
-
const dataFilter = editor.plugins.get(DataFilter);
|
|
39
|
-
const documentListEditing = editor.plugins.get('DocumentListEditing');
|
|
40
|
-
const viewElements = ['ul', 'ol', 'li'];
|
|
41
|
-
// Register downcast strategy.
|
|
42
|
-
// Note that this must be done before document list editing registers conversion in afterInit.
|
|
43
|
-
documentListEditing.registerDowncastStrategy({
|
|
44
|
-
scope: 'item',
|
|
45
|
-
attributeName: 'htmlLiAttributes',
|
|
46
|
-
setAttributeOnDowncast: setViewAttributes
|
|
47
|
-
});
|
|
48
|
-
documentListEditing.registerDowncastStrategy({
|
|
49
|
-
scope: 'list',
|
|
50
|
-
attributeName: 'htmlUlAttributes',
|
|
51
|
-
setAttributeOnDowncast: setViewAttributes
|
|
52
|
-
});
|
|
53
|
-
documentListEditing.registerDowncastStrategy({
|
|
54
|
-
scope: 'list',
|
|
55
|
-
attributeName: 'htmlOlAttributes',
|
|
56
|
-
setAttributeOnDowncast: setViewAttributes
|
|
57
|
-
});
|
|
58
|
-
dataFilter.on('register', (evt, definition) => {
|
|
59
|
-
if (!viewElements.includes(definition.view)) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
evt.stop();
|
|
63
|
-
// Do not register same converters twice.
|
|
64
|
-
if (schema.checkAttribute('$block', 'htmlLiAttributes')) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
const allowAttributes = viewElements.map(element => getHtmlAttributeName(element));
|
|
68
|
-
schema.extend('$
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
dispatcher.on('element:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
})
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
if (
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
const viewAttributes = dataFilter.processViewAttributes(viewElement, conversionApi);
|
|
180
|
-
for (const item of data.modelRange.getItems({ shallow: true })) {
|
|
181
|
-
// Apply only to list item blocks.
|
|
182
|
-
if (!item.hasAttribute('listItemId')) {
|
|
183
|
-
continue;
|
|
184
|
-
}
|
|
185
|
-
// Set list attributes only on same level items, those nested deeper are already handled
|
|
186
|
-
// by the recursive conversion.
|
|
187
|
-
if (item.hasAttribute(attributeName)) {
|
|
188
|
-
continue;
|
|
189
|
-
}
|
|
190
|
-
if (conversionApi.writer.model.schema.checkAttribute(item, attributeName)) {
|
|
191
|
-
conversionApi.writer.setAttribute(attributeName, viewAttributes || {}, item);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* Returns HTML attribute name based on provided list type.
|
|
198
|
-
*/
|
|
199
|
-
function getAttributeFromListType(listType) {
|
|
200
|
-
return listType === 'bulleted' ?
|
|
201
|
-
'htmlUlAttributes' :
|
|
202
|
-
'htmlOlAttributes';
|
|
203
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module html-support/integrations/documentlist
|
|
7
|
+
*/
|
|
8
|
+
import { isEqual } from 'lodash-es';
|
|
9
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
10
|
+
import { getHtmlAttributeName, setViewAttributes } from '../utils';
|
|
11
|
+
import DataFilter from '../datafilter';
|
|
12
|
+
/**
|
|
13
|
+
* Provides the General HTML Support integration with the {@link module:list/documentlist~DocumentList Document List} feature.
|
|
14
|
+
*/
|
|
15
|
+
export default class DocumentListElementSupport extends Plugin {
|
|
16
|
+
/**
|
|
17
|
+
* @inheritDoc
|
|
18
|
+
*/
|
|
19
|
+
static get requires() {
|
|
20
|
+
return [DataFilter];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
static get pluginName() {
|
|
26
|
+
return 'DocumentListElementSupport';
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @inheritDoc
|
|
30
|
+
*/
|
|
31
|
+
init() {
|
|
32
|
+
const editor = this.editor;
|
|
33
|
+
if (!editor.plugins.has('DocumentListEditing')) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const schema = editor.model.schema;
|
|
37
|
+
const conversion = editor.conversion;
|
|
38
|
+
const dataFilter = editor.plugins.get(DataFilter);
|
|
39
|
+
const documentListEditing = editor.plugins.get('DocumentListEditing');
|
|
40
|
+
const viewElements = ['ul', 'ol', 'li'];
|
|
41
|
+
// Register downcast strategy.
|
|
42
|
+
// Note that this must be done before document list editing registers conversion in afterInit.
|
|
43
|
+
documentListEditing.registerDowncastStrategy({
|
|
44
|
+
scope: 'item',
|
|
45
|
+
attributeName: 'htmlLiAttributes',
|
|
46
|
+
setAttributeOnDowncast: setViewAttributes
|
|
47
|
+
});
|
|
48
|
+
documentListEditing.registerDowncastStrategy({
|
|
49
|
+
scope: 'list',
|
|
50
|
+
attributeName: 'htmlUlAttributes',
|
|
51
|
+
setAttributeOnDowncast: setViewAttributes
|
|
52
|
+
});
|
|
53
|
+
documentListEditing.registerDowncastStrategy({
|
|
54
|
+
scope: 'list',
|
|
55
|
+
attributeName: 'htmlOlAttributes',
|
|
56
|
+
setAttributeOnDowncast: setViewAttributes
|
|
57
|
+
});
|
|
58
|
+
dataFilter.on('register', (evt, definition) => {
|
|
59
|
+
if (!viewElements.includes(definition.view)) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
evt.stop();
|
|
63
|
+
// Do not register same converters twice.
|
|
64
|
+
if (schema.checkAttribute('$block', 'htmlLiAttributes')) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const allowAttributes = viewElements.map(element => getHtmlAttributeName(element));
|
|
68
|
+
schema.extend('$listItem', { allowAttributes });
|
|
69
|
+
conversion.for('upcast').add(dispatcher => {
|
|
70
|
+
dispatcher.on('element:ul', viewToModelListAttributeConverter('htmlUlAttributes', dataFilter), { priority: 'low' });
|
|
71
|
+
dispatcher.on('element:ol', viewToModelListAttributeConverter('htmlOlAttributes', dataFilter), { priority: 'low' });
|
|
72
|
+
dispatcher.on('element:li', viewToModelListAttributeConverter('htmlLiAttributes', dataFilter), { priority: 'low' });
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
// Make sure that all items in a single list (items at the same level & listType) have the same properties.
|
|
76
|
+
documentListEditing.on('postFixer', (evt, { listNodes, writer }) => {
|
|
77
|
+
for (const { node, previousNodeInList } of listNodes) {
|
|
78
|
+
// This is a first item of a nested list.
|
|
79
|
+
if (!previousNodeInList) {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if (previousNodeInList.getAttribute('listType') == node.getAttribute('listType')) {
|
|
83
|
+
const attribute = getAttributeFromListType(previousNodeInList.getAttribute('listType'));
|
|
84
|
+
const value = previousNodeInList.getAttribute(attribute);
|
|
85
|
+
if (!isEqual(node.getAttribute(attribute), value) &&
|
|
86
|
+
writer.model.schema.checkAttribute(node, attribute)) {
|
|
87
|
+
writer.setAttribute(attribute, value, node);
|
|
88
|
+
evt.return = true;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (previousNodeInList.getAttribute('listItemId') == node.getAttribute('listItemId')) {
|
|
92
|
+
const value = previousNodeInList.getAttribute('htmlLiAttributes');
|
|
93
|
+
if (!isEqual(node.getAttribute('htmlLiAttributes'), value) &&
|
|
94
|
+
writer.model.schema.checkAttribute(node, 'htmlLiAttributes')) {
|
|
95
|
+
writer.setAttribute('htmlLiAttributes', value, node);
|
|
96
|
+
evt.return = true;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
// Remove `ol` attributes from `ul` elements and vice versa.
|
|
102
|
+
documentListEditing.on('postFixer', (evt, { listNodes, writer }) => {
|
|
103
|
+
for (const { node } of listNodes) {
|
|
104
|
+
const listType = node.getAttribute('listType');
|
|
105
|
+
if (listType !== 'numbered' && node.getAttribute('htmlOlAttributes')) {
|
|
106
|
+
writer.removeAttribute('htmlOlAttributes', node);
|
|
107
|
+
evt.return = true;
|
|
108
|
+
}
|
|
109
|
+
if (listType === 'numbered' && node.getAttribute('htmlUlAttributes')) {
|
|
110
|
+
writer.removeAttribute('htmlUlAttributes', node);
|
|
111
|
+
evt.return = true;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* @inheritDoc
|
|
118
|
+
*/
|
|
119
|
+
afterInit() {
|
|
120
|
+
const editor = this.editor;
|
|
121
|
+
if (!editor.commands.get('indentList')) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
// Reset list attributes after indenting list items.
|
|
125
|
+
const indentList = editor.commands.get('indentList');
|
|
126
|
+
this.listenTo(indentList, 'afterExecute', (evt, changedBlocks) => {
|
|
127
|
+
editor.model.change(writer => {
|
|
128
|
+
for (const node of changedBlocks) {
|
|
129
|
+
const attribute = getAttributeFromListType(node.getAttribute('listType'));
|
|
130
|
+
if (!editor.model.schema.checkAttribute(node, attribute)) {
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
// Just reset the attribute.
|
|
134
|
+
// If there is a previous indented list that this node should be merged into,
|
|
135
|
+
// the postfixer will unify all the attributes of both sub-lists.
|
|
136
|
+
writer.setAttribute(attribute, {}, node);
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* View-to-model conversion helper preserving allowed attributes on {@link TODO}
|
|
144
|
+
* feature model element.
|
|
145
|
+
*
|
|
146
|
+
* @returns Returns a conversion callback.
|
|
147
|
+
*/
|
|
148
|
+
function viewToModelListAttributeConverter(attributeName, dataFilter) {
|
|
149
|
+
return (evt, data, conversionApi) => {
|
|
150
|
+
const viewElement = data.viewItem;
|
|
151
|
+
if (!data.modelRange) {
|
|
152
|
+
Object.assign(data, conversionApi.convertChildren(data.viewItem, data.modelCursor));
|
|
153
|
+
}
|
|
154
|
+
const viewAttributes = dataFilter.processViewAttributes(viewElement, conversionApi);
|
|
155
|
+
for (const item of data.modelRange.getItems({ shallow: true })) {
|
|
156
|
+
// Apply only to list item blocks.
|
|
157
|
+
if (!item.hasAttribute('listItemId')) {
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
// Set list attributes only on same level items, those nested deeper are already handled
|
|
161
|
+
// by the recursive conversion.
|
|
162
|
+
if (item.hasAttribute(attributeName)) {
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
if (conversionApi.writer.model.schema.checkAttribute(item, attributeName)) {
|
|
166
|
+
conversionApi.writer.setAttribute(attributeName, viewAttributes || {}, item);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Returns HTML attribute name based on provided list type.
|
|
173
|
+
*/
|
|
174
|
+
function getAttributeFromListType(listType) {
|
|
175
|
+
return listType === 'numbered' ?
|
|
176
|
+
'htmlOlAttributes' :
|
|
177
|
+
'htmlUlAttributes';
|
|
178
|
+
}
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
6
|
-
import DataFilter from '../datafilter';
|
|
7
|
-
/**
|
|
8
|
-
* Provides the General HTML Support integration for elements which can behave like sectioning element (e.g. article) or
|
|
9
|
-
* element accepting only inline content (e.g. paragraph).
|
|
10
|
-
*
|
|
11
|
-
* The distinction between this two content models is important for choosing correct schema model and proper content conversion.
|
|
12
|
-
* As an example, it ensures that:
|
|
13
|
-
*
|
|
14
|
-
* * children elements paragraphing is enabled for sectioning elements only,
|
|
15
|
-
* * element and its content can be correctly handled by editing view (splitting and merging elements),
|
|
16
|
-
* * model element HTML is semantically correct and easier to work with.
|
|
17
|
-
*
|
|
18
|
-
* If element contains any block element, it will be treated as a sectioning element and registered using
|
|
19
|
-
* {@link module:html-support/dataschema~DataSchemaDefinition#model} and
|
|
20
|
-
* {@link module:html-support/dataschema~DataSchemaDefinition#modelSchema} in editor schema.
|
|
21
|
-
* Otherwise, it will be registered under {@link module:html-support/dataschema~DataSchemaBlockElementDefinition#paragraphLikeModel} model
|
|
22
|
-
* name with model schema accepting only inline content (inheriting from `$block`).
|
|
23
|
-
*/
|
|
24
|
-
export default class DualContentModelElementSupport extends Plugin {
|
|
25
|
-
/**
|
|
26
|
-
* @inheritDoc
|
|
27
|
-
*/
|
|
28
|
-
static get requires(): readonly [typeof DataFilter];
|
|
29
|
-
/**
|
|
30
|
-
* @inheritDoc
|
|
31
|
-
*/
|
|
32
|
-
static get pluginName(): "DualContentModelElementSupport";
|
|
33
|
-
/**
|
|
34
|
-
* @inheritDoc
|
|
35
|
-
*/
|
|
36
|
-
init(): void;
|
|
37
|
-
/**
|
|
38
|
-
* Checks whether the given view element includes any other block element.
|
|
39
|
-
*/
|
|
40
|
-
private _hasBlockContent;
|
|
41
|
-
/**
|
|
42
|
-
* Adds attribute filtering conversion for the given data schema.
|
|
43
|
-
*/
|
|
44
|
-
private _addAttributeConversion;
|
|
45
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
6
|
+
import DataFilter from '../datafilter';
|
|
7
|
+
/**
|
|
8
|
+
* Provides the General HTML Support integration for elements which can behave like sectioning element (e.g. article) or
|
|
9
|
+
* element accepting only inline content (e.g. paragraph).
|
|
10
|
+
*
|
|
11
|
+
* The distinction between this two content models is important for choosing correct schema model and proper content conversion.
|
|
12
|
+
* As an example, it ensures that:
|
|
13
|
+
*
|
|
14
|
+
* * children elements paragraphing is enabled for sectioning elements only,
|
|
15
|
+
* * element and its content can be correctly handled by editing view (splitting and merging elements),
|
|
16
|
+
* * model element HTML is semantically correct and easier to work with.
|
|
17
|
+
*
|
|
18
|
+
* If element contains any block element, it will be treated as a sectioning element and registered using
|
|
19
|
+
* {@link module:html-support/dataschema~DataSchemaDefinition#model} and
|
|
20
|
+
* {@link module:html-support/dataschema~DataSchemaDefinition#modelSchema} in editor schema.
|
|
21
|
+
* Otherwise, it will be registered under {@link module:html-support/dataschema~DataSchemaBlockElementDefinition#paragraphLikeModel} model
|
|
22
|
+
* name with model schema accepting only inline content (inheriting from `$block`).
|
|
23
|
+
*/
|
|
24
|
+
export default class DualContentModelElementSupport extends Plugin {
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
static get requires(): readonly [typeof DataFilter];
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
static get pluginName(): "DualContentModelElementSupport";
|
|
33
|
+
/**
|
|
34
|
+
* @inheritDoc
|
|
35
|
+
*/
|
|
36
|
+
init(): void;
|
|
37
|
+
/**
|
|
38
|
+
* Checks whether the given view element includes any other block element.
|
|
39
|
+
*/
|
|
40
|
+
private _hasBlockContent;
|
|
41
|
+
/**
|
|
42
|
+
* Adds attribute filtering conversion for the given data schema.
|
|
43
|
+
*/
|
|
44
|
+
private _addAttributeConversion;
|
|
45
|
+
}
|