@ckeditor/ckeditor5-html-support 33.0.0 → 34.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/README.md +2 -1
- package/build/html-support.js +1 -1
- package/build/html-support.js.map +1 -1
- package/build/translations/en-au.js +1 -0
- package/build/translations/hr.js +1 -0
- package/build/translations/jv.js +1 -0
- package/lang/translations/en-au.po +21 -0
- package/lang/translations/hr.po +21 -0
- package/lang/translations/jv.po +21 -0
- package/package.json +31 -31
- package/src/conversionutils.js +48 -5
- package/src/converters.js +18 -12
- package/src/datafilter.js +7 -1
- package/src/generalhtmlsupport.js +229 -1
- package/src/integrations/codeblock.js +5 -3
- package/src/integrations/documentlist.js +200 -0
- package/src/integrations/image.js +28 -17
- package/src/integrations/mediaembed.js +3 -2
- package/src/schemadefinitions.js +47 -66
- package/theme/datafilter.css +5 -0
|
@@ -0,0 +1,200 @@
|
|
|
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/documentlist
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { isEqual } from 'lodash-es';
|
|
11
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
12
|
+
import { setViewAttributes } from '../conversionutils.js';
|
|
13
|
+
|
|
14
|
+
import DataFilter from '../datafilter';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Provides the General HTML Support integration with {@link module:list/documentlist~DocumentList Document List} feature.
|
|
18
|
+
*
|
|
19
|
+
* @extends module:core/plugin~Plugin
|
|
20
|
+
*/
|
|
21
|
+
export default class DocumentListElementSupport extends Plugin {
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
static get requires() {
|
|
26
|
+
return [ DataFilter ];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
init() {
|
|
33
|
+
const editor = this.editor;
|
|
34
|
+
|
|
35
|
+
if ( !editor.plugins.has( 'DocumentListEditing' ) ) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const schema = editor.model.schema;
|
|
40
|
+
const conversion = editor.conversion;
|
|
41
|
+
const dataFilter = editor.plugins.get( DataFilter );
|
|
42
|
+
const documentListEditing = editor.plugins.get( 'DocumentListEditing' );
|
|
43
|
+
|
|
44
|
+
// Register downcast strategy.
|
|
45
|
+
// Note that this must be done before document list editing registers conversion in afterInit.
|
|
46
|
+
documentListEditing.registerDowncastStrategy( {
|
|
47
|
+
scope: 'item',
|
|
48
|
+
attributeName: 'htmlLiAttributes',
|
|
49
|
+
|
|
50
|
+
setAttributeOnDowncast( writer, attributeValue, viewElement ) {
|
|
51
|
+
setViewAttributes( writer, attributeValue, viewElement );
|
|
52
|
+
}
|
|
53
|
+
} );
|
|
54
|
+
|
|
55
|
+
documentListEditing.registerDowncastStrategy( {
|
|
56
|
+
scope: 'list',
|
|
57
|
+
attributeName: 'htmlListAttributes',
|
|
58
|
+
|
|
59
|
+
setAttributeOnDowncast( writer, viewAttributes, viewElement ) {
|
|
60
|
+
setViewAttributes( writer, viewAttributes, viewElement );
|
|
61
|
+
}
|
|
62
|
+
} );
|
|
63
|
+
|
|
64
|
+
dataFilter.on( 'register', ( evt, definition ) => {
|
|
65
|
+
if ( ![ 'ul', 'ol', 'li' ].includes( definition.view ) ) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
evt.stop();
|
|
70
|
+
|
|
71
|
+
// Do not register same converters twice.
|
|
72
|
+
if ( schema.checkAttribute( '$block', 'htmlListAttributes' ) ) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
schema.extend( '$block', { allowAttributes: [ 'htmlListAttributes', 'htmlLiAttributes' ] } );
|
|
77
|
+
schema.extend( '$blockObject', { allowAttributes: [ 'htmlListAttributes', 'htmlLiAttributes' ] } );
|
|
78
|
+
schema.extend( '$container', { allowAttributes: [ 'htmlListAttributes', 'htmlLiAttributes' ] } );
|
|
79
|
+
|
|
80
|
+
conversion.for( 'upcast' ).add( dispatcher => {
|
|
81
|
+
dispatcher.on( 'element:ul', viewToModelListAttributeConverter( 'htmlListAttributes', dataFilter ), { priority: 'low' } );
|
|
82
|
+
dispatcher.on( 'element:ol', viewToModelListAttributeConverter( 'htmlListAttributes', dataFilter ), { priority: 'low' } );
|
|
83
|
+
dispatcher.on( 'element:li', viewToModelListAttributeConverter( 'htmlLiAttributes', dataFilter ), { priority: 'low' } );
|
|
84
|
+
} );
|
|
85
|
+
} );
|
|
86
|
+
|
|
87
|
+
// Make sure that all items in a single list (items at the same level & listType) have the same properties.
|
|
88
|
+
// Note: This is almost exact copy from DocumentListPropertiesEditing.
|
|
89
|
+
documentListEditing.on( 'postFixer', ( evt, { listNodes, writer } ) => {
|
|
90
|
+
const previousNodesByIndent = []; // Last seen nodes of lower indented lists.
|
|
91
|
+
|
|
92
|
+
for ( const { node, previous } of listNodes ) {
|
|
93
|
+
// For the first list block there is nothing to compare with.
|
|
94
|
+
if ( !previous ) {
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const nodeIndent = node.getAttribute( 'listIndent' );
|
|
99
|
+
const previousNodeIndent = previous.getAttribute( 'listIndent' );
|
|
100
|
+
|
|
101
|
+
let previousNodeInList = null; // It's like `previous` but has the same indent as current node.
|
|
102
|
+
|
|
103
|
+
// Let's find previous node for the same indent.
|
|
104
|
+
// We're going to need that when we get back to previous indent.
|
|
105
|
+
if ( nodeIndent > previousNodeIndent ) {
|
|
106
|
+
previousNodesByIndent[ previousNodeIndent ] = previous;
|
|
107
|
+
}
|
|
108
|
+
// Restore the one for given indent.
|
|
109
|
+
else if ( nodeIndent < previousNodeIndent ) {
|
|
110
|
+
previousNodeInList = previousNodesByIndent[ nodeIndent ];
|
|
111
|
+
previousNodesByIndent.length = nodeIndent;
|
|
112
|
+
}
|
|
113
|
+
// Same indent.
|
|
114
|
+
else {
|
|
115
|
+
previousNodeInList = previous;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// This is a first item of a nested list.
|
|
119
|
+
if ( !previousNodeInList ) {
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if ( previousNodeInList.getAttribute( 'listType' ) == node.getAttribute( 'listType' ) ) {
|
|
124
|
+
const value = previousNodeInList.getAttribute( 'htmlListAttributes' );
|
|
125
|
+
|
|
126
|
+
if ( !isEqual( node.getAttribute( 'htmlListAttributes' ), value ) ) {
|
|
127
|
+
writer.setAttribute( 'htmlListAttributes', value, node );
|
|
128
|
+
evt.return = true;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if ( previousNodeInList.getAttribute( 'listItemId' ) == node.getAttribute( 'listItemId' ) ) {
|
|
133
|
+
const value = previousNodeInList.getAttribute( 'htmlLiAttributes' );
|
|
134
|
+
|
|
135
|
+
if ( !isEqual( node.getAttribute( 'htmlLiAttributes' ), value ) ) {
|
|
136
|
+
writer.setAttribute( 'htmlLiAttributes', value, node );
|
|
137
|
+
evt.return = true;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
} );
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* @inheritDoc
|
|
146
|
+
*/
|
|
147
|
+
afterInit() {
|
|
148
|
+
const editor = this.editor;
|
|
149
|
+
|
|
150
|
+
if ( !editor.commands.get( 'indentList' ) ) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Reset list attributes after indenting list items.
|
|
155
|
+
this.listenTo( editor.commands.get( 'indentList' ), 'afterExecute', ( evt, changedBlocks ) => {
|
|
156
|
+
editor.model.change( writer => {
|
|
157
|
+
for ( const node of changedBlocks ) {
|
|
158
|
+
// Just reset the attribute.
|
|
159
|
+
// If there is a previous indented list that this node should be merged into,
|
|
160
|
+
// the postfixer will unify all the attributes of both sub-lists.
|
|
161
|
+
writer.setAttribute( 'htmlListAttributes', {}, node );
|
|
162
|
+
}
|
|
163
|
+
} );
|
|
164
|
+
} );
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// View-to-model conversion helper preserving allowed attributes on {@link TODO}
|
|
169
|
+
// feature model element.
|
|
170
|
+
//
|
|
171
|
+
// @private
|
|
172
|
+
// @param {String} attributeName
|
|
173
|
+
// @param {module:html-support/datafilter~DataFilter} dataFilter
|
|
174
|
+
// @returns {Function} Returns a conversion callback.
|
|
175
|
+
function viewToModelListAttributeConverter( attributeName, dataFilter ) {
|
|
176
|
+
return ( evt, data, conversionApi ) => {
|
|
177
|
+
const viewElement = data.viewItem;
|
|
178
|
+
|
|
179
|
+
if ( !data.modelRange ) {
|
|
180
|
+
Object.assign( data, conversionApi.convertChildren( data.viewItem, data.modelCursor ) );
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const viewAttributes = dataFilter._consumeAllowedAttributes( viewElement, conversionApi );
|
|
184
|
+
|
|
185
|
+
for ( const item of data.modelRange.getItems( { shallow: true } ) ) {
|
|
186
|
+
// Apply only to list item blocks.
|
|
187
|
+
if ( !item.hasAttribute( 'listItemId' ) ) {
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// Set list attributes only on same level items, those nested deeper are already handled
|
|
192
|
+
// by the recursive conversion.
|
|
193
|
+
if ( item.hasAttribute( attributeName ) ) {
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
conversionApi.writer.setAttribute( attributeName, viewAttributes || {}, item );
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
}
|
|
@@ -10,7 +10,10 @@
|
|
|
10
10
|
import { Plugin } from 'ckeditor5/src/core';
|
|
11
11
|
|
|
12
12
|
import DataFilter from '../datafilter';
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
setViewAttributes,
|
|
15
|
+
updateViewAttributes
|
|
16
|
+
} from '../conversionutils.js';
|
|
14
17
|
|
|
15
18
|
/**
|
|
16
19
|
* Provides the General HTML Support integration with the {@link module:image/image~Image Image} feature.
|
|
@@ -84,6 +87,10 @@ export default class ImageElementSupport extends Plugin {
|
|
|
84
87
|
function viewToModelImageAttributeConverter( dataFilter ) {
|
|
85
88
|
return dispatcher => {
|
|
86
89
|
dispatcher.on( 'element:img', ( evt, data, conversionApi ) => {
|
|
90
|
+
if ( !data.modelRange ) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
87
94
|
const viewImageElement = data.viewItem;
|
|
88
95
|
const viewContainerElement = viewImageElement.parent;
|
|
89
96
|
|
|
@@ -130,7 +137,7 @@ function modelToViewImageAttributeConverter() {
|
|
|
130
137
|
|
|
131
138
|
addBlockAttributeConversion( 'img', 'htmlAttributes' );
|
|
132
139
|
addBlockAttributeConversion( 'figure', 'htmlFigureAttributes' );
|
|
133
|
-
|
|
140
|
+
addBlockAttributeConversion( 'a', 'htmlLinkAttributes' );
|
|
134
141
|
|
|
135
142
|
function addInlineAttributeConversion( attributeName ) {
|
|
136
143
|
dispatcher.on( `attribute:${ attributeName }:imageInline`, ( evt, data, conversionApi ) => {
|
|
@@ -138,38 +145,42 @@ function modelToViewImageAttributeConverter() {
|
|
|
138
145
|
return;
|
|
139
146
|
}
|
|
140
147
|
|
|
148
|
+
const { attributeOldValue, attributeNewValue } = data;
|
|
141
149
|
const viewElement = conversionApi.mapper.toViewElement( data.item );
|
|
142
150
|
|
|
143
|
-
|
|
151
|
+
updateViewAttributes( conversionApi.writer, attributeOldValue, attributeNewValue, viewElement );
|
|
144
152
|
}, { priority: 'low' } );
|
|
145
153
|
}
|
|
146
154
|
|
|
147
155
|
function addBlockAttributeConversion( elementName, attributeName ) {
|
|
148
156
|
dispatcher.on( `attribute:${ attributeName }:imageBlock`, ( evt, data, conversionApi ) => {
|
|
149
|
-
if ( !conversionApi.consumable.
|
|
157
|
+
if ( !conversionApi.consumable.test( data.item, evt.name ) ) {
|
|
150
158
|
return;
|
|
151
159
|
}
|
|
152
160
|
|
|
161
|
+
const { attributeOldValue, attributeNewValue } = data;
|
|
153
162
|
const containerElement = conversionApi.mapper.toViewElement( data.item );
|
|
154
163
|
const viewElement = getDescendantElement( conversionApi.writer, containerElement, elementName );
|
|
155
164
|
|
|
156
|
-
|
|
165
|
+
if ( viewElement ) {
|
|
166
|
+
updateViewAttributes( conversionApi.writer, attributeOldValue, attributeNewValue, viewElement );
|
|
167
|
+
conversionApi.consumable.consume( data.item, evt.name );
|
|
168
|
+
}
|
|
157
169
|
}, { priority: 'low' } );
|
|
158
|
-
}
|
|
159
170
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
171
|
+
if ( elementName === 'a' ) {
|
|
172
|
+
// To have a link element in the view, we need to attach a converter to the `linkHref` attribute as well.
|
|
173
|
+
dispatcher.on( 'attribute:linkHref:imageBlock', ( evt, data, conversionApi ) => {
|
|
174
|
+
if ( !conversionApi.consumable.consume( data.item, 'attribute:htmlLinkAttributes:imageBlock' ) ) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
167
177
|
|
|
168
|
-
|
|
169
|
-
|
|
178
|
+
const containerElement = conversionApi.mapper.toViewElement( data.item );
|
|
179
|
+
const viewElement = getDescendantElement( conversionApi.writer, containerElement, 'a' );
|
|
170
180
|
|
|
171
|
-
|
|
172
|
-
|
|
181
|
+
setViewAttributes( conversionApi.writer, data.item.getAttribute( 'htmlLinkAttributes' ), viewElement );
|
|
182
|
+
}, { priority: 'low' } );
|
|
183
|
+
}
|
|
173
184
|
}
|
|
174
185
|
};
|
|
175
186
|
}
|
|
@@ -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.
|
|
@@ -100,10 +100,11 @@ function modelToViewMediaAttributeConverter( mediaElementName ) {
|
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
const { attributeOldValue, attributeNewValue } = data;
|
|
103
104
|
const containerElement = conversionApi.mapper.toViewElement( data.item );
|
|
104
105
|
const viewElement = getDescendantElement( conversionApi.writer, containerElement, elementName );
|
|
105
106
|
|
|
106
|
-
|
|
107
|
+
updateViewAttributes( conversionApi.writer, attributeOldValue, attributeNewValue, viewElement );
|
|
107
108
|
} );
|
|
108
109
|
}
|
|
109
110
|
};
|
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
|
],
|
|
@@ -706,22 +697,12 @@ export default {
|
|
|
706
697
|
},
|
|
707
698
|
|
|
708
699
|
// 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
700
|
{
|
|
720
701
|
model: 'htmlObject',
|
|
721
702
|
view: 'object',
|
|
722
703
|
isObject: true,
|
|
723
704
|
modelSchema: {
|
|
724
|
-
inheritAllFrom: '$
|
|
705
|
+
inheritAllFrom: '$inlineObject'
|
|
725
706
|
}
|
|
726
707
|
},
|
|
727
708
|
{
|
|
@@ -729,7 +710,7 @@ export default {
|
|
|
729
710
|
view: 'iframe',
|
|
730
711
|
isObject: true,
|
|
731
712
|
modelSchema: {
|
|
732
|
-
inheritAllFrom: '$
|
|
713
|
+
inheritAllFrom: '$inlineObject'
|
|
733
714
|
}
|
|
734
715
|
},
|
|
735
716
|
{
|
|
@@ -737,7 +718,7 @@ export default {
|
|
|
737
718
|
view: 'input',
|
|
738
719
|
isObject: true,
|
|
739
720
|
modelSchema: {
|
|
740
|
-
inheritAllFrom: '$
|
|
721
|
+
inheritAllFrom: '$inlineObject'
|
|
741
722
|
}
|
|
742
723
|
},
|
|
743
724
|
{
|
|
@@ -745,7 +726,7 @@ export default {
|
|
|
745
726
|
view: 'button',
|
|
746
727
|
isObject: true,
|
|
747
728
|
modelSchema: {
|
|
748
|
-
inheritAllFrom: '$
|
|
729
|
+
inheritAllFrom: '$inlineObject'
|
|
749
730
|
}
|
|
750
731
|
},
|
|
751
732
|
{
|
|
@@ -753,7 +734,7 @@ export default {
|
|
|
753
734
|
view: 'textarea',
|
|
754
735
|
isObject: true,
|
|
755
736
|
modelSchema: {
|
|
756
|
-
inheritAllFrom: '$
|
|
737
|
+
inheritAllFrom: '$inlineObject'
|
|
757
738
|
}
|
|
758
739
|
},
|
|
759
740
|
{
|
|
@@ -761,7 +742,7 @@ export default {
|
|
|
761
742
|
view: 'select',
|
|
762
743
|
isObject: true,
|
|
763
744
|
modelSchema: {
|
|
764
|
-
inheritAllFrom: '$
|
|
745
|
+
inheritAllFrom: '$inlineObject'
|
|
765
746
|
}
|
|
766
747
|
},
|
|
767
748
|
{
|
|
@@ -769,7 +750,7 @@ export default {
|
|
|
769
750
|
view: 'video',
|
|
770
751
|
isObject: true,
|
|
771
752
|
modelSchema: {
|
|
772
|
-
inheritAllFrom: '$
|
|
753
|
+
inheritAllFrom: '$inlineObject'
|
|
773
754
|
}
|
|
774
755
|
},
|
|
775
756
|
{
|
|
@@ -777,7 +758,7 @@ export default {
|
|
|
777
758
|
view: 'embed',
|
|
778
759
|
isObject: true,
|
|
779
760
|
modelSchema: {
|
|
780
|
-
inheritAllFrom: '$
|
|
761
|
+
inheritAllFrom: '$inlineObject'
|
|
781
762
|
}
|
|
782
763
|
},
|
|
783
764
|
{
|
|
@@ -785,7 +766,7 @@ export default {
|
|
|
785
766
|
view: 'oembed',
|
|
786
767
|
isObject: true,
|
|
787
768
|
modelSchema: {
|
|
788
|
-
inheritAllFrom: '$
|
|
769
|
+
inheritAllFrom: '$inlineObject'
|
|
789
770
|
}
|
|
790
771
|
},
|
|
791
772
|
{
|
|
@@ -793,7 +774,7 @@ export default {
|
|
|
793
774
|
view: 'audio',
|
|
794
775
|
isObject: true,
|
|
795
776
|
modelSchema: {
|
|
796
|
-
inheritAllFrom: '$
|
|
777
|
+
inheritAllFrom: '$inlineObject'
|
|
797
778
|
}
|
|
798
779
|
},
|
|
799
780
|
{
|
|
@@ -801,7 +782,7 @@ export default {
|
|
|
801
782
|
view: 'img',
|
|
802
783
|
isObject: true,
|
|
803
784
|
modelSchema: {
|
|
804
|
-
inheritAllFrom: '$
|
|
785
|
+
inheritAllFrom: '$inlineObject'
|
|
805
786
|
}
|
|
806
787
|
},
|
|
807
788
|
{
|
|
@@ -809,7 +790,7 @@ export default {
|
|
|
809
790
|
view: 'canvas',
|
|
810
791
|
isObject: true,
|
|
811
792
|
modelSchema: {
|
|
812
|
-
inheritAllFrom: '$
|
|
793
|
+
inheritAllFrom: '$inlineObject'
|
|
813
794
|
}
|
|
814
795
|
},
|
|
815
796
|
// TODO it could be probably represented as non-object element, although it has graphical representation,
|
|
@@ -819,7 +800,7 @@ export default {
|
|
|
819
800
|
view: 'meter',
|
|
820
801
|
isObject: true,
|
|
821
802
|
modelSchema: {
|
|
822
|
-
inheritAllFrom: '$
|
|
803
|
+
inheritAllFrom: '$inlineObject'
|
|
823
804
|
}
|
|
824
805
|
},
|
|
825
806
|
// TODO it could be probably represented as non-object element, although it has graphical representation,
|
|
@@ -829,7 +810,7 @@ export default {
|
|
|
829
810
|
view: 'progress',
|
|
830
811
|
isObject: true,
|
|
831
812
|
modelSchema: {
|
|
832
|
-
inheritAllFrom: '$
|
|
813
|
+
inheritAllFrom: '$inlineObject'
|
|
833
814
|
}
|
|
834
815
|
},
|
|
835
816
|
{
|
package/theme/datafilter.css
CHANGED