@ckeditor/ckeditor5-html-support 32.0.0 → 34.1.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 +2 -2
- package/README.md +2 -1
- package/build/html-support.js +2 -2
- package/build/translations/el.js +1 -0
- package/build/translations/en-au.js +1 -0
- package/build/translations/hr.js +1 -0
- package/build/translations/jv.js +1 -0
- package/build/translations/lv.js +1 -0
- package/build/translations/ur.js +1 -0
- package/lang/translations/el.po +21 -0
- package/lang/translations/en-au.po +21 -0
- package/lang/translations/hr.po +21 -0
- package/lang/translations/jv.po +21 -0
- package/lang/translations/lv.po +21 -0
- package/lang/translations/ur.po +21 -0
- package/package.json +31 -31
- package/src/conversionutils.js +48 -5
- package/src/converters.js +41 -22
- package/src/datafilter.js +141 -17
- package/src/dataschema.js +3 -0
- package/src/generalhtmlsupport.js +231 -1
- package/src/integrations/codeblock.js +6 -4
- package/src/integrations/documentlist.js +200 -0
- package/src/integrations/dualcontent.js +12 -3
- package/src/integrations/image.js +57 -27
- package/src/integrations/mediaembed.js +32 -8
- package/src/integrations/script.js +2 -1
- package/src/integrations/style.js +74 -0
- package/src/integrations/table.js +29 -7
- package/src/schemadefinitions.js +67 -67
- package/theme/datafilter.css +5 -0
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
|
|
10
10
|
import { Plugin } from 'ckeditor5/src/core';
|
|
11
11
|
|
|
12
|
-
import { setViewAttributes } from '../conversionutils.js';
|
|
13
12
|
import DataFilter from '../datafilter';
|
|
14
13
|
import DataSchema from '../dataschema';
|
|
14
|
+
import { updateViewAttributes } from '../conversionutils.js';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Provides the General HTML Support integration with {@link module:media-embed/mediaembed~MediaEmbed Media Embed} feature.
|
|
@@ -44,6 +44,10 @@ export default class MediaEmbedElementSupport extends Plugin {
|
|
|
44
44
|
view: mediaElementName
|
|
45
45
|
} );
|
|
46
46
|
|
|
47
|
+
dataFilter.on( 'register:figure', ( ) => {
|
|
48
|
+
conversion.for( 'upcast' ).add( viewToModelFigureAttributesConverter( dataFilter ) );
|
|
49
|
+
} );
|
|
50
|
+
|
|
47
51
|
dataFilter.on( `register:${ mediaElementName }`, ( evt, definition ) => {
|
|
48
52
|
if ( definition.model !== 'media' ) {
|
|
49
53
|
return;
|
|
@@ -71,16 +75,11 @@ function viewToModelMediaAttributesConverter( dataFilter, mediaElementName ) {
|
|
|
71
75
|
|
|
72
76
|
function upcastMedia( evt, data, conversionApi ) {
|
|
73
77
|
const viewMediaElement = data.viewItem;
|
|
74
|
-
const viewParent = viewMediaElement.parent;
|
|
75
78
|
|
|
76
79
|
preserveElementAttributes( viewMediaElement, 'htmlAttributes' );
|
|
77
80
|
|
|
78
|
-
if ( viewParent.is( 'element', 'figure' ) && viewParent.hasClass( 'media' ) ) {
|
|
79
|
-
preserveElementAttributes( viewParent, 'htmlFigureAttributes' );
|
|
80
|
-
}
|
|
81
|
-
|
|
82
81
|
function preserveElementAttributes( viewElement, attributeName ) {
|
|
83
|
-
const viewAttributes = dataFilter.
|
|
82
|
+
const viewAttributes = dataFilter.processViewAttributes( viewElement, conversionApi );
|
|
84
83
|
|
|
85
84
|
if ( viewAttributes ) {
|
|
86
85
|
conversionApi.writer.setAttribute( attributeName, viewAttributes, data.modelRange );
|
|
@@ -89,6 +88,30 @@ function viewToModelMediaAttributesConverter( dataFilter, mediaElementName ) {
|
|
|
89
88
|
}
|
|
90
89
|
}
|
|
91
90
|
|
|
91
|
+
// View-to-model conversion helper preserving allowed attributes on {@link module:media-embed/mediaembed~MediaEmbed MediaEmbed}
|
|
92
|
+
// feature model element from figure view element.
|
|
93
|
+
//
|
|
94
|
+
// @private
|
|
95
|
+
// @param {module:html-support/datafilter~DataFilter} dataFilter
|
|
96
|
+
// @returns {Function} Returns a conversion callback.
|
|
97
|
+
function viewToModelFigureAttributesConverter( dataFilter ) {
|
|
98
|
+
return dispatcher => {
|
|
99
|
+
dispatcher.on( 'element:figure', ( evt, data, conversionApi ) => {
|
|
100
|
+
const viewFigureElement = data.viewItem;
|
|
101
|
+
|
|
102
|
+
if ( !data.modelRange || !viewFigureElement.hasClass( 'media' ) ) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const viewAttributes = dataFilter.processViewAttributes( viewFigureElement, conversionApi );
|
|
107
|
+
|
|
108
|
+
if ( viewAttributes ) {
|
|
109
|
+
conversionApi.writer.setAttribute( 'htmlFigureAttributes', viewAttributes, data.modelRange );
|
|
110
|
+
}
|
|
111
|
+
}, { priority: 'low' } );
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
92
115
|
function modelToViewMediaAttributeConverter( mediaElementName ) {
|
|
93
116
|
return dispatcher => {
|
|
94
117
|
addAttributeConversionDispatcherHandler( mediaElementName, 'htmlAttributes' );
|
|
@@ -100,10 +123,11 @@ function modelToViewMediaAttributeConverter( mediaElementName ) {
|
|
|
100
123
|
return;
|
|
101
124
|
}
|
|
102
125
|
|
|
126
|
+
const { attributeOldValue, attributeNewValue } = data;
|
|
103
127
|
const containerElement = conversionApi.mapper.toViewElement( data.item );
|
|
104
128
|
const viewElement = getDescendantElement( conversionApi.writer, containerElement, elementName );
|
|
105
129
|
|
|
106
|
-
|
|
130
|
+
updateViewAttributes( conversionApi.writer, attributeOldValue, attributeNewValue, viewElement );
|
|
107
131
|
} );
|
|
108
132
|
}
|
|
109
133
|
};
|
|
@@ -44,7 +44,8 @@ export default class ScriptElementSupport extends Plugin {
|
|
|
44
44
|
schema.register( 'htmlScript', definition.modelSchema );
|
|
45
45
|
|
|
46
46
|
schema.extend( 'htmlScript', {
|
|
47
|
-
allowAttributes: [ 'htmlAttributes', 'htmlContent' ]
|
|
47
|
+
allowAttributes: [ 'htmlAttributes', 'htmlContent' ],
|
|
48
|
+
isContent: true
|
|
48
49
|
} );
|
|
49
50
|
|
|
50
51
|
editor.data.registerRawContentMatcher( {
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2022, 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
|
+
/**
|
|
7
|
+
* @module html-support/integrations/style
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
11
|
+
import {
|
|
12
|
+
createObjectView,
|
|
13
|
+
modelToViewBlockAttributeConverter,
|
|
14
|
+
viewToModelBlockAttributeConverter,
|
|
15
|
+
viewToModelObjectConverter
|
|
16
|
+
} from '../converters.js';
|
|
17
|
+
|
|
18
|
+
import DataFilter from '../datafilter';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Provides the General HTML Support for `style` elements.
|
|
22
|
+
*
|
|
23
|
+
* @extends module:core/plugin~Plugin
|
|
24
|
+
*/
|
|
25
|
+
export default class StyleElementSupport extends Plugin {
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
static get requires() {
|
|
30
|
+
return [ DataFilter ];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @inheritDoc
|
|
35
|
+
*/
|
|
36
|
+
init() {
|
|
37
|
+
const dataFilter = this.editor.plugins.get( DataFilter );
|
|
38
|
+
|
|
39
|
+
dataFilter.on( 'register:style', ( evt, definition ) => {
|
|
40
|
+
const editor = this.editor;
|
|
41
|
+
const schema = editor.model.schema;
|
|
42
|
+
const conversion = editor.conversion;
|
|
43
|
+
|
|
44
|
+
schema.register( 'htmlStyle', definition.modelSchema );
|
|
45
|
+
|
|
46
|
+
schema.extend( 'htmlStyle', {
|
|
47
|
+
allowAttributes: [ 'htmlAttributes', 'htmlContent' ],
|
|
48
|
+
isContent: true
|
|
49
|
+
} );
|
|
50
|
+
|
|
51
|
+
editor.data.registerRawContentMatcher( {
|
|
52
|
+
name: 'style'
|
|
53
|
+
} );
|
|
54
|
+
|
|
55
|
+
conversion.for( 'upcast' ).elementToElement( {
|
|
56
|
+
view: 'style',
|
|
57
|
+
model: viewToModelObjectConverter( definition )
|
|
58
|
+
} );
|
|
59
|
+
|
|
60
|
+
conversion.for( 'upcast' ).add( viewToModelBlockAttributeConverter( definition, dataFilter ) );
|
|
61
|
+
|
|
62
|
+
conversion.for( 'downcast' ).elementToElement( {
|
|
63
|
+
model: 'htmlStyle',
|
|
64
|
+
view: ( modelElement, { writer } ) => {
|
|
65
|
+
return createObjectView( 'style', modelElement, writer );
|
|
66
|
+
}
|
|
67
|
+
} );
|
|
68
|
+
|
|
69
|
+
conversion.for( 'downcast' ).add( modelToViewBlockAttributeConverter( definition ) );
|
|
70
|
+
|
|
71
|
+
evt.stop();
|
|
72
|
+
} );
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
|
|
10
10
|
import { Plugin } from 'ckeditor5/src/core';
|
|
11
11
|
import { setViewAttributes } from '../conversionutils.js';
|
|
12
|
-
|
|
13
12
|
import DataFilter from '../datafilter';
|
|
14
13
|
|
|
15
14
|
/**
|
|
@@ -39,6 +38,10 @@ export default class TableElementSupport extends Plugin {
|
|
|
39
38
|
const conversion = editor.conversion;
|
|
40
39
|
const dataFilter = editor.plugins.get( DataFilter );
|
|
41
40
|
|
|
41
|
+
dataFilter.on( 'register:figure', ( ) => {
|
|
42
|
+
conversion.for( 'upcast' ).add( viewToModelFigureAttributeConverter( dataFilter ) );
|
|
43
|
+
} );
|
|
44
|
+
|
|
42
45
|
dataFilter.on( 'register:table', ( evt, definition ) => {
|
|
43
46
|
if ( definition.model !== 'table' ) {
|
|
44
47
|
return;
|
|
@@ -74,11 +77,6 @@ function viewToModelTableAttributeConverter( dataFilter ) {
|
|
|
74
77
|
|
|
75
78
|
preserveElementAttributes( viewTableElement, 'htmlAttributes' );
|
|
76
79
|
|
|
77
|
-
const viewFigureElement = viewTableElement.parent;
|
|
78
|
-
if ( viewFigureElement.is( 'element', 'figure' ) ) {
|
|
79
|
-
preserveElementAttributes( viewFigureElement, 'htmlFigureAttributes' );
|
|
80
|
-
}
|
|
81
|
-
|
|
82
80
|
for ( const childNode of viewTableElement.getChildren() ) {
|
|
83
81
|
if ( childNode.is( 'element', 'thead' ) ) {
|
|
84
82
|
preserveElementAttributes( childNode, 'htmlTheadAttributes' );
|
|
@@ -90,12 +88,36 @@ function viewToModelTableAttributeConverter( dataFilter ) {
|
|
|
90
88
|
}
|
|
91
89
|
|
|
92
90
|
function preserveElementAttributes( viewElement, attributeName ) {
|
|
93
|
-
const viewAttributes = dataFilter.
|
|
91
|
+
const viewAttributes = dataFilter.processViewAttributes( viewElement, conversionApi );
|
|
94
92
|
|
|
95
93
|
if ( viewAttributes ) {
|
|
96
94
|
conversionApi.writer.setAttribute( attributeName, viewAttributes, data.modelRange );
|
|
97
95
|
}
|
|
98
96
|
}
|
|
97
|
+
} );
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// View-to-model conversion helper preserving allowed attributes on {@link module:table/table~Table Table}
|
|
102
|
+
// feature model element from figure view element.
|
|
103
|
+
//
|
|
104
|
+
// @private
|
|
105
|
+
// @param {module:html-support/datafilter~DataFilter} dataFilter
|
|
106
|
+
// @returns {Function} Returns a conversion callback.
|
|
107
|
+
function viewToModelFigureAttributeConverter( dataFilter ) {
|
|
108
|
+
return dispatcher => {
|
|
109
|
+
dispatcher.on( 'element:figure', ( evt, data, conversionApi ) => {
|
|
110
|
+
const viewFigureElement = data.viewItem;
|
|
111
|
+
|
|
112
|
+
if ( !data.modelRange || !viewFigureElement.hasClass( 'table' ) ) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const viewAttributes = dataFilter.processViewAttributes( viewFigureElement, conversionApi );
|
|
117
|
+
|
|
118
|
+
if ( viewAttributes ) {
|
|
119
|
+
conversionApi.writer.setAttribute( 'htmlFigureAttributes', viewAttributes, data.modelRange );
|
|
120
|
+
}
|
|
99
121
|
}, { priority: 'low' } );
|
|
100
122
|
};
|
|
101
123
|
}
|
package/src/schemadefinitions.js
CHANGED
|
@@ -108,14 +108,6 @@ export default {
|
|
|
108
108
|
},
|
|
109
109
|
|
|
110
110
|
// Compatibility features
|
|
111
|
-
{
|
|
112
|
-
model: '$htmlSection',
|
|
113
|
-
modelSchema: {
|
|
114
|
-
allowChildren: '$block',
|
|
115
|
-
allowIn: [ '$root', '$htmlSection' ],
|
|
116
|
-
isBlock: true
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
111
|
{
|
|
120
112
|
model: 'htmlP',
|
|
121
113
|
view: 'p',
|
|
@@ -127,14 +119,14 @@ export default {
|
|
|
127
119
|
model: 'htmlBlockquote',
|
|
128
120
|
view: 'blockquote',
|
|
129
121
|
modelSchema: {
|
|
130
|
-
inheritAllFrom: '$
|
|
122
|
+
inheritAllFrom: '$container'
|
|
131
123
|
}
|
|
132
124
|
},
|
|
133
125
|
{
|
|
134
126
|
model: 'htmlTable',
|
|
135
127
|
view: 'table',
|
|
136
128
|
modelSchema: {
|
|
137
|
-
|
|
129
|
+
allowWhere: '$block',
|
|
138
130
|
isBlock: true
|
|
139
131
|
}
|
|
140
132
|
},
|
|
@@ -175,8 +167,7 @@ export default {
|
|
|
175
167
|
model: 'htmlTr',
|
|
176
168
|
view: 'tr',
|
|
177
169
|
modelSchema: {
|
|
178
|
-
allowIn: [ 'htmlTable', 'htmlThead', 'htmlTbody' ]
|
|
179
|
-
isBlock: true
|
|
170
|
+
allowIn: [ 'htmlTable', 'htmlThead', 'htmlTbody' ]
|
|
180
171
|
}
|
|
181
172
|
},
|
|
182
173
|
// TODO can also include text.
|
|
@@ -185,8 +176,7 @@ export default {
|
|
|
185
176
|
view: 'td',
|
|
186
177
|
modelSchema: {
|
|
187
178
|
allowIn: 'htmlTr',
|
|
188
|
-
|
|
189
|
-
isBlock: true
|
|
179
|
+
allowContentOf: '$container'
|
|
190
180
|
}
|
|
191
181
|
},
|
|
192
182
|
// TODO can also include text.
|
|
@@ -195,8 +185,7 @@ export default {
|
|
|
195
185
|
view: 'th',
|
|
196
186
|
modelSchema: {
|
|
197
187
|
allowIn: 'htmlTr',
|
|
198
|
-
|
|
199
|
-
isBlock: true
|
|
188
|
+
allowContentOf: '$container'
|
|
200
189
|
}
|
|
201
190
|
},
|
|
202
191
|
// TODO can also include text.
|
|
@@ -204,7 +193,7 @@ export default {
|
|
|
204
193
|
model: 'htmlFigure',
|
|
205
194
|
view: 'figure',
|
|
206
195
|
modelSchema: {
|
|
207
|
-
inheritAllFrom: '$
|
|
196
|
+
inheritAllFrom: '$container',
|
|
208
197
|
isBlock: true
|
|
209
198
|
}
|
|
210
199
|
},
|
|
@@ -223,7 +212,8 @@ export default {
|
|
|
223
212
|
model: 'htmlAddress',
|
|
224
213
|
view: 'address',
|
|
225
214
|
modelSchema: {
|
|
226
|
-
inheritAllFrom: '$
|
|
215
|
+
inheritAllFrom: '$container',
|
|
216
|
+
isBlock: true
|
|
227
217
|
}
|
|
228
218
|
},
|
|
229
219
|
// TODO can also include text.
|
|
@@ -231,7 +221,8 @@ export default {
|
|
|
231
221
|
model: 'htmlAside',
|
|
232
222
|
view: 'aside',
|
|
233
223
|
modelSchema: {
|
|
234
|
-
inheritAllFrom: '$
|
|
224
|
+
inheritAllFrom: '$container',
|
|
225
|
+
isBlock: true
|
|
235
226
|
}
|
|
236
227
|
},
|
|
237
228
|
// TODO can also include text.
|
|
@@ -239,7 +230,8 @@ export default {
|
|
|
239
230
|
model: 'htmlMain',
|
|
240
231
|
view: 'main',
|
|
241
232
|
modelSchema: {
|
|
242
|
-
inheritAllFrom: '$
|
|
233
|
+
inheritAllFrom: '$container',
|
|
234
|
+
isBlock: true
|
|
243
235
|
}
|
|
244
236
|
},
|
|
245
237
|
// TODO can also include text.
|
|
@@ -247,7 +239,8 @@ export default {
|
|
|
247
239
|
model: 'htmlDetails',
|
|
248
240
|
view: 'details',
|
|
249
241
|
modelSchema: {
|
|
250
|
-
inheritAllFrom: '$
|
|
242
|
+
inheritAllFrom: '$container',
|
|
243
|
+
isBlock: true
|
|
251
244
|
}
|
|
252
245
|
},
|
|
253
246
|
{
|
|
@@ -264,7 +257,7 @@ export default {
|
|
|
264
257
|
view: 'div',
|
|
265
258
|
paragraphLikeModel: 'htmlDivParagraph',
|
|
266
259
|
modelSchema: {
|
|
267
|
-
inheritAllFrom: '$
|
|
260
|
+
inheritAllFrom: '$container'
|
|
268
261
|
}
|
|
269
262
|
},
|
|
270
263
|
// TODO can also include text.
|
|
@@ -272,7 +265,8 @@ export default {
|
|
|
272
265
|
model: 'htmlFieldset',
|
|
273
266
|
view: 'fieldset',
|
|
274
267
|
modelSchema: {
|
|
275
|
-
inheritAllFrom: '$
|
|
268
|
+
inheritAllFrom: '$container',
|
|
269
|
+
isBlock: true
|
|
276
270
|
}
|
|
277
271
|
},
|
|
278
272
|
// TODO can also include h1-h6.
|
|
@@ -289,7 +283,8 @@ export default {
|
|
|
289
283
|
model: 'htmlHeader',
|
|
290
284
|
view: 'header',
|
|
291
285
|
modelSchema: {
|
|
292
|
-
inheritAllFrom: '$
|
|
286
|
+
inheritAllFrom: '$container',
|
|
287
|
+
isBlock: true
|
|
293
288
|
}
|
|
294
289
|
},
|
|
295
290
|
// TODO can also include text.
|
|
@@ -297,7 +292,8 @@ export default {
|
|
|
297
292
|
model: 'htmlFooter',
|
|
298
293
|
view: 'footer',
|
|
299
294
|
modelSchema: {
|
|
300
|
-
inheritAllFrom: '$
|
|
295
|
+
inheritAllFrom: '$container',
|
|
296
|
+
isBlock: true
|
|
301
297
|
}
|
|
302
298
|
},
|
|
303
299
|
// TODO can also include text.
|
|
@@ -305,7 +301,8 @@ export default {
|
|
|
305
301
|
model: 'htmlForm',
|
|
306
302
|
view: 'form',
|
|
307
303
|
modelSchema: {
|
|
308
|
-
inheritAllFrom: '$
|
|
304
|
+
inheritAllFrom: '$container',
|
|
305
|
+
isBlock: true
|
|
309
306
|
}
|
|
310
307
|
},
|
|
311
308
|
{
|
|
@@ -368,7 +365,7 @@ export default {
|
|
|
368
365
|
{
|
|
369
366
|
model: '$htmlList',
|
|
370
367
|
modelSchema: {
|
|
371
|
-
allowWhere: '$
|
|
368
|
+
allowWhere: '$container',
|
|
372
369
|
allowChildren: [ '$htmlList', 'htmlLi' ],
|
|
373
370
|
isBlock: true
|
|
374
371
|
}
|
|
@@ -422,14 +419,16 @@ export default {
|
|
|
422
419
|
model: 'htmlArticle',
|
|
423
420
|
view: 'article',
|
|
424
421
|
modelSchema: {
|
|
425
|
-
inheritAllFrom: '$
|
|
422
|
+
inheritAllFrom: '$container',
|
|
423
|
+
isBlock: true
|
|
426
424
|
}
|
|
427
425
|
},
|
|
428
426
|
{
|
|
429
427
|
model: 'htmlSection',
|
|
430
428
|
view: 'section',
|
|
431
429
|
modelSchema: {
|
|
432
|
-
inheritAllFrom: '$
|
|
430
|
+
inheritAllFrom: '$container',
|
|
431
|
+
isBlock: true
|
|
433
432
|
}
|
|
434
433
|
},
|
|
435
434
|
// TODO can also include text.
|
|
@@ -437,14 +436,15 @@ export default {
|
|
|
437
436
|
model: 'htmlNav',
|
|
438
437
|
view: 'nav',
|
|
439
438
|
modelSchema: {
|
|
440
|
-
inheritAllFrom: '$
|
|
439
|
+
inheritAllFrom: '$container',
|
|
440
|
+
isBlock: true
|
|
441
441
|
}
|
|
442
442
|
},
|
|
443
443
|
{
|
|
444
444
|
model: 'htmlDl',
|
|
445
445
|
view: 'dl',
|
|
446
446
|
modelSchema: {
|
|
447
|
-
|
|
447
|
+
allowWhere: '$container',
|
|
448
448
|
allowChildren: [ 'htmlDt', 'htmlDd' ],
|
|
449
449
|
isBlock: true
|
|
450
450
|
}
|
|
@@ -469,17 +469,8 @@ export default {
|
|
|
469
469
|
model: 'htmlCenter',
|
|
470
470
|
view: 'center',
|
|
471
471
|
modelSchema: {
|
|
472
|
-
inheritAllFrom: '$
|
|
473
|
-
|
|
474
|
-
},
|
|
475
|
-
// Objects
|
|
476
|
-
{
|
|
477
|
-
model: '$htmlObjectBlock',
|
|
478
|
-
isObject: true,
|
|
479
|
-
modelSchema: {
|
|
480
|
-
isObject: true,
|
|
481
|
-
isBlock: true,
|
|
482
|
-
allowWhere: '$block'
|
|
472
|
+
inheritAllFrom: '$container',
|
|
473
|
+
isBlock: true
|
|
483
474
|
}
|
|
484
475
|
}
|
|
485
476
|
],
|
|
@@ -586,6 +577,7 @@ export default {
|
|
|
586
577
|
model: 'htmlA',
|
|
587
578
|
view: 'a',
|
|
588
579
|
priority: 5,
|
|
580
|
+
coupledAttribute: 'linkHref',
|
|
589
581
|
attributeProperties: {
|
|
590
582
|
copyOnEnter: true
|
|
591
583
|
}
|
|
@@ -593,6 +585,7 @@ export default {
|
|
|
593
585
|
{
|
|
594
586
|
model: 'htmlStrong',
|
|
595
587
|
view: 'strong',
|
|
588
|
+
coupledAttribute: 'bold',
|
|
596
589
|
attributeProperties: {
|
|
597
590
|
copyOnEnter: true
|
|
598
591
|
}
|
|
@@ -600,6 +593,7 @@ export default {
|
|
|
600
593
|
{
|
|
601
594
|
model: 'htmlB',
|
|
602
595
|
view: 'b',
|
|
596
|
+
coupledAttribute: 'bold',
|
|
603
597
|
attributeProperties: {
|
|
604
598
|
copyOnEnter: true
|
|
605
599
|
}
|
|
@@ -607,6 +601,7 @@ export default {
|
|
|
607
601
|
{
|
|
608
602
|
model: 'htmlI',
|
|
609
603
|
view: 'i',
|
|
604
|
+
coupledAttribute: 'italic',
|
|
610
605
|
attributeProperties: {
|
|
611
606
|
copyOnEnter: true
|
|
612
607
|
}
|
|
@@ -614,6 +609,7 @@ export default {
|
|
|
614
609
|
{
|
|
615
610
|
model: 'htmlEm',
|
|
616
611
|
view: 'em',
|
|
612
|
+
coupledAttribute: 'italic',
|
|
617
613
|
attributeProperties: {
|
|
618
614
|
copyOnEnter: true
|
|
619
615
|
}
|
|
@@ -621,6 +617,7 @@ export default {
|
|
|
621
617
|
{
|
|
622
618
|
model: 'htmlS',
|
|
623
619
|
view: 's',
|
|
620
|
+
coupledAttribute: 'strikethrough',
|
|
624
621
|
attributeProperties: {
|
|
625
622
|
copyOnEnter: true
|
|
626
623
|
}
|
|
@@ -629,6 +626,7 @@ export default {
|
|
|
629
626
|
{
|
|
630
627
|
model: 'htmlDel',
|
|
631
628
|
view: 'del',
|
|
629
|
+
coupledAttribute: 'strikethrough',
|
|
632
630
|
attributeProperties: {
|
|
633
631
|
copyOnEnter: true
|
|
634
632
|
}
|
|
@@ -644,6 +642,7 @@ export default {
|
|
|
644
642
|
{
|
|
645
643
|
model: 'htmlU',
|
|
646
644
|
view: 'u',
|
|
645
|
+
coupledAttribute: 'underline',
|
|
647
646
|
attributeProperties: {
|
|
648
647
|
copyOnEnter: true
|
|
649
648
|
}
|
|
@@ -651,6 +650,7 @@ export default {
|
|
|
651
650
|
{
|
|
652
651
|
model: 'htmlSub',
|
|
653
652
|
view: 'sub',
|
|
653
|
+
coupledAttribute: 'subscript',
|
|
654
654
|
attributeProperties: {
|
|
655
655
|
copyOnEnter: true
|
|
656
656
|
}
|
|
@@ -658,6 +658,7 @@ export default {
|
|
|
658
658
|
{
|
|
659
659
|
model: 'htmlSup',
|
|
660
660
|
view: 'sup',
|
|
661
|
+
coupledAttribute: 'superscript',
|
|
661
662
|
attributeProperties: {
|
|
662
663
|
copyOnEnter: true
|
|
663
664
|
}
|
|
@@ -665,6 +666,7 @@ export default {
|
|
|
665
666
|
{
|
|
666
667
|
model: 'htmlCode',
|
|
667
668
|
view: 'code',
|
|
669
|
+
coupledAttribute: 'code',
|
|
668
670
|
attributeProperties: {
|
|
669
671
|
copyOnEnter: true
|
|
670
672
|
}
|
|
@@ -706,22 +708,12 @@ export default {
|
|
|
706
708
|
},
|
|
707
709
|
|
|
708
710
|
// Objects
|
|
709
|
-
{
|
|
710
|
-
model: '$htmlObjectInline',
|
|
711
|
-
isObject: true,
|
|
712
|
-
modelSchema: {
|
|
713
|
-
isObject: true,
|
|
714
|
-
isInline: true,
|
|
715
|
-
allowWhere: '$text',
|
|
716
|
-
allowAttributesOf: '$text'
|
|
717
|
-
}
|
|
718
|
-
},
|
|
719
711
|
{
|
|
720
712
|
model: 'htmlObject',
|
|
721
713
|
view: 'object',
|
|
722
714
|
isObject: true,
|
|
723
715
|
modelSchema: {
|
|
724
|
-
inheritAllFrom: '$
|
|
716
|
+
inheritAllFrom: '$inlineObject'
|
|
725
717
|
}
|
|
726
718
|
},
|
|
727
719
|
{
|
|
@@ -729,7 +721,7 @@ export default {
|
|
|
729
721
|
view: 'iframe',
|
|
730
722
|
isObject: true,
|
|
731
723
|
modelSchema: {
|
|
732
|
-
inheritAllFrom: '$
|
|
724
|
+
inheritAllFrom: '$inlineObject'
|
|
733
725
|
}
|
|
734
726
|
},
|
|
735
727
|
{
|
|
@@ -737,7 +729,7 @@ export default {
|
|
|
737
729
|
view: 'input',
|
|
738
730
|
isObject: true,
|
|
739
731
|
modelSchema: {
|
|
740
|
-
inheritAllFrom: '$
|
|
732
|
+
inheritAllFrom: '$inlineObject'
|
|
741
733
|
}
|
|
742
734
|
},
|
|
743
735
|
{
|
|
@@ -745,7 +737,7 @@ export default {
|
|
|
745
737
|
view: 'button',
|
|
746
738
|
isObject: true,
|
|
747
739
|
modelSchema: {
|
|
748
|
-
inheritAllFrom: '$
|
|
740
|
+
inheritAllFrom: '$inlineObject'
|
|
749
741
|
}
|
|
750
742
|
},
|
|
751
743
|
{
|
|
@@ -753,7 +745,7 @@ export default {
|
|
|
753
745
|
view: 'textarea',
|
|
754
746
|
isObject: true,
|
|
755
747
|
modelSchema: {
|
|
756
|
-
inheritAllFrom: '$
|
|
748
|
+
inheritAllFrom: '$inlineObject'
|
|
757
749
|
}
|
|
758
750
|
},
|
|
759
751
|
{
|
|
@@ -761,7 +753,7 @@ export default {
|
|
|
761
753
|
view: 'select',
|
|
762
754
|
isObject: true,
|
|
763
755
|
modelSchema: {
|
|
764
|
-
inheritAllFrom: '$
|
|
756
|
+
inheritAllFrom: '$inlineObject'
|
|
765
757
|
}
|
|
766
758
|
},
|
|
767
759
|
{
|
|
@@ -769,7 +761,7 @@ export default {
|
|
|
769
761
|
view: 'video',
|
|
770
762
|
isObject: true,
|
|
771
763
|
modelSchema: {
|
|
772
|
-
inheritAllFrom: '$
|
|
764
|
+
inheritAllFrom: '$inlineObject'
|
|
773
765
|
}
|
|
774
766
|
},
|
|
775
767
|
{
|
|
@@ -777,7 +769,7 @@ export default {
|
|
|
777
769
|
view: 'embed',
|
|
778
770
|
isObject: true,
|
|
779
771
|
modelSchema: {
|
|
780
|
-
inheritAllFrom: '$
|
|
772
|
+
inheritAllFrom: '$inlineObject'
|
|
781
773
|
}
|
|
782
774
|
},
|
|
783
775
|
{
|
|
@@ -785,7 +777,7 @@ export default {
|
|
|
785
777
|
view: 'oembed',
|
|
786
778
|
isObject: true,
|
|
787
779
|
modelSchema: {
|
|
788
|
-
inheritAllFrom: '$
|
|
780
|
+
inheritAllFrom: '$inlineObject'
|
|
789
781
|
}
|
|
790
782
|
},
|
|
791
783
|
{
|
|
@@ -793,7 +785,7 @@ export default {
|
|
|
793
785
|
view: 'audio',
|
|
794
786
|
isObject: true,
|
|
795
787
|
modelSchema: {
|
|
796
|
-
inheritAllFrom: '$
|
|
788
|
+
inheritAllFrom: '$inlineObject'
|
|
797
789
|
}
|
|
798
790
|
},
|
|
799
791
|
{
|
|
@@ -801,7 +793,7 @@ export default {
|
|
|
801
793
|
view: 'img',
|
|
802
794
|
isObject: true,
|
|
803
795
|
modelSchema: {
|
|
804
|
-
inheritAllFrom: '$
|
|
796
|
+
inheritAllFrom: '$inlineObject'
|
|
805
797
|
}
|
|
806
798
|
},
|
|
807
799
|
{
|
|
@@ -809,7 +801,7 @@ export default {
|
|
|
809
801
|
view: 'canvas',
|
|
810
802
|
isObject: true,
|
|
811
803
|
modelSchema: {
|
|
812
|
-
inheritAllFrom: '$
|
|
804
|
+
inheritAllFrom: '$inlineObject'
|
|
813
805
|
}
|
|
814
806
|
},
|
|
815
807
|
// TODO it could be probably represented as non-object element, although it has graphical representation,
|
|
@@ -819,17 +811,17 @@ export default {
|
|
|
819
811
|
view: 'meter',
|
|
820
812
|
isObject: true,
|
|
821
813
|
modelSchema: {
|
|
822
|
-
inheritAllFrom: '$
|
|
814
|
+
inheritAllFrom: '$inlineObject'
|
|
823
815
|
}
|
|
824
816
|
},
|
|
825
|
-
// TODO it could be probably represented as non-object element, although it has
|
|
817
|
+
// TODO it could be probably represented as non-object element, although it has graphical representation,
|
|
826
818
|
// so probably makes more sense to keep it as an object.
|
|
827
819
|
{
|
|
828
820
|
model: 'htmlProgress',
|
|
829
821
|
view: 'progress',
|
|
830
822
|
isObject: true,
|
|
831
823
|
modelSchema: {
|
|
832
|
-
inheritAllFrom: '$
|
|
824
|
+
inheritAllFrom: '$inlineObject'
|
|
833
825
|
}
|
|
834
826
|
},
|
|
835
827
|
{
|
|
@@ -839,6 +831,14 @@ export default {
|
|
|
839
831
|
allowWhere: [ '$text', '$block' ],
|
|
840
832
|
isInline: true
|
|
841
833
|
}
|
|
834
|
+
},
|
|
835
|
+
{
|
|
836
|
+
model: 'htmlStyle',
|
|
837
|
+
view: 'style',
|
|
838
|
+
modelSchema: {
|
|
839
|
+
allowWhere: [ '$text', '$block' ],
|
|
840
|
+
isInline: true
|
|
841
|
+
}
|
|
842
842
|
}
|
|
843
843
|
]
|
|
844
844
|
};
|
package/theme/datafilter.css
CHANGED