@progress/kendo-angular-editor 3.0.0-dev.202112211443 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/NOTICE.txt +119 -79
- package/README.md +1 -1
- package/dist/cdn/js/kendo-angular-editor.js +2 -2
- package/dist/cdn/main.js +1 -1
- package/dist/es/common/error-messages.js +1 -1
- package/dist/es/config/command-icons.js +1 -0
- package/dist/es/config/commands.js +18 -17
- package/dist/es/config/schema.js +2 -4
- package/dist/es/config/table-commands.js +1 -363
- package/dist/es/dialogs/colorpicker-dialog.component.js +1 -1
- package/dist/es/dialogs/file-link-dialog.component.js +1 -1
- package/dist/es/dialogs/image-dialog.component.js +1 -1
- package/dist/es/editor-toolbar-state.js +12 -2
- package/dist/es/editor.component.js +11 -11
- package/dist/es/editor.module.js +6 -3
- package/dist/es/index.js +2 -0
- package/dist/es/localization/messages.js +4 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/tools/blockquote/editor-blockquote-button.directive.js +48 -0
- package/dist/es/tools/colorpicker/editor-colorpicker.component.js +24 -7
- package/dist/es/tools/format/editor-format-dropdownlist.component.js +1 -1
- package/dist/es/tools/format/editor-format.component.js +0 -1
- package/dist/es/tools/tables/popup-table-grid.component.js +1 -1
- package/dist/es2015/common/commands.d.ts +1 -1
- package/dist/es2015/common/error-messages.js +1 -1
- package/dist/es2015/common/format-item.interface.d.ts +1 -1
- package/dist/es2015/config/command-icons.js +1 -0
- package/dist/es2015/config/commands.js +18 -17
- package/dist/es2015/config/schema.d.ts +1 -1
- package/dist/es2015/config/schema.js +2 -3
- package/dist/es2015/config/table-commands.d.ts +0 -36
- package/dist/es2015/config/table-commands.js +1 -357
- package/dist/es2015/dialogs/colorpicker-dialog.component.js +1 -1
- package/dist/es2015/dialogs/file-link-dialog.component.js +4 -4
- package/dist/es2015/dialogs/image-dialog.component.js +4 -4
- package/dist/es2015/editor-toolbar-state.js +12 -2
- package/dist/es2015/editor.component.d.ts +1 -1
- package/dist/es2015/editor.component.js +12 -10
- package/dist/es2015/editor.module.js +6 -3
- package/dist/es2015/index.d.ts +2 -0
- package/dist/es2015/index.js +2 -0
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/localization/messages.d.ts +4 -0
- package/dist/es2015/localization/messages.js +4 -0
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/tools/blockquote/editor-blockquote-button.directive.d.ts +30 -0
- package/dist/es2015/tools/blockquote/editor-blockquote-button.directive.js +45 -0
- package/dist/es2015/tools/colorpicker/editor-colorpicker.component.d.ts +8 -2
- package/dist/es2015/tools/colorpicker/editor-colorpicker.component.js +20 -7
- package/dist/es2015/tools/format/editor-format-dropdownlist.component.js +0 -4
- package/dist/es2015/tools/format/editor-format.component.js +0 -1
- package/dist/es2015/tools/tables/popup-table-grid.component.js +2 -2
- package/dist/fesm2015/index.js +261 -1575
- package/dist/fesm5/index.js +280 -1611
- package/dist/npm/common/error-messages.js +1 -1
- package/dist/npm/config/command-icons.js +1 -0
- package/dist/npm/config/commands.js +16 -14
- package/dist/npm/config/schema.js +2 -4
- package/dist/npm/config/table-commands.js +1 -368
- package/dist/npm/dialogs/colorpicker-dialog.component.js +1 -1
- package/dist/npm/dialogs/file-link-dialog.component.js +1 -1
- package/dist/npm/dialogs/image-dialog.component.js +1 -1
- package/dist/npm/editor-toolbar-state.js +11 -1
- package/dist/npm/editor.component.js +10 -10
- package/dist/npm/editor.module.js +7 -4
- package/dist/npm/index.js +5 -0
- package/dist/npm/localization/messages.js +4 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/tools/blockquote/editor-blockquote-button.directive.js +50 -0
- package/dist/npm/tools/colorpicker/editor-colorpicker.component.js +24 -7
- package/dist/npm/tools/format/editor-format-dropdownlist.component.js +1 -1
- package/dist/npm/tools/format/editor-format.component.js +0 -1
- package/dist/npm/tools/tables/popup-table-grid.component.js +1 -1
- package/dist/systemjs/kendo-angular-editor.js +1 -1
- package/package.json +18 -18
- package/dist/es/config/table-nodes.js +0 -146
- package/dist/es/config/tables/CellSelection.js +0 -268
- package/dist/es/config/tables/TableMap.js +0 -333
- package/dist/es/config/tables/table-utils.js +0 -302
- package/dist/es2015/config/table-nodes.d.ts +0 -9
- package/dist/es2015/config/table-nodes.js +0 -145
- package/dist/es2015/config/tables/CellSelection.d.ts +0 -35
- package/dist/es2015/config/tables/CellSelection.js +0 -256
- package/dist/es2015/config/tables/TableMap.d.ts +0 -35
- package/dist/es2015/config/tables/TableMap.js +0 -329
- package/dist/es2015/config/tables/table-utils.d.ts +0 -77
- package/dist/es2015/config/tables/table-utils.js +0 -299
- package/dist/npm/config/table-nodes.js +0 -157
- package/dist/npm/config/tables/CellSelection.js +0 -270
- package/dist/npm/config/tables/TableMap.js +0 -338
- package/dist/npm/config/tables/table-utils.js +0 -307
package/dist/fesm5/index.js
CHANGED
|
@@ -10,14 +10,14 @@ import { take, map, filter, concatMap, takeUntil } from 'rxjs/operators';
|
|
|
10
10
|
import { ToolBarComponent, ToolBarToolComponent, ToolBarButtonComponent, ToolBarModule } from '@progress/kendo-angular-toolbar';
|
|
11
11
|
import { DialogRef, DialogContentBase, DialogService, DialogModule } from '@progress/kendo-angular-dialog';
|
|
12
12
|
import { isDocumentAvailable, guid, PreventableEvent, KendoInput, hasObservers, Keys } from '@progress/kendo-angular-common';
|
|
13
|
-
import { nodes, Schema, marks,
|
|
13
|
+
import { nodes, Schema, marks, createTable, insertNode, expandToWordWrap, toggleInlineFormat, bold, cleanFormatting, applyLink, applyInlineStyle, insertText, italic, strikethrough, subscript, superscript, underline, removeLink, link, selectAll, isAligned, alignCenterRules, alignBlocks, alignRemoveRules, alignJustifyRules, alignLeftRules, alignRightRules, formatBlockElements, getHtml, indent, insertImage, toggleOrderedList, toggleUnorderedList, outdent, redo, setHtml, undo, blockquote, addColumnBefore, addColumnAfter, addRowBefore, addRowAfter, deleteRow, deleteColumn, mergeCells, splitCell, deleteTable, hasMark, activeNode, canIndentAsListItem, canBeIndented, indentRules, hasNode, canOutdentAsListItem, outdentRules, isIndented, getActiveMarks, expandSelection, getNodeFromSelection, getMark, getSelectionText, TextSelection, parseContent, Plugin, PluginKey, history, keymap, buildListKeymap, buildKeymap, baseKeymap, gapCursor, imageResizing, tableEditing, placeholder, EditorState, EditorView, pasteCleanup, AllSelection, removeComments, sanitize, removeAttribute, sanitizeStyleAttr, sanitizeClassAttr } from '@progress/kendo-editor-common';
|
|
14
14
|
export { Schema, EditorState, Plugin, PluginKey, Transaction, EditorView, Decoration, DecorationSet, NodeType, Node, MarkType, Mark, InputRule, inputRules, wrappingInputRule, textblockTypeInputRule, keymap, baseKeymap, history, dropCursor, gapCursor, tableNodes, getSelectionText } from '@progress/kendo-editor-common';
|
|
15
15
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
16
16
|
import { L10N_PREFIX, RTL, MessageService, LocalizationService, ComponentMessages } from '@progress/kendo-angular-l10n';
|
|
17
17
|
import { CommonModule } from '@angular/common';
|
|
18
18
|
import { DropDownListComponent, DropDownsModule } from '@progress/kendo-angular-dropdowns';
|
|
19
19
|
import { ButtonModule } from '@progress/kendo-angular-buttons';
|
|
20
|
-
import { ColorPickerComponent, ColorPickerModule, NumericTextBoxModule, TextBoxModule } from '@progress/kendo-angular-inputs';
|
|
20
|
+
import { ColorPickerComponent, ColorPickerModule, NumericTextBoxModule, CheckBoxModule, TextBoxModule } from '@progress/kendo-angular-inputs';
|
|
21
21
|
import { PopupService } from '@progress/kendo-angular-popup';
|
|
22
22
|
|
|
23
23
|
/**
|
|
@@ -27,7 +27,7 @@ var packageMetadata = {
|
|
|
27
27
|
name: '@progress/kendo-angular-editor',
|
|
28
28
|
productName: 'Kendo UI for Angular',
|
|
29
29
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
30
|
-
publishDate:
|
|
30
|
+
publishDate: 1642604521,
|
|
31
31
|
version: '',
|
|
32
32
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
|
|
33
33
|
};
|
|
@@ -70,1598 +70,84 @@ var getAttributes = function (dom) {
|
|
|
70
70
|
/**
|
|
71
71
|
* @hidden
|
|
72
72
|
*/
|
|
73
|
-
var
|
|
74
|
-
return
|
|
75
|
-
.reduce(function (acc, curr) {
|
|
76
|
-
var _a;
|
|
77
|
-
return Object.assign({}, acc, (_a = {}, _a[curr.name] = curr.value, _a));
|
|
78
|
-
}, {});
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* @hidden
|
|
82
|
-
*/
|
|
83
|
-
var commonAttributes = function () {
|
|
84
|
-
return __assign({}, createDefaultAttributes(['class', 'id', 'style']));
|
|
85
|
-
};
|
|
86
|
-
/**
|
|
87
|
-
* @hidden
|
|
88
|
-
*/
|
|
89
|
-
var createDefaultAttributes = function (attrs) {
|
|
90
|
-
if (attrs === void 0) { attrs = []; }
|
|
91
|
-
return __assign({}, attrs.reduce(function (acc, curr) {
|
|
92
|
-
var _a;
|
|
93
|
-
return (__assign({}, acc, (_a = {}, _a[curr] = { default: null }, _a)));
|
|
94
|
-
}, {}));
|
|
95
|
-
};
|
|
96
|
-
/**
|
|
97
|
-
* @hidden
|
|
98
|
-
*/
|
|
99
|
-
var hole = 0;
|
|
100
|
-
/**
|
|
101
|
-
* @hidden
|
|
102
|
-
*/
|
|
103
|
-
var isSchemaNode = function (schemaNodeName) { return function (node) { return node.type.name === schemaNodeName; }; };
|
|
104
|
-
/**
|
|
105
|
-
* @hidden
|
|
106
|
-
*/
|
|
107
|
-
var isTable = isSchemaNode('table');
|
|
108
|
-
/**
|
|
109
|
-
* @hidden
|
|
110
|
-
*/
|
|
111
|
-
var isTableBody = isSchemaNode('table_body');
|
|
112
|
-
/**
|
|
113
|
-
* @hidden
|
|
114
|
-
*/
|
|
115
|
-
var isTableHead = isSchemaNode('table_head');
|
|
116
|
-
/**
|
|
117
|
-
* @hidden
|
|
118
|
-
*/
|
|
119
|
-
var isTableFoot = isSchemaNode('table_foot');
|
|
120
|
-
/**
|
|
121
|
-
* @hidden
|
|
122
|
-
*/
|
|
123
|
-
var isTableRow = isSchemaNode('table_row');
|
|
124
|
-
/**
|
|
125
|
-
* @hidden
|
|
126
|
-
*/
|
|
127
|
-
var isTableCell = isSchemaNode('table_cell');
|
|
128
|
-
/**
|
|
129
|
-
* @hidden
|
|
130
|
-
*/
|
|
131
|
-
var isTableHeaderCell = isSchemaNode('table_header');
|
|
132
|
-
|
|
133
|
-
var createSemanticNode = function (tagName) { return ({
|
|
134
|
-
// Uncaught SyntaxError: Mixing inline and block content (in content expression '(block | inline)*')
|
|
135
|
-
// content: '(block | inline)*',
|
|
136
|
-
content: 'block*',
|
|
137
|
-
group: 'block',
|
|
138
|
-
attrs: __assign({}, commonAttributes()),
|
|
139
|
-
parseDOM: [{
|
|
140
|
-
tag: tagName,
|
|
141
|
-
getAttrs: getAttributes
|
|
142
|
-
}],
|
|
143
|
-
toDOM: function (node) { return hasAttrs(node.attrs) ? [tagName, getAttrs(node.attrs), hole] : [tagName, hole]; }
|
|
144
|
-
}); };
|
|
145
|
-
/**
|
|
146
|
-
* @hidden
|
|
147
|
-
*/
|
|
148
|
-
var semanticTagNames = ['article', 'main', 'nav', 'header', 'footer', 'aside', 'section'];
|
|
149
|
-
var ɵ1 = function (acc, curr) {
|
|
150
|
-
var _a;
|
|
151
|
-
return Object.assign(acc, (_a = {}, _a[curr] = createSemanticNode(curr), _a));
|
|
152
|
-
};
|
|
153
|
-
/**
|
|
154
|
-
* @hidden
|
|
155
|
-
*/
|
|
156
|
-
var semanticNodes = semanticTagNames.reduce(ɵ1, {});
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* @hidden
|
|
160
|
-
*/
|
|
161
|
-
function outerWidth(element) {
|
|
162
|
-
var width = element.offsetWidth;
|
|
163
|
-
var style = getComputedStyle(element);
|
|
164
|
-
width += parseFloat(style.marginLeft) || 0 + parseFloat(style.marginRight) || 0;
|
|
165
|
-
return width;
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* @hidden
|
|
169
|
-
*/
|
|
170
|
-
var removeEntries = function (obj, predicate) {
|
|
171
|
-
return Object.keys(obj)
|
|
172
|
-
.filter(function (key) { return predicate(key); })
|
|
173
|
-
.reduce(function (acc, curr) {
|
|
174
|
-
var _a;
|
|
175
|
-
return Object.assign(acc, (_a = {}, _a[curr] = obj[curr], _a));
|
|
176
|
-
}, {});
|
|
177
|
-
};
|
|
178
|
-
/**
|
|
179
|
-
* @hidden
|
|
180
|
-
*/
|
|
181
|
-
var removeEmptyEntries = function (obj) {
|
|
182
|
-
var predicate = function (key) { return obj[key] !== null && obj[key] !== undefined && obj[key] !== ''; };
|
|
183
|
-
return removeEntries(obj, predicate);
|
|
184
|
-
};
|
|
185
|
-
/**
|
|
186
|
-
* @hidden
|
|
187
|
-
*/
|
|
188
|
-
var isNullOrUndefined = function (value) { return value === undefined || value === null; };
|
|
189
|
-
/**
|
|
190
|
-
* @hidden
|
|
191
|
-
*/
|
|
192
|
-
var isPresent = function (value) { return !isNullOrUndefined(value); };
|
|
193
|
-
/**
|
|
194
|
-
* @hidden
|
|
195
|
-
*/
|
|
196
|
-
var detectIE = function () {
|
|
197
|
-
if (!isDocumentAvailable()) {
|
|
198
|
-
return false;
|
|
199
|
-
}
|
|
200
|
-
var ua = window.navigator.userAgent;
|
|
201
|
-
var msie = ua.indexOf('MSIE ');
|
|
202
|
-
var trident = ua.indexOf('Trident/');
|
|
203
|
-
return msie > 0 || trident > 0;
|
|
204
|
-
};
|
|
205
|
-
/**
|
|
206
|
-
* @hidden
|
|
207
|
-
*/
|
|
208
|
-
var safeString = function (value) { return (isNullOrUndefined(value) ? '' : value.toString()); };
|
|
209
|
-
/**
|
|
210
|
-
* @hidden
|
|
211
|
-
*/
|
|
212
|
-
var first = function (arr) { return arr[0]; };
|
|
213
|
-
/**
|
|
214
|
-
* @hidden
|
|
215
|
-
*/
|
|
216
|
-
var last = function (arr) { return arr[arr.length - 1]; };
|
|
217
|
-
/**
|
|
218
|
-
* @hidden
|
|
219
|
-
*/
|
|
220
|
-
var split = function (splitter) { return function (value) { return value.split(splitter); }; };
|
|
221
|
-
/**
|
|
222
|
-
* @hidden
|
|
223
|
-
*/
|
|
224
|
-
var trim = function (value) { return value.trim(); };
|
|
225
|
-
/**
|
|
226
|
-
* @hidden
|
|
227
|
-
*/
|
|
228
|
-
var filter$1 = function (predicate) { return function (arr) { return arr.filter(predicate); }; };
|
|
229
|
-
/**
|
|
230
|
-
* @hidden
|
|
231
|
-
*/
|
|
232
|
-
var getUniqueStyleValues = function (style, cssStyle) {
|
|
233
|
-
if (style.hasNodesWithoutMarks) {
|
|
234
|
-
return '';
|
|
235
|
-
}
|
|
236
|
-
var uniqueMarkValues = style.marks
|
|
237
|
-
.filter(function (m) { return m.type.name === 'style'; })
|
|
238
|
-
.map(function (m) { return m.attrs.style; })
|
|
239
|
-
.map(safeString)
|
|
240
|
-
.map(split(';'))
|
|
241
|
-
.map(filter$1(function (m) { return m.includes(cssStyle); }))
|
|
242
|
-
// guards against empty array
|
|
243
|
-
.map(function (cssStyleValues) { return (cssStyleValues.length !== 0 ? cssStyleValues : [cssStyle + ": INVALID"]); })
|
|
244
|
-
.map(first)
|
|
245
|
-
.map(split(':'))
|
|
246
|
-
.map(last)
|
|
247
|
-
.map(trim)
|
|
248
|
-
.reduce(function (acc, curr) { return (acc.indexOf(curr) > -1 ? acc : acc.concat([curr])); }, []);
|
|
249
|
-
if (uniqueMarkValues.indexOf('INVALID') > -1 || uniqueMarkValues.length !== 1) {
|
|
250
|
-
return '';
|
|
251
|
-
}
|
|
252
|
-
return uniqueMarkValues[0];
|
|
253
|
-
};
|
|
254
|
-
/**
|
|
255
|
-
* @hidden
|
|
256
|
-
*/
|
|
257
|
-
var conditionallyExecute = function (fn) { return function (condition) { return function (param) { return (condition ? fn(param) : param); }; }; };
|
|
258
|
-
/**
|
|
259
|
-
* @hidden
|
|
260
|
-
*/
|
|
261
|
-
var pipe = function () {
|
|
262
|
-
var fns = [];
|
|
263
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
264
|
-
fns[_i] = arguments[_i];
|
|
265
|
-
}
|
|
266
|
-
return function (x) { return fns.reduce(function (y, f) { return f(y); }, x); };
|
|
267
|
-
};
|
|
268
|
-
|
|
269
|
-
var setCellAttrs = function (nodeAttributes) {
|
|
270
|
-
var attrs = __assign({}, nodeAttributes);
|
|
271
|
-
if (nodeAttributes.colspan !== 1) {
|
|
272
|
-
attrs.colspan = nodeAttributes.colspan;
|
|
273
|
-
}
|
|
274
|
-
else {
|
|
275
|
-
attrs.colspan = null;
|
|
276
|
-
}
|
|
277
|
-
if (nodeAttributes.rowspan !== 1) {
|
|
278
|
-
attrs.rowspan = nodeAttributes.rowspan;
|
|
279
|
-
}
|
|
280
|
-
else {
|
|
281
|
-
attrs.rowspan = null;
|
|
282
|
-
}
|
|
283
|
-
return removeEmptyEntries(attrs);
|
|
284
|
-
};
|
|
285
|
-
var ɵ1$1 = function (node) { return ['table', removeEmptyEntries(node.attrs), 0]; }, ɵ2 = function (node) { return ['tr', removeEmptyEntries(node.attrs), 0]; }, ɵ3 = function (node) { return ['td', setCellAttrs(node.attrs), 0]; }, ɵ4 = function (node) { return ['th', setCellAttrs(node.attrs), 0]; }, ɵ5 = function (node) { return ['tbody', removeEmptyEntries(node.attrs), 0]; }, ɵ6 = function (node) { return ['tfoot', removeEmptyEntries(node.attrs), 0]; }, ɵ7 = function (node) { return ['thead', removeEmptyEntries(node.attrs), 0]; }, ɵ8 = function (node) { return ['col', removeEmptyEntries(node.attrs)]; }, ɵ9 = function (node) { return ['colgroup', removeEmptyEntries(node.attrs), 0]; };
|
|
286
|
-
/**
|
|
287
|
-
* @hidden
|
|
288
|
-
*/
|
|
289
|
-
var tableNodes = {
|
|
290
|
-
// all table node names must start with table - this is needed for the commands to work properly
|
|
291
|
-
table: {
|
|
292
|
-
attrs: __assign({}, commonAttributes(), createDefaultAttributes(['cellspacing', 'cellpadding'])),
|
|
293
|
-
content: '(table_body | table_head | table_foot | table_colgroup)+',
|
|
294
|
-
tableRole: 'table',
|
|
295
|
-
isolating: true,
|
|
296
|
-
group: 'block',
|
|
297
|
-
parseDOM: [
|
|
298
|
-
{
|
|
299
|
-
getAttrs: serializeDOMAttrs,
|
|
300
|
-
tag: 'table'
|
|
301
|
-
}
|
|
302
|
-
],
|
|
303
|
-
toDOM: ɵ1$1
|
|
304
|
-
},
|
|
305
|
-
table_row: {
|
|
306
|
-
content: '(table_cell | table_header)*',
|
|
307
|
-
attrs: __assign({}, commonAttributes()),
|
|
308
|
-
tableRole: 'row',
|
|
309
|
-
parseDOM: [
|
|
310
|
-
{
|
|
311
|
-
getAttrs: serializeDOMAttrs,
|
|
312
|
-
tag: 'tr'
|
|
313
|
-
}
|
|
314
|
-
],
|
|
315
|
-
toDOM: ɵ2
|
|
316
|
-
},
|
|
317
|
-
table_cell: {
|
|
318
|
-
content: 'block+',
|
|
319
|
-
attrs: __assign({}, commonAttributes(), createDefaultAttributes(['headers']), {
|
|
320
|
-
// this is needed for the commands
|
|
321
|
-
colspan: { default: 1 }, rowspan: { default: 1 } }),
|
|
322
|
-
tableRole: 'cell',
|
|
323
|
-
isolating: true,
|
|
324
|
-
parseDOM: [
|
|
325
|
-
{
|
|
326
|
-
getAttrs: serializeDOMAttrs,
|
|
327
|
-
tag: 'td'
|
|
328
|
-
}
|
|
329
|
-
],
|
|
330
|
-
toDOM: ɵ3
|
|
331
|
-
},
|
|
332
|
-
table_header: {
|
|
333
|
-
content: 'block+',
|
|
334
|
-
attrs: __assign({}, commonAttributes(), createDefaultAttributes(['headers', 'abbr', 'scope']), { colspan: { default: 1 }, rowspan: { default: 1 } }),
|
|
335
|
-
tableRole: 'header_cell',
|
|
336
|
-
isolating: true,
|
|
337
|
-
parseDOM: [
|
|
338
|
-
{
|
|
339
|
-
getAttrs: serializeDOMAttrs,
|
|
340
|
-
tag: 'th'
|
|
341
|
-
}
|
|
342
|
-
],
|
|
343
|
-
toDOM: ɵ4
|
|
344
|
-
},
|
|
345
|
-
table_body: {
|
|
346
|
-
attrs: __assign({}, commonAttributes()),
|
|
347
|
-
content: 'table_row+',
|
|
348
|
-
isolating: true,
|
|
349
|
-
parseDOM: [
|
|
350
|
-
{
|
|
351
|
-
getAttrs: serializeDOMAttrs,
|
|
352
|
-
tag: 'tbody'
|
|
353
|
-
}
|
|
354
|
-
],
|
|
355
|
-
toDOM: ɵ5
|
|
356
|
-
},
|
|
357
|
-
table_foot: {
|
|
358
|
-
attrs: __assign({}, commonAttributes()),
|
|
359
|
-
content: 'table_row+',
|
|
360
|
-
isolating: true,
|
|
361
|
-
parseDOM: [
|
|
362
|
-
{
|
|
363
|
-
getAttrs: serializeDOMAttrs,
|
|
364
|
-
tag: 'tfoot'
|
|
365
|
-
}
|
|
366
|
-
],
|
|
367
|
-
toDOM: ɵ6
|
|
368
|
-
},
|
|
369
|
-
table_head: {
|
|
370
|
-
attrs: __assign({}, commonAttributes()),
|
|
371
|
-
content: 'table_row+',
|
|
372
|
-
isolating: true,
|
|
373
|
-
parseDOM: [
|
|
374
|
-
{
|
|
375
|
-
getAttrs: serializeDOMAttrs,
|
|
376
|
-
tag: 'thead'
|
|
377
|
-
}
|
|
378
|
-
],
|
|
379
|
-
toDOM: ɵ7
|
|
380
|
-
},
|
|
381
|
-
table_col: {
|
|
382
|
-
attrs: __assign({}, commonAttributes(), createDefaultAttributes(['span'])),
|
|
383
|
-
selectable: false,
|
|
384
|
-
atom: true,
|
|
385
|
-
parseDOM: [
|
|
386
|
-
{
|
|
387
|
-
getAttrs: serializeDOMAttrs,
|
|
388
|
-
tag: 'col'
|
|
389
|
-
}
|
|
390
|
-
],
|
|
391
|
-
toDOM: ɵ8
|
|
392
|
-
},
|
|
393
|
-
table_colgroup: {
|
|
394
|
-
attrs: __assign({}, commonAttributes(), createDefaultAttributes(['span'])),
|
|
395
|
-
content: 'table_col*',
|
|
396
|
-
selectable: false,
|
|
397
|
-
parseDOM: [
|
|
398
|
-
{
|
|
399
|
-
getAttrs: serializeDOMAttrs,
|
|
400
|
-
tag: 'colgroup'
|
|
401
|
-
}
|
|
402
|
-
],
|
|
403
|
-
toDOM: ɵ9
|
|
404
|
-
}
|
|
405
|
-
};
|
|
406
|
-
|
|
407
|
-
/**
|
|
408
|
-
* @hidden
|
|
409
|
-
*/
|
|
410
|
-
var marks$1 = marks;
|
|
411
|
-
var nodes$1 = Object.assign(nodes, tableNodes, semanticNodes);
|
|
412
|
-
/**
|
|
413
|
-
* @hidden
|
|
414
|
-
*/
|
|
415
|
-
var schema = new Schema({
|
|
416
|
-
marks: marks$1,
|
|
417
|
-
nodes: __assign({}, nodes$1, { blockquote: __assign({}, nodes$1.blockquote, { content: 'inline*' }) })
|
|
418
|
-
});
|
|
419
|
-
|
|
420
|
-
// Because working with row and column-spanning cells is not quite
|
|
421
|
-
// trivial, this code builds up a descriptive structure for a given
|
|
422
|
-
// table node. The structures are cached with the (persistent) table
|
|
423
|
-
// nodes as key, so that they only have to be recomputed when the
|
|
424
|
-
// content of the table changes.
|
|
425
|
-
//
|
|
426
|
-
// This does mean that they have to store table-relative, not
|
|
427
|
-
// document-relative positions. So code that uses them will typically
|
|
428
|
-
// compute the start position of the table and offset positions passed
|
|
429
|
-
// to or gotten from this structure by that amount.
|
|
430
|
-
var readFromCache;
|
|
431
|
-
var addToCache;
|
|
432
|
-
// Prefer using a weak map to cache table maps. Fall back on a
|
|
433
|
-
// fixed-size cache if that's not supported.
|
|
434
|
-
if (typeof WeakMap !== 'undefined') {
|
|
435
|
-
var cache_1 = new WeakMap();
|
|
436
|
-
readFromCache = function (key) { return cache_1.get(key); };
|
|
437
|
-
addToCache = function (key, value) {
|
|
438
|
-
cache_1.set(key, value);
|
|
439
|
-
return value;
|
|
440
|
-
};
|
|
441
|
-
}
|
|
442
|
-
else {
|
|
443
|
-
var cache_2 = [];
|
|
444
|
-
var cacheSize_1 = 10;
|
|
445
|
-
var cachePos_1 = 0;
|
|
446
|
-
readFromCache = function (key) {
|
|
447
|
-
for (var i = 0; i < cache_2.length; i += 2) {
|
|
448
|
-
if (cache_2[i] === key) {
|
|
449
|
-
return cache_2[i + 1];
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
};
|
|
453
|
-
addToCache = function (key, value) {
|
|
454
|
-
if (cachePos_1 === cacheSize_1) {
|
|
455
|
-
cachePos_1 = 0;
|
|
456
|
-
}
|
|
457
|
-
cache_2[cachePos_1++] = key;
|
|
458
|
-
return (cache_2[cachePos_1++] = value);
|
|
459
|
-
};
|
|
460
|
-
}
|
|
461
|
-
var findWidth = function (table) {
|
|
462
|
-
var width = -1;
|
|
463
|
-
var hasRowSpan = false;
|
|
464
|
-
for (var row = 0; row < table.childCount; row++) {
|
|
465
|
-
var rowNode = table.child(row);
|
|
466
|
-
var rowWidth = 0;
|
|
467
|
-
if (hasRowSpan) {
|
|
468
|
-
for (var j = 0; j < row; j++) {
|
|
469
|
-
var prevRow = table.child(j);
|
|
470
|
-
for (var i = 0; i < prevRow.childCount; i++) {
|
|
471
|
-
var cell = prevRow.child(i);
|
|
472
|
-
if (j + cell.attrs.rowspan > row) {
|
|
473
|
-
rowWidth += cell.attrs.colspan;
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
// check if the cell spans accross multiple columns
|
|
479
|
-
for (var i = 0; i < rowNode.childCount; i++) {
|
|
480
|
-
var cell = rowNode.child(i);
|
|
481
|
-
rowWidth += cell.attrs.colspan;
|
|
482
|
-
if (cell.attrs.rowspan > 1) {
|
|
483
|
-
hasRowSpan = true;
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
if (width === -1) {
|
|
487
|
-
width = rowWidth;
|
|
488
|
-
}
|
|
489
|
-
else if (width !== rowWidth) {
|
|
490
|
-
width = Math.max(width, rowWidth);
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
return width;
|
|
494
|
-
};
|
|
495
|
-
var freshColWidth = function (attrs) {
|
|
496
|
-
if (attrs.colwidth) {
|
|
497
|
-
return attrs.colwidth.slice();
|
|
498
|
-
}
|
|
499
|
-
var result = [];
|
|
500
|
-
for (var i = 0; i < attrs.colspan; i++) {
|
|
501
|
-
result.push(0);
|
|
502
|
-
}
|
|
503
|
-
return result;
|
|
504
|
-
};
|
|
505
|
-
var findBadColWidths = function (map$$1, colWidths, table) {
|
|
506
|
-
if (!map$$1.problems) {
|
|
507
|
-
map$$1.problems = [];
|
|
508
|
-
}
|
|
509
|
-
for (var i = 0, seen = {}; i < map$$1.map.length; i++) {
|
|
510
|
-
var pos = map$$1.map[i];
|
|
511
|
-
if (seen[pos]) {
|
|
512
|
-
continue;
|
|
513
|
-
}
|
|
514
|
-
seen[pos] = true;
|
|
515
|
-
var node = table.nodeAt(pos);
|
|
516
|
-
var updated = null;
|
|
517
|
-
for (var j = 0; j < node.attrs.colspan; j++) {
|
|
518
|
-
var col = (i + j) % map$$1.width;
|
|
519
|
-
var colWidth = colWidths[col * 2];
|
|
520
|
-
if (colWidth != null && (!node.attrs.colwidth || node.attrs.colwidth[j] !== colWidth)) {
|
|
521
|
-
(updated || (updated = freshColWidth(node.attrs)))[j] = colWidth;
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
if (updated) {
|
|
525
|
-
map$$1.problems.unshift({ type: 'colwidth mismatch', pos: pos, colwidth: updated });
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
};
|
|
529
|
-
// Compute a table map.
|
|
530
|
-
var computeMap = function (tableNode) {
|
|
531
|
-
if (!isTable(tableNode) && !isTableBody(tableNode) && !isTableHead(tableNode) && !isTableFoot(tableNode)) {
|
|
532
|
-
throw new RangeError('Not a table node: ' + tableNode.type.name);
|
|
533
|
-
}
|
|
534
|
-
var width = findWidth(tableNode);
|
|
535
|
-
var height = tableNode.childCount;
|
|
536
|
-
var map$$1 = [];
|
|
537
|
-
var mapPos = 0;
|
|
538
|
-
var problems = null;
|
|
539
|
-
var colWidths = [];
|
|
540
|
-
for (var i = 0, e = width * height; i < e; i++) {
|
|
541
|
-
map$$1[i] = 0;
|
|
542
|
-
}
|
|
543
|
-
for (var row = 0, pos = 0; row < height; row++) {
|
|
544
|
-
var rowNode = tableNode.child(row);
|
|
545
|
-
pos++;
|
|
546
|
-
for (var i = 0;; i++) {
|
|
547
|
-
while (mapPos < map$$1.length && map$$1[mapPos] !== 0) {
|
|
548
|
-
mapPos++;
|
|
549
|
-
}
|
|
550
|
-
if (i === rowNode.childCount) {
|
|
551
|
-
break;
|
|
552
|
-
}
|
|
553
|
-
var cellNode = rowNode.child(i);
|
|
554
|
-
var _a = cellNode.attrs, colspan = _a.colspan, rowspan = _a.rowspan, colwidth = _a.colwidth;
|
|
555
|
-
for (var h = 0; h < rowspan; h++) {
|
|
556
|
-
if (h + row >= height) {
|
|
557
|
-
(problems || (problems = [])).push({ type: 'overlong_rowspan', pos: pos, n: rowspan - h });
|
|
558
|
-
break;
|
|
559
|
-
}
|
|
560
|
-
var start = mapPos + h * width;
|
|
561
|
-
for (var w = 0; w < colspan; w++) {
|
|
562
|
-
if (map$$1[start + w] === 0) {
|
|
563
|
-
map$$1[start + w] = pos;
|
|
564
|
-
}
|
|
565
|
-
else {
|
|
566
|
-
(problems || (problems = [])).push({ type: 'collision', row: row, pos: pos, n: colspan - w });
|
|
567
|
-
}
|
|
568
|
-
var colW = colwidth && colwidth[w];
|
|
569
|
-
if (colW) {
|
|
570
|
-
var widthIndex = ((start + w) % width) * 2, prev = colWidths[widthIndex];
|
|
571
|
-
if (prev == null || (prev !== colW && colWidths[widthIndex + 1] === 1)) {
|
|
572
|
-
colWidths[widthIndex] = colW;
|
|
573
|
-
colWidths[widthIndex + 1] = 1;
|
|
574
|
-
}
|
|
575
|
-
else if (prev === colW) {
|
|
576
|
-
colWidths[widthIndex + 1]++;
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
mapPos += colspan;
|
|
582
|
-
pos += cellNode.nodeSize;
|
|
583
|
-
}
|
|
584
|
-
var expectedPos = (row + 1) * width;
|
|
585
|
-
var missing = 0;
|
|
586
|
-
while (mapPos < expectedPos) {
|
|
587
|
-
if (map$$1[mapPos++] === 0) {
|
|
588
|
-
missing++;
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
if (missing) {
|
|
592
|
-
(problems || (problems = [])).push({ type: 'missing', row: row, n: missing });
|
|
593
|
-
}
|
|
594
|
-
pos++;
|
|
595
|
-
}
|
|
596
|
-
var tableMap = new TableMap(width, height, map$$1, problems);
|
|
597
|
-
var badWidths = false;
|
|
598
|
-
// For columns that have defined widths, but whose widths disagree
|
|
599
|
-
// between rows, fix up the cells whose width doesn't match the
|
|
600
|
-
// computed one.
|
|
601
|
-
for (var i = 0; !badWidths && i < colWidths.length; i += 2) {
|
|
602
|
-
if (colWidths[i] != null && colWidths[i + 1] < height) {
|
|
603
|
-
badWidths = true;
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
if (badWidths) {
|
|
607
|
-
findBadColWidths(tableMap, colWidths, tableNode);
|
|
608
|
-
}
|
|
609
|
-
return tableMap;
|
|
610
|
-
};
|
|
611
|
-
/**
|
|
612
|
-
* @hidden
|
|
613
|
-
*/
|
|
614
|
-
var Rect = /** @class */ (function () {
|
|
615
|
-
function Rect(left, top, right, bottom) {
|
|
616
|
-
this.left = left;
|
|
617
|
-
this.top = top;
|
|
618
|
-
this.right = right;
|
|
619
|
-
this.bottom = bottom;
|
|
620
|
-
}
|
|
621
|
-
return Rect;
|
|
622
|
-
}());
|
|
623
|
-
/**
|
|
624
|
-
* @hidden
|
|
625
|
-
*/
|
|
626
|
-
var TableMap = /** @class */ (function () {
|
|
627
|
-
function TableMap(width, height, map$$1, problems) {
|
|
628
|
-
// :: number The width of the table
|
|
629
|
-
this.width = width;
|
|
630
|
-
// :: number The table's height
|
|
631
|
-
this.height = height;
|
|
632
|
-
// :: [number] A width * height array with the start position of
|
|
633
|
-
// the cell covering that part of the table in each slot
|
|
634
|
-
this.map = map$$1;
|
|
635
|
-
// An optional array of problems (cell overlap or non-rectangular
|
|
636
|
-
// shape) for the table, used by the table normalizer.
|
|
637
|
-
this.problems = problems;
|
|
638
|
-
}
|
|
639
|
-
// :: (Node) → TableMap
|
|
640
|
-
// Find the table map for the given table node.
|
|
641
|
-
TableMap.get = function (table) {
|
|
642
|
-
return readFromCache(table) || addToCache(table, computeMap(table));
|
|
643
|
-
};
|
|
644
|
-
// :: (number) → Rect
|
|
645
|
-
// Find the dimensions of the cell at the given position.
|
|
646
|
-
TableMap.prototype.findCell = function (pos) {
|
|
647
|
-
for (var i = 0; i < this.map.length; i++) {
|
|
648
|
-
var curPos = this.map[i];
|
|
649
|
-
if (curPos !== pos) {
|
|
650
|
-
continue;
|
|
651
|
-
}
|
|
652
|
-
var left = i % this.width;
|
|
653
|
-
var top_1 = Math.floor(i / this.width);
|
|
654
|
-
var right = left + 1;
|
|
655
|
-
var bottom = top_1 + 1;
|
|
656
|
-
for (var j = 1; right < this.width && this.map[i + j] === curPos; j++) {
|
|
657
|
-
right++;
|
|
658
|
-
}
|
|
659
|
-
for (var j = 1; bottom < this.height && this.map[i + this.width * j] === curPos; j++) {
|
|
660
|
-
bottom++;
|
|
661
|
-
}
|
|
662
|
-
return new Rect(left, top_1, right, bottom);
|
|
663
|
-
}
|
|
664
|
-
throw new RangeError('No cell with offset ' + pos + ' found');
|
|
665
|
-
};
|
|
666
|
-
// :: (number) → number
|
|
667
|
-
// Find the left side of the cell at the given position.
|
|
668
|
-
TableMap.prototype.colCount = function (pos) {
|
|
669
|
-
for (var i = 0; i < this.map.length; i++) {
|
|
670
|
-
if (this.map[i] === pos) {
|
|
671
|
-
return i % this.width;
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
throw new RangeError('No cell with offset ' + pos + ' found');
|
|
675
|
-
};
|
|
676
|
-
// :: (number, string, number) → ?number
|
|
677
|
-
// Find the next cell in the given direction, starting from the cell
|
|
678
|
-
// at `pos`, if any.
|
|
679
|
-
TableMap.prototype.nextCell = function (pos, axis, dir) {
|
|
680
|
-
var _a = this.findCell(pos), left = _a.left, right = _a.right, top = _a.top, bottom = _a.bottom;
|
|
681
|
-
if (axis === 'horiz') {
|
|
682
|
-
if (dir < 0 ? left === 0 : right === this.width) {
|
|
683
|
-
return null;
|
|
684
|
-
}
|
|
685
|
-
return this.map[top * this.width + (dir < 0 ? left - 1 : right)];
|
|
686
|
-
}
|
|
687
|
-
else {
|
|
688
|
-
if (dir < 0 ? top === 0 : bottom === this.height) {
|
|
689
|
-
return null;
|
|
690
|
-
}
|
|
691
|
-
return this.map[left + this.width * (dir < 0 ? top - 1 : bottom)];
|
|
692
|
-
}
|
|
693
|
-
};
|
|
694
|
-
// :: (number, number) → Rect
|
|
695
|
-
// Get the rectangle spanning the two given cells.
|
|
696
|
-
TableMap.prototype.rectBetween = function (a, b) {
|
|
697
|
-
var _a = this.findCell(a), leftA = _a.left, rightA = _a.right, topA = _a.top, bottomA = _a.bottom;
|
|
698
|
-
var _b = this.findCell(b), leftB = _b.left, rightB = _b.right, topB = _b.top, bottomB = _b.bottom;
|
|
699
|
-
return new Rect(Math.min(leftA, leftB), Math.min(topA, topB), Math.max(rightA, rightB), Math.max(bottomA, bottomB));
|
|
700
|
-
};
|
|
701
|
-
// :: (Rect) → [number]
|
|
702
|
-
// Return the position of all cells that have the top left corner in
|
|
703
|
-
// the given rectangle.
|
|
704
|
-
TableMap.prototype.cellsInRect = function (rect) {
|
|
705
|
-
var result = [];
|
|
706
|
-
var seen = {};
|
|
707
|
-
for (var row = rect.top; row < rect.bottom; row++) {
|
|
708
|
-
for (var col = rect.left; col < rect.right; col++) {
|
|
709
|
-
var index = row * this.width + col, pos = this.map[index];
|
|
710
|
-
if (seen[pos]) {
|
|
711
|
-
continue;
|
|
712
|
-
}
|
|
713
|
-
seen[pos] = true;
|
|
714
|
-
if ((col !== rect.left || !col || this.map[index - 1] !== pos) &&
|
|
715
|
-
(row !== rect.top || !row || this.map[index - this.width] !== pos)) {
|
|
716
|
-
result.push(pos);
|
|
717
|
-
}
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
return result;
|
|
721
|
-
};
|
|
722
|
-
// :: (number, number, Node) → number
|
|
723
|
-
// Return the position at which the cell at the given row and column
|
|
724
|
-
// starts, or would start, if a cell started there.
|
|
725
|
-
TableMap.prototype.positionAt = function (row, col, table) {
|
|
726
|
-
for (var i = 0, rowStart = 0;; i++) {
|
|
727
|
-
var rowEnd = rowStart + table.child(i).nodeSize;
|
|
728
|
-
if (i === row) {
|
|
729
|
-
var index = col + row * this.width, rowEndIndex = (row + 1) * this.width;
|
|
730
|
-
// Skip past cells from previous rows (via rowspan)
|
|
731
|
-
while (index < rowEndIndex && this.map[index] < rowStart) {
|
|
732
|
-
index++;
|
|
733
|
-
}
|
|
734
|
-
return index === rowEndIndex ? rowEnd - 1 : this.map[index];
|
|
735
|
-
}
|
|
736
|
-
rowStart = rowEnd;
|
|
737
|
-
}
|
|
738
|
-
};
|
|
739
|
-
return TableMap;
|
|
740
|
-
}());
|
|
741
|
-
|
|
742
|
-
/**
|
|
743
|
-
* @hidden
|
|
744
|
-
*/
|
|
745
|
-
// ::- A [`Selection`](http://prosemirror.net/docs/ref/#state.Selection)
|
|
746
|
-
// subclass that represents a cell selection spanning part of a table.
|
|
747
|
-
// With the plugin enabled, these will be created when the user
|
|
748
|
-
// selects across cells, and will be drawn by giving selected cells a
|
|
749
|
-
// `selectedCell` CSS class.
|
|
750
|
-
var CellSelection = /** @class */ (function (_super) {
|
|
751
|
-
__extends(CellSelection, _super);
|
|
752
|
-
// :: (ResolvedPos, ?ResolvedPos)
|
|
753
|
-
// A table selection is identified by its anchor and head cells. The
|
|
754
|
-
// positions given to this constructor should point _before_ two
|
|
755
|
-
// cells in the same table. They may be the same, to select a single
|
|
756
|
-
// cell.
|
|
757
|
-
function CellSelection($anchorCell, $headCell) {
|
|
758
|
-
if ($headCell === void 0) { $headCell = $anchorCell; }
|
|
759
|
-
var _this = this;
|
|
760
|
-
var table = $anchorCell.node(-1), map$$1 = TableMap.get(table), start = $anchorCell.start(-1);
|
|
761
|
-
var rect = map$$1.rectBetween($anchorCell.pos - start, $headCell.pos - start);
|
|
762
|
-
var doc = $anchorCell.node(0);
|
|
763
|
-
var cells = map$$1.cellsInRect(rect).filter(function (p) { return p !== $headCell.pos - start; });
|
|
764
|
-
// Make the head cell the first range, so that it counts as the
|
|
765
|
-
// primary part of the selection
|
|
766
|
-
cells.unshift($headCell.pos - start);
|
|
767
|
-
var ranges = cells.map(function (pos) {
|
|
768
|
-
var cell = table.nodeAt(pos), from = pos + start + 1;
|
|
769
|
-
return new SelectionRange(doc.resolve(from), doc.resolve(from + cell.content.size));
|
|
770
|
-
});
|
|
771
|
-
_this = _super.call(this, ranges[0].$from, ranges[0].$to, ranges) || this;
|
|
772
|
-
// :: ResolvedPos
|
|
773
|
-
// A resolved position pointing _in front of_ the anchor cell (the one
|
|
774
|
-
// that doesn't move when extending the selection).
|
|
775
|
-
_this.$anchorCell = $anchorCell;
|
|
776
|
-
// :: ResolvedPos
|
|
777
|
-
// A resolved position pointing in front of the head cell (the one
|
|
778
|
-
// moves when extending the selection).
|
|
779
|
-
_this.$headCell = $headCell;
|
|
780
|
-
return _this;
|
|
781
|
-
}
|
|
782
|
-
// :: (ResolvedPos, ?ResolvedPos) → CellSelection
|
|
783
|
-
// Returns the smallest column selection that covers the given anchor
|
|
784
|
-
// and head cell.
|
|
785
|
-
CellSelection.colSelection = function ($anchorCell, $headCell) {
|
|
786
|
-
if ($headCell === void 0) { $headCell = $anchorCell; }
|
|
787
|
-
var map$$1 = TableMap.get($anchorCell.node(-1));
|
|
788
|
-
var start = $anchorCell.start(-1);
|
|
789
|
-
var anchorRect = map$$1.findCell($anchorCell.pos - start);
|
|
790
|
-
var headRect = map$$1.findCell($headCell.pos - start);
|
|
791
|
-
var doc = $anchorCell.node(0);
|
|
792
|
-
if (anchorRect.top <= headRect.top) {
|
|
793
|
-
if (anchorRect.top > 0) {
|
|
794
|
-
$anchorCell = doc.resolve(start + map$$1.map[anchorRect.left]);
|
|
795
|
-
}
|
|
796
|
-
if (headRect.bottom < map$$1.height) {
|
|
797
|
-
$headCell = doc.resolve(start + map$$1.map[map$$1.width * (map$$1.height - 1) + headRect.right - 1]);
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
|
-
else {
|
|
801
|
-
if (headRect.top > 0) {
|
|
802
|
-
$headCell = doc.resolve(start + map$$1.map[headRect.left]);
|
|
803
|
-
}
|
|
804
|
-
if (anchorRect.bottom < map$$1.height) {
|
|
805
|
-
$anchorCell = doc.resolve(start + map$$1.map[map$$1.width * (map$$1.height - 1) + anchorRect.right - 1]);
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
return new CellSelection($anchorCell, $headCell);
|
|
809
|
-
};
|
|
810
|
-
// :: (ResolvedPos, ?ResolvedPos) → CellSelection
|
|
811
|
-
// Returns the smallest row selection that covers the given anchor
|
|
812
|
-
// and head cell.
|
|
813
|
-
CellSelection.rowSelection = function ($anchorCell, $headCell) {
|
|
814
|
-
if ($headCell === void 0) { $headCell = $anchorCell; }
|
|
815
|
-
var map$$1 = TableMap.get($anchorCell.node(-1));
|
|
816
|
-
var start = $anchorCell.start(-1);
|
|
817
|
-
var anchorRect = map$$1.findCell($anchorCell.pos - start);
|
|
818
|
-
var headRect = map$$1.findCell($headCell.pos - start);
|
|
819
|
-
var doc = $anchorCell.node(0);
|
|
820
|
-
if (anchorRect.left <= headRect.left) {
|
|
821
|
-
if (anchorRect.left > 0) {
|
|
822
|
-
$anchorCell = doc.resolve(start + map$$1.map[anchorRect.top * map$$1.width]);
|
|
823
|
-
}
|
|
824
|
-
if (headRect.right < map$$1.width) {
|
|
825
|
-
$headCell = doc.resolve(start + map$$1.map[map$$1.width * (headRect.top + 1) - 1]);
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
else {
|
|
829
|
-
if (headRect.left > 0) {
|
|
830
|
-
$headCell = doc.resolve(start + map$$1.map[headRect.top * map$$1.width]);
|
|
831
|
-
}
|
|
832
|
-
if (anchorRect.right < map$$1.width) {
|
|
833
|
-
$anchorCell = doc.resolve(start + map$$1.map[map$$1.width * (anchorRect.top + 1) - 1]);
|
|
834
|
-
}
|
|
835
|
-
}
|
|
836
|
-
return new CellSelection($anchorCell, $headCell);
|
|
837
|
-
};
|
|
838
|
-
CellSelection.fromJSON = function (doc, json) {
|
|
839
|
-
return new CellSelection(doc.resolve(json.anchor), doc.resolve(json.head));
|
|
840
|
-
};
|
|
841
|
-
// :: (Node, number, ?number) → CellSelection
|
|
842
|
-
CellSelection.create = function (doc, anchorCell, headCell) {
|
|
843
|
-
if (headCell === void 0) { headCell = anchorCell; }
|
|
844
|
-
return new CellSelection(doc.resolve(anchorCell), doc.resolve(headCell));
|
|
845
|
-
};
|
|
846
|
-
CellSelection.prototype.map = function (doc, mapping) {
|
|
847
|
-
var $anchorCell = doc.resolve(mapping.map(this.$anchorCell.pos));
|
|
848
|
-
var $headCell = doc.resolve(mapping.map(this.$headCell.pos));
|
|
849
|
-
if (pointsAtCell($anchorCell) && pointsAtCell($headCell) && inSameTable($anchorCell, $headCell)) {
|
|
850
|
-
var tableChanged = this.$anchorCell.node(-1) !== $anchorCell.node(-1);
|
|
851
|
-
if (tableChanged && this.isRowSelection()) {
|
|
852
|
-
return CellSelection.rowSelection($anchorCell, $headCell);
|
|
853
|
-
}
|
|
854
|
-
else {
|
|
855
|
-
if (tableChanged && this.isColSelection()) {
|
|
856
|
-
return CellSelection.colSelection($anchorCell, $headCell);
|
|
857
|
-
}
|
|
858
|
-
else {
|
|
859
|
-
return new CellSelection($anchorCell, $headCell);
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
}
|
|
863
|
-
return TextSelection.between($anchorCell, $headCell);
|
|
864
|
-
};
|
|
865
|
-
// :: () → Slice
|
|
866
|
-
// Returns a rectangular slice of table rows containing the selected
|
|
867
|
-
// cells.
|
|
868
|
-
CellSelection.prototype.content = function () {
|
|
869
|
-
var table = this.$anchorCell.node(-1), map$$1 = TableMap.get(table), start = this.$anchorCell.start(-1);
|
|
870
|
-
var rect = map$$1.rectBetween(this.$anchorCell.pos - start, this.$headCell.pos - start);
|
|
871
|
-
var seen = {}, rows = [];
|
|
872
|
-
for (var row = rect.top; row < rect.bottom; row++) {
|
|
873
|
-
var rowContent = [];
|
|
874
|
-
for (var index = row * map$$1.width + rect.left, col = rect.left; col < rect.right; col++, index++) {
|
|
875
|
-
var pos = map$$1.map[index];
|
|
876
|
-
if (!seen[pos]) {
|
|
877
|
-
seen[pos] = true;
|
|
878
|
-
var cellRect = map$$1.findCell(pos), cell = table.nodeAt(pos);
|
|
879
|
-
var extraLeft = rect.left - cellRect.left, extraRight = cellRect.right - rect.right;
|
|
880
|
-
if (extraLeft > 0 || extraRight > 0) {
|
|
881
|
-
var attrs = cell.attrs;
|
|
882
|
-
if (extraLeft > 0) {
|
|
883
|
-
attrs = removeColSpan(attrs, 0, extraLeft);
|
|
884
|
-
}
|
|
885
|
-
if (extraRight > 0) {
|
|
886
|
-
attrs = removeColSpan(attrs, attrs.colspan - extraRight, extraRight);
|
|
887
|
-
}
|
|
888
|
-
if (cellRect.left < rect.left) {
|
|
889
|
-
cell = cell.type.createAndFill(attrs);
|
|
890
|
-
}
|
|
891
|
-
else {
|
|
892
|
-
cell = cell.type.create(attrs, cell.content);
|
|
893
|
-
}
|
|
894
|
-
}
|
|
895
|
-
if (cellRect.top < rect.top || cellRect.bottom > rect.bottom) {
|
|
896
|
-
var attrs = setAttr(cell.attrs, 'rowspan', Math.min(cellRect.bottom, rect.bottom) - Math.max(cellRect.top, rect.top));
|
|
897
|
-
if (cellRect.top < rect.top) {
|
|
898
|
-
cell = cell.type.createAndFill(attrs);
|
|
899
|
-
}
|
|
900
|
-
else {
|
|
901
|
-
cell = cell.type.create(attrs, cell.content);
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
|
-
rowContent.push(cell);
|
|
905
|
-
}
|
|
906
|
-
}
|
|
907
|
-
rows.push(table.child(row).copy(Fragment.from(rowContent)));
|
|
908
|
-
}
|
|
909
|
-
var fragment = this.isColSelection() && this.isRowSelection() ? table : rows;
|
|
910
|
-
return new Slice(Fragment.from(fragment), 1, 1);
|
|
911
|
-
};
|
|
912
|
-
CellSelection.prototype.replace = function (tr, content) {
|
|
913
|
-
if (content === void 0) { content = Slice.empty; }
|
|
914
|
-
var mapFrom = tr.steps.length;
|
|
915
|
-
var ranges = this.ranges;
|
|
916
|
-
for (var i = 0; i < ranges.length; i++) {
|
|
917
|
-
var _a = ranges[i], $from = _a.$from, $to = _a.$to;
|
|
918
|
-
var mapping = tr.mapping.slice(mapFrom);
|
|
919
|
-
tr.replace(mapping.map($from.pos), mapping.map($to.pos), i ? Slice.empty : content);
|
|
920
|
-
}
|
|
921
|
-
var sel = Selection.findFrom(tr.doc.resolve(tr.mapping.slice(mapFrom).map(this.to)), -1);
|
|
922
|
-
if (sel) {
|
|
923
|
-
tr.setSelection(sel);
|
|
924
|
-
}
|
|
925
|
-
};
|
|
926
|
-
CellSelection.prototype.replaceWith = function (tr, node) {
|
|
927
|
-
this.replace(tr, new Slice(Fragment.from(node), 0, 0));
|
|
928
|
-
};
|
|
929
|
-
CellSelection.prototype.forEachCell = function (f) {
|
|
930
|
-
var table = this.$anchorCell.node(-1);
|
|
931
|
-
var map$$1 = TableMap.get(table);
|
|
932
|
-
var start = this.$anchorCell.start(-1);
|
|
933
|
-
var cells = map$$1.cellsInRect(map$$1.rectBetween(this.$anchorCell.pos - start, this.$headCell.pos - start));
|
|
934
|
-
for (var i = 0; i < cells.length; i++) {
|
|
935
|
-
f(table.nodeAt(cells[i]), start + cells[i]);
|
|
936
|
-
}
|
|
937
|
-
};
|
|
938
|
-
// :: () → bool
|
|
939
|
-
// True if this selection goes all the way from the top to the
|
|
940
|
-
// bottom of the table.
|
|
941
|
-
CellSelection.prototype.isColSelection = function () {
|
|
942
|
-
var anchorTop = this.$anchorCell.index(-1), headTop = this.$headCell.index(-1);
|
|
943
|
-
if (Math.min(anchorTop, headTop) > 0) {
|
|
944
|
-
return false;
|
|
945
|
-
}
|
|
946
|
-
var anchorBot = anchorTop + this.$anchorCell.nodeAfter.attrs.rowspan;
|
|
947
|
-
var headBot = headTop + this.$headCell.nodeAfter.attrs.rowspan;
|
|
948
|
-
return Math.max(anchorBot, headBot) === this.$headCell.node(-1).childCount;
|
|
949
|
-
};
|
|
950
|
-
// :: () → bool
|
|
951
|
-
// True if this selection goes all the way from the left to the
|
|
952
|
-
// right of the table.
|
|
953
|
-
CellSelection.prototype.isRowSelection = function () {
|
|
954
|
-
var map$$1 = TableMap.get(this.$anchorCell.node(-1));
|
|
955
|
-
var start = this.$anchorCell.start(-1);
|
|
956
|
-
var anchorLeft = map$$1.colCount(this.$anchorCell.pos - start);
|
|
957
|
-
var headLeft = map$$1.colCount(this.$headCell.pos - start);
|
|
958
|
-
if (Math.min(anchorLeft, headLeft) > 0) {
|
|
959
|
-
return false;
|
|
960
|
-
}
|
|
961
|
-
var anchorRight = anchorLeft + this.$anchorCell.nodeAfter.attrs.colspan;
|
|
962
|
-
var headRight = headLeft + this.$headCell.nodeAfter.attrs.colspan;
|
|
963
|
-
return Math.max(anchorRight, headRight) === map$$1.width;
|
|
964
|
-
};
|
|
965
|
-
CellSelection.prototype.eq = function (other) {
|
|
966
|
-
return (other instanceof CellSelection && other.$anchorCell.pos === this.$anchorCell.pos && other.$headCell.pos === this.$headCell.pos);
|
|
967
|
-
};
|
|
968
|
-
CellSelection.prototype.toJSON = function () {
|
|
969
|
-
return { type: 'cell', anchor: this.$anchorCell.pos, head: this.$headCell.pos };
|
|
970
|
-
};
|
|
971
|
-
CellSelection.prototype.getBookmark = function () {
|
|
972
|
-
return new CellBookmark(this.$anchorCell.pos, this.$headCell.pos);
|
|
973
|
-
};
|
|
974
|
-
return CellSelection;
|
|
975
|
-
}(Selection));
|
|
976
|
-
CellSelection.prototype.visible = false;
|
|
977
|
-
Selection.jsonID('table_cell', CellSelection);
|
|
978
|
-
var CellBookmark = /** @class */ (function () {
|
|
979
|
-
function CellBookmark(anchor, head) {
|
|
980
|
-
this.anchor = anchor;
|
|
981
|
-
this.head = head;
|
|
982
|
-
}
|
|
983
|
-
CellBookmark.prototype.map = function (mapping) {
|
|
984
|
-
return new CellBookmark(mapping.map(this.anchor), mapping.map(this.head));
|
|
985
|
-
};
|
|
986
|
-
CellBookmark.prototype.resolve = function (doc) {
|
|
987
|
-
var $anchorCell = doc.resolve(this.anchor), $headCell = doc.resolve(this.head);
|
|
988
|
-
if ($anchorCell.parent.type.spec.tableRole === 'row' &&
|
|
989
|
-
$headCell.parent.type.spec.tableRole === 'row' &&
|
|
990
|
-
$anchorCell.index() < $anchorCell.parent.childCount &&
|
|
991
|
-
$headCell.index() < $headCell.parent.childCount &&
|
|
992
|
-
inSameTable($anchorCell, $headCell)) {
|
|
993
|
-
return new CellSelection($anchorCell, $headCell);
|
|
994
|
-
}
|
|
995
|
-
else {
|
|
996
|
-
return Selection.near($headCell, 1);
|
|
997
|
-
}
|
|
998
|
-
};
|
|
999
|
-
return CellBookmark;
|
|
1000
|
-
}());
|
|
1001
|
-
|
|
1002
|
-
/**
|
|
1003
|
-
* @hidden
|
|
1004
|
-
*/
|
|
1005
|
-
var findParentNodeClosestToPos = function ($pos, predicate) {
|
|
1006
|
-
for (var i = $pos.depth; i > 0; i--) {
|
|
1007
|
-
var node = $pos.node(i);
|
|
1008
|
-
if (predicate(node)) {
|
|
1009
|
-
return {
|
|
1010
|
-
start: $pos.start(i),
|
|
1011
|
-
pos: i > 0 ? $pos.before(i) : 0,
|
|
1012
|
-
depth: i,
|
|
1013
|
-
node: node
|
|
1014
|
-
};
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
1017
|
-
};
|
|
1018
|
-
/**
|
|
1019
|
-
* @hidden
|
|
1020
|
-
*/
|
|
1021
|
-
var createTable = function (nodes$$1, rows, columns) {
|
|
1022
|
-
var table = nodes$$1.table, table_body = nodes$$1.table_body, table_row = nodes$$1.table_row, table_cell = nodes$$1.table_cell;
|
|
1023
|
-
var tableRows = [];
|
|
1024
|
-
var cells;
|
|
1025
|
-
for (var r = 0; r < rows + 1; r++) {
|
|
1026
|
-
cells = [];
|
|
1027
|
-
for (var c = 0; c < columns + 1; c++) {
|
|
1028
|
-
cells.push(table_cell.createAndFill());
|
|
1029
|
-
}
|
|
1030
|
-
tableRows.push(table_row.createAndFill(undefined, cells));
|
|
1031
|
-
}
|
|
1032
|
-
var body = table_body.createAndFill(undefined, tableRows);
|
|
1033
|
-
return table.createAndFill(undefined, body);
|
|
1034
|
-
};
|
|
1035
|
-
/**
|
|
1036
|
-
* @hidden
|
|
1037
|
-
*/
|
|
1038
|
-
var isInTable = function (state) {
|
|
1039
|
-
var $head = state.selection.$head;
|
|
1040
|
-
for (var d = $head.depth; d > 0; d--) {
|
|
1041
|
-
if (isTableRow($head.node(d))) {
|
|
1042
|
-
return true;
|
|
1043
|
-
}
|
|
1044
|
-
}
|
|
1045
|
-
return false;
|
|
1046
|
-
};
|
|
1047
|
-
/**
|
|
1048
|
-
* @hidden
|
|
1049
|
-
*/
|
|
1050
|
-
var setAttr = function (attrs, name, value) {
|
|
1051
|
-
var result = {};
|
|
1052
|
-
// tslint:disable-next-line
|
|
1053
|
-
for (var prop in attrs) {
|
|
1054
|
-
result[prop] = attrs[prop];
|
|
1055
|
-
}
|
|
1056
|
-
result[name] = value;
|
|
1057
|
-
return result;
|
|
1058
|
-
};
|
|
1059
|
-
var cellNear = function ($pos) {
|
|
1060
|
-
for (var after = $pos.nodeAfter, pos = $pos.pos; after; after = after.firstChild, pos++) {
|
|
1061
|
-
var role = after.type.spec.tableRole;
|
|
1062
|
-
if (role === 'cell' || role === 'header_cell') {
|
|
1063
|
-
return $pos.doc.resolve(pos);
|
|
1064
|
-
}
|
|
1065
|
-
}
|
|
1066
|
-
for (var before = $pos.nodeBefore, pos = $pos.pos; before; before = before.lastChild, pos--) {
|
|
1067
|
-
var role = before.type.spec.tableRole;
|
|
1068
|
-
if (role === 'cell' || role === 'header_cell') {
|
|
1069
|
-
return $pos.doc.resolve(pos - before.nodeSize);
|
|
1070
|
-
}
|
|
1071
|
-
}
|
|
1072
|
-
};
|
|
1073
|
-
var cellAround = function ($pos) {
|
|
1074
|
-
for (var d = $pos.depth - 1; d > 0; d--) {
|
|
1075
|
-
if (isTableRow($pos.node(d))) {
|
|
1076
|
-
return $pos.node(0).resolve($pos.before(d + 1));
|
|
1077
|
-
}
|
|
1078
|
-
}
|
|
1079
|
-
return null;
|
|
1080
|
-
};
|
|
1081
|
-
var selectionCell = function (sel) {
|
|
1082
|
-
if (sel instanceof CellSelection && sel.$anchorCell) {
|
|
1083
|
-
return sel.$anchorCell.pos > sel.$headCell.pos ? sel.$anchorCell : sel.$headCell;
|
|
1084
|
-
}
|
|
1085
|
-
else if (sel instanceof NodeSelection && sel.node && isTableCell(sel.node)) {
|
|
1086
|
-
return sel.$anchor;
|
|
1087
|
-
}
|
|
1088
|
-
return cellAround(sel.$head) || cellNear(sel.$head);
|
|
1089
|
-
};
|
|
1090
|
-
/**
|
|
1091
|
-
* @hidden
|
|
1092
|
-
*/
|
|
1093
|
-
// Helper to get the selected rectangle in a table, if any. Adds table
|
|
1094
|
-
// map, table node, and table start offset to the object for
|
|
1095
|
-
// convenience.
|
|
1096
|
-
var selectedRect = function (sel) {
|
|
1097
|
-
// create arr of rect for each table section
|
|
1098
|
-
// there has to be a rect for thead, tbody and tfoot(if each exists)
|
|
1099
|
-
// and NOT for colgroups
|
|
1100
|
-
var $pos = selectionCell(sel);
|
|
1101
|
-
var table = $pos.node(-1);
|
|
1102
|
-
var tableStart = $pos.start(-1);
|
|
1103
|
-
var map$$1 = TableMap.get(table);
|
|
1104
|
-
var rect = sel instanceof CellSelection
|
|
1105
|
-
? map$$1.rectBetween(sel.$anchorCell.pos - tableStart, sel.$headCell.pos - tableStart)
|
|
1106
|
-
: map$$1.findCell($pos.pos - tableStart);
|
|
1107
|
-
rect.tableStart = tableStart;
|
|
1108
|
-
rect.map = map$$1;
|
|
1109
|
-
rect.table = table;
|
|
1110
|
-
return rect;
|
|
1111
|
-
};
|
|
1112
|
-
/**
|
|
1113
|
-
* @hidden
|
|
1114
|
-
*/
|
|
1115
|
-
// this has to be removed since the schema should not have roles inside NodeSpec.
|
|
1116
|
-
var tableNodeTypes = function (schema) {
|
|
1117
|
-
var result = schema.cached.tableNodeTypes;
|
|
1118
|
-
if (!result) {
|
|
1119
|
-
result = schema.cached.tableNodeTypes = {};
|
|
1120
|
-
// tslint:disable-next-line
|
|
1121
|
-
for (var name_1 in schema.nodes) {
|
|
1122
|
-
var type = schema.nodes[name_1];
|
|
1123
|
-
var role = type.spec.tableRole;
|
|
1124
|
-
if (role) {
|
|
1125
|
-
result[role] = type;
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
}
|
|
1129
|
-
return result;
|
|
1130
|
-
};
|
|
1131
|
-
/**
|
|
1132
|
-
* @hidden
|
|
1133
|
-
*/
|
|
1134
|
-
var rowIsHeader = function (map$$1, table, row) {
|
|
1135
|
-
var headerCell = tableNodeTypes(table.type.schema).header_cell;
|
|
1136
|
-
for (var col = 0; col < map$$1.width; col++) {
|
|
1137
|
-
if (table.nodeAt(map$$1.map[col + row * map$$1.width]).type !== headerCell) {
|
|
1138
|
-
return false;
|
|
1139
|
-
}
|
|
1140
|
-
}
|
|
1141
|
-
return true;
|
|
1142
|
-
};
|
|
1143
|
-
/**
|
|
1144
|
-
* @hidden
|
|
1145
|
-
*/
|
|
1146
|
-
var addColSpan = function (attrs, pos, n) {
|
|
1147
|
-
if (n === void 0) { n = 1; }
|
|
1148
|
-
var result = setAttr(attrs, 'colspan', attrs.colspan + n);
|
|
1149
|
-
if (result.colwidth) {
|
|
1150
|
-
result.colwidth = result.colwidth.slice();
|
|
1151
|
-
for (var i = 0; i < n; i++) {
|
|
1152
|
-
result.colwidth.splice(pos, 0, 0);
|
|
1153
|
-
}
|
|
1154
|
-
}
|
|
1155
|
-
return result;
|
|
1156
|
-
};
|
|
1157
|
-
/**
|
|
1158
|
-
* @hidden
|
|
1159
|
-
*/
|
|
1160
|
-
var removeColSpan = function (attrs, pos, n) {
|
|
1161
|
-
if (n === void 0) { n = 1; }
|
|
1162
|
-
var result = setAttr(attrs, 'colspan', attrs.colspan - n);
|
|
1163
|
-
if (result.colwidth) {
|
|
1164
|
-
result.colwidth = result.colwidth.slice();
|
|
1165
|
-
result.colwidth.splice(pos, n);
|
|
1166
|
-
if (!result.colwidth.some(function (w) { return w > 0; })) {
|
|
1167
|
-
result.colwidth = null;
|
|
1168
|
-
}
|
|
1169
|
-
}
|
|
1170
|
-
return result;
|
|
1171
|
-
};
|
|
1172
|
-
/**
|
|
1173
|
-
* @hidden
|
|
1174
|
-
*/
|
|
1175
|
-
var isCellEmpty = function (cell) {
|
|
1176
|
-
var c = cell.content;
|
|
1177
|
-
return c.childCount === 1 && c.firstChild.isTextblock && c.firstChild.childCount === 0;
|
|
1178
|
-
};
|
|
1179
|
-
var cellWrapping = function ($pos) {
|
|
1180
|
-
for (var d = $pos.depth; d > 0; d--) {
|
|
1181
|
-
// Sometimes the cell can be in the same depth.
|
|
1182
|
-
var role = $pos.node(d).type.spec.tableRole;
|
|
1183
|
-
if (role === 'cell' || role === 'header_cell') {
|
|
1184
|
-
return $pos.node(d);
|
|
1185
|
-
}
|
|
1186
|
-
}
|
|
1187
|
-
return null;
|
|
1188
|
-
};
|
|
1189
|
-
/**
|
|
1190
|
-
* @hidden
|
|
1191
|
-
*/
|
|
1192
|
-
// Split a selected cell, whose rowpan or colspan is greater than one,
|
|
1193
|
-
// into smaller cells with the cell type (th, td) returned by getType function.
|
|
1194
|
-
var splitCellWithType = function (getCellType) {
|
|
1195
|
-
return function (state, dispatch) {
|
|
1196
|
-
var sel = state.selection;
|
|
1197
|
-
var cellNode;
|
|
1198
|
-
var cellPos;
|
|
1199
|
-
if (!(sel instanceof CellSelection)) {
|
|
1200
|
-
cellNode = cellWrapping(sel.$from);
|
|
1201
|
-
if (!cellNode) {
|
|
1202
|
-
return false;
|
|
1203
|
-
}
|
|
1204
|
-
cellPos = cellAround(sel.$from).pos;
|
|
1205
|
-
}
|
|
1206
|
-
else {
|
|
1207
|
-
if (sel.$anchorCell.pos !== sel.$headCell.pos) {
|
|
1208
|
-
return false;
|
|
1209
|
-
}
|
|
1210
|
-
cellNode = sel.$anchorCell.nodeAfter;
|
|
1211
|
-
cellPos = sel.$anchorCell.pos;
|
|
1212
|
-
}
|
|
1213
|
-
if (cellNode.attrs.colspan === 1 && cellNode.attrs.rowspan === 1) {
|
|
1214
|
-
return false;
|
|
1215
|
-
}
|
|
1216
|
-
if (dispatch) {
|
|
1217
|
-
var baseAttrs = cellNode.attrs;
|
|
1218
|
-
var attrs = [];
|
|
1219
|
-
var colwidth = baseAttrs.colwidth;
|
|
1220
|
-
if (baseAttrs.rowspan > 1) {
|
|
1221
|
-
baseAttrs = setAttr(baseAttrs, 'rowspan', 1);
|
|
1222
|
-
}
|
|
1223
|
-
if (baseAttrs.colspan > 1) {
|
|
1224
|
-
baseAttrs = setAttr(baseAttrs, 'colspan', 1);
|
|
1225
|
-
}
|
|
1226
|
-
var rect = selectedRect(state);
|
|
1227
|
-
var tr = state.tr;
|
|
1228
|
-
for (var i = 0; i < rect.right - rect.left; i++) {
|
|
1229
|
-
attrs.push(colwidth ? setAttr(baseAttrs, 'colwidth', colwidth && colwidth[i] ? [colwidth[i]] : null) : baseAttrs);
|
|
1230
|
-
}
|
|
1231
|
-
var lastCell = void 0;
|
|
1232
|
-
for (var row = rect.top; row < rect.bottom; row++) {
|
|
1233
|
-
var pos = rect.map.positionAt(row, rect.left, rect.table);
|
|
1234
|
-
if (row === rect.top) {
|
|
1235
|
-
pos += cellNode.nodeSize;
|
|
1236
|
-
}
|
|
1237
|
-
for (var col = rect.left, i = 0; col < rect.right; col++, i++) {
|
|
1238
|
-
if (col === rect.left && row === rect.top) {
|
|
1239
|
-
continue;
|
|
1240
|
-
}
|
|
1241
|
-
tr.insert((lastCell = tr.mapping.map(pos + rect.tableStart, 1)), getCellType({ node: cellNode, row: row, col: col }).createAndFill(attrs[i]));
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1244
|
-
tr.setNodeMarkup(cellPos, getCellType({ node: cellNode, row: rect.top, col: rect.left }), attrs[0]);
|
|
1245
|
-
if (sel instanceof CellSelection) {
|
|
1246
|
-
tr.setSelection(new CellSelection(tr.doc.resolve(sel.$anchorCell.pos), lastCell && tr.doc.resolve(lastCell)));
|
|
1247
|
-
}
|
|
1248
|
-
dispatch(tr);
|
|
1249
|
-
}
|
|
1250
|
-
return true;
|
|
1251
|
-
};
|
|
1252
|
-
};
|
|
1253
|
-
/**
|
|
1254
|
-
* @hidden
|
|
1255
|
-
*/
|
|
1256
|
-
var pointsAtCell = function ($pos) {
|
|
1257
|
-
return isTableRow($pos.parent) && $pos.nodeAfter;
|
|
1258
|
-
};
|
|
1259
|
-
/**
|
|
1260
|
-
* @hidden
|
|
1261
|
-
*/
|
|
1262
|
-
var inSameTable = function ($a, $b) {
|
|
1263
|
-
return $a.depth === $b.depth && $a.pos >= $b.start(-1) && $a.pos <= $b.end(-1);
|
|
1264
|
-
};
|
|
1265
|
-
/**
|
|
1266
|
-
* @hidden
|
|
1267
|
-
*/
|
|
1268
|
-
var cellsOverlapRectangle = function (_a, rect) {
|
|
1269
|
-
var width = _a.width, height = _a.height, map$$1 = _a.map;
|
|
1270
|
-
var indexTop = rect.top * width + rect.left;
|
|
1271
|
-
var indexLeft = indexTop;
|
|
1272
|
-
var indexBottom = (rect.bottom - 1) * width + rect.left;
|
|
1273
|
-
var indexRight = indexTop + (rect.right - rect.left - 1);
|
|
1274
|
-
for (var i = rect.top; i < rect.bottom; i++) {
|
|
1275
|
-
if ((rect.left > 0 && map$$1[indexLeft] === map$$1[indexLeft - 1]) || (rect.right < width && map$$1[indexRight] === map$$1[indexRight + 1])) {
|
|
1276
|
-
return true;
|
|
1277
|
-
}
|
|
1278
|
-
indexLeft += width;
|
|
1279
|
-
indexRight += width;
|
|
1280
|
-
}
|
|
1281
|
-
for (var i = rect.left; i < rect.right; i++) {
|
|
1282
|
-
if ((rect.top > 0 && map$$1[indexTop] === map$$1[indexTop - width]) ||
|
|
1283
|
-
(rect.bottom < height && map$$1[indexBottom] === map$$1[indexBottom + width])) {
|
|
1284
|
-
return true;
|
|
1285
|
-
}
|
|
1286
|
-
indexTop++;
|
|
1287
|
-
indexBottom++;
|
|
1288
|
-
}
|
|
1289
|
-
return false;
|
|
1290
|
-
};
|
|
1291
|
-
|
|
1292
|
-
/**
|
|
1293
|
-
* @hidden
|
|
1294
|
-
*/
|
|
1295
|
-
var insertTable = function (attrs) { return function (state, dispatch) {
|
|
1296
|
-
var newTable = createTable(state.schema.nodes, attrs.rows, attrs.cols);
|
|
1297
|
-
if (newTable) {
|
|
1298
|
-
insertNode(newTable, true)(state, dispatch);
|
|
1299
|
-
}
|
|
1300
|
-
}; };
|
|
1301
|
-
var addTableGroupColumn = function (tr, _a, col, mainTable, requiredGroup, doc) {
|
|
1302
|
-
var left = _a.left, right = _a.right;
|
|
1303
|
-
var refColumn = col > 0 ? -1 : 0;
|
|
1304
|
-
// not sure if this should be deleted
|
|
1305
|
-
// if (columnIsHeader(map, table, col + refColumn)) {
|
|
1306
|
-
// refColumn = col === 0 || col === map.width ? null : 0;
|
|
1307
|
-
// }
|
|
1308
|
-
var rect;
|
|
1309
|
-
mainTable.node.descendants(function (tableChildNode, offset) {
|
|
1310
|
-
if (requiredGroup(tableChildNode)) {
|
|
1311
|
-
var i_1 = -1;
|
|
1312
|
-
tableChildNode.firstChild.descendants(function (childNode, pos) {
|
|
1313
|
-
if (isTableCell(childNode) || isTableHeaderCell(childNode)) {
|
|
1314
|
-
i_1 = i_1 + 1;
|
|
1315
|
-
if (i_1 === right || i_1 === left) {
|
|
1316
|
-
var selection = new Selection(doc.resolve(pos + offset + mainTable.start), doc.resolve(pos + offset + mainTable.start));
|
|
1317
|
-
rect = selectedRect(selection);
|
|
1318
|
-
}
|
|
1319
|
-
}
|
|
1320
|
-
});
|
|
1321
|
-
}
|
|
1322
|
-
});
|
|
1323
|
-
// Do nothing if thead, tfoot or tbody is missing
|
|
1324
|
-
if (!rect) {
|
|
1325
|
-
return tr;
|
|
1326
|
-
}
|
|
1327
|
-
for (var row = 0; row < rect.map.height; row++) {
|
|
1328
|
-
var index = row * rect.map.width + col;
|
|
1329
|
-
// If this position falls inside a col-spanning cell
|
|
1330
|
-
if (col > 0 && col < rect.map.width && rect.map.map[index - 1] === rect.map.map[index]) {
|
|
1331
|
-
var pos = rect.map.map[index];
|
|
1332
|
-
var cell = rect.table.nodeAt(pos);
|
|
1333
|
-
tr.setNodeMarkup(tr.mapping.map(rect.tableStart + pos), null, addColSpan(cell.attrs, col - rect.map.colCount(pos)));
|
|
1334
|
-
// Skip ahead if rowspan > 1
|
|
1335
|
-
row += cell.attrs.rowspan - 1;
|
|
1336
|
-
}
|
|
1337
|
-
else {
|
|
1338
|
-
var type = rect.table.nodeAt(rect.map.map[index + refColumn]).type;
|
|
1339
|
-
var pos = rect.map.positionAt(row, col, rect.table);
|
|
1340
|
-
tr.insert(tr.mapping.map(rect.tableStart + pos), type.createAndFill());
|
|
1341
|
-
}
|
|
1342
|
-
}
|
|
1343
|
-
return tr;
|
|
1344
|
-
};
|
|
1345
|
-
var removeTableGroupColumn = function (tr, _a, mainTable, requiredGroup, doc) {
|
|
1346
|
-
var right = _a.right, left = _a.left;
|
|
1347
|
-
var rect;
|
|
1348
|
-
mainTable.node.descendants(function (tableChildNode, offset) {
|
|
1349
|
-
if (requiredGroup(tableChildNode)) {
|
|
1350
|
-
var i_2 = -1;
|
|
1351
|
-
tableChildNode.firstChild.descendants(function (childNode, pos) {
|
|
1352
|
-
if (isTableCell(childNode) || isTableHeaderCell(childNode)) {
|
|
1353
|
-
i_2 = i_2 + 1;
|
|
1354
|
-
if (i_2 >= left && i_2 < right) {
|
|
1355
|
-
var resolvedPos = doc.resolve(pos + offset + mainTable.start + childNode.nodeSize);
|
|
1356
|
-
var selection = new Selection(resolvedPos, resolvedPos);
|
|
1357
|
-
rect = selectedRect(selection);
|
|
1358
|
-
}
|
|
1359
|
-
}
|
|
1360
|
-
});
|
|
1361
|
-
}
|
|
1362
|
-
});
|
|
1363
|
-
// Do nothing if thead, tfoot or tbody is missing
|
|
1364
|
-
if (!rect) {
|
|
1365
|
-
return;
|
|
1366
|
-
}
|
|
1367
|
-
for (var i = rect.right - 1;; i--) {
|
|
1368
|
-
removeColumn(tr, rect, i);
|
|
1369
|
-
if (i === rect.left) {
|
|
1370
|
-
break;
|
|
1371
|
-
}
|
|
1372
|
-
rect.table = rect.tableStart ? tr.doc.nodeAt(rect.tableStart - 1) : tr.doc;
|
|
1373
|
-
rect.map = TableMap.get(rect.table);
|
|
1374
|
-
}
|
|
1375
|
-
return;
|
|
1376
|
-
};
|
|
1377
|
-
var removeColumn = function (tr, _a, col) {
|
|
1378
|
-
var map$$1 = _a.map, table = _a.table, tableStart = _a.tableStart;
|
|
1379
|
-
for (var row = 0; row < map$$1.height;) {
|
|
1380
|
-
var index = row * map$$1.width + col;
|
|
1381
|
-
var pos = map$$1.map[index];
|
|
1382
|
-
var cell = table.nodeAt(pos);
|
|
1383
|
-
// If this is part of a col-spanning cell
|
|
1384
|
-
if ((col > 0 && map$$1.map[index - 1] === pos) || (col < map$$1.width - 1 && map$$1.map[index + 1] === pos)) {
|
|
1385
|
-
tr.setNodeMarkup(tr.mapping.map(tableStart + pos), null, removeColSpan(cell.attrs, col - map$$1.colCount(pos)));
|
|
1386
|
-
}
|
|
1387
|
-
else {
|
|
1388
|
-
var start = tr.mapping.map(tableStart + pos);
|
|
1389
|
-
tr.delete(start, start + cell.nodeSize);
|
|
1390
|
-
}
|
|
1391
|
-
row += cell.attrs.rowspan;
|
|
1392
|
-
}
|
|
1393
|
-
};
|
|
1394
|
-
/**
|
|
1395
|
-
* @hidden
|
|
1396
|
-
*/
|
|
1397
|
-
// Command to add a column before the column with the selection.
|
|
1398
|
-
var addColumnBefore$1 = function (state, dispatch) {
|
|
1399
|
-
if (!isInTable(state)) {
|
|
1400
|
-
return false;
|
|
1401
|
-
}
|
|
1402
|
-
if (dispatch) {
|
|
1403
|
-
var rect = selectedRect(state.selection);
|
|
1404
|
-
var mainTable = findParentNodeClosestToPos(state.selection.$anchor, isTable);
|
|
1405
|
-
var tHeadTr = addTableGroupColumn(state.tr, rect, rect.left, mainTable, isTableHead, state.doc);
|
|
1406
|
-
var tBodyTr = addTableGroupColumn(tHeadTr, rect, rect.left, mainTable, isTableBody, state.doc);
|
|
1407
|
-
var tFootTr = addTableGroupColumn(tBodyTr, rect, rect.left, mainTable, isTableFoot, state.doc);
|
|
1408
|
-
dispatch(tFootTr);
|
|
1409
|
-
}
|
|
1410
|
-
return true;
|
|
1411
|
-
};
|
|
1412
|
-
/**
|
|
1413
|
-
* @hidden
|
|
1414
|
-
*/
|
|
1415
|
-
// Command to add a column after the column with the selection.
|
|
1416
|
-
var addColumnAfter$1 = function (state, dispatch) {
|
|
1417
|
-
if (!isInTable(state)) {
|
|
1418
|
-
return false;
|
|
1419
|
-
}
|
|
1420
|
-
if (dispatch) {
|
|
1421
|
-
var rect = selectedRect(state.selection);
|
|
1422
|
-
var mainTable = findParentNodeClosestToPos(state.selection.$anchor, isTable);
|
|
1423
|
-
var theadTr = addTableGroupColumn(state.tr, rect, rect.right, mainTable, isTableHead, state.doc);
|
|
1424
|
-
var tBodyTr = addTableGroupColumn(theadTr, rect, rect.right, mainTable, isTableBody, state.doc);
|
|
1425
|
-
var tFootTr = addTableGroupColumn(tBodyTr, rect, rect.right, mainTable, isTableFoot, state.doc);
|
|
1426
|
-
dispatch(tFootTr);
|
|
1427
|
-
}
|
|
1428
|
-
return true;
|
|
1429
|
-
};
|
|
1430
|
-
var addRow = function (tr, _a, row) {
|
|
1431
|
-
var map$$1 = _a.map, tableStart = _a.tableStart, table = _a.table;
|
|
1432
|
-
var rowPos = tableStart;
|
|
1433
|
-
for (var i = 0; i < row; i++) {
|
|
1434
|
-
rowPos += table.child(i).nodeSize;
|
|
1435
|
-
}
|
|
1436
|
-
var cells = [];
|
|
1437
|
-
var refRow = row > 0 ? -1 : 0;
|
|
1438
|
-
if (rowIsHeader(map$$1, table, row + refRow)) {
|
|
1439
|
-
refRow = row === 0 || row === map$$1.height ? null : 0;
|
|
1440
|
-
}
|
|
1441
|
-
for (var col = 0, index = map$$1.width * row; col < map$$1.width; col++, index++) {
|
|
1442
|
-
// Covered by a rowspan cell
|
|
1443
|
-
if (row > 0 && row < map$$1.height && map$$1.map[index] === map$$1.map[index - map$$1.width]) {
|
|
1444
|
-
var pos = map$$1.map[index];
|
|
1445
|
-
var attrs = table.nodeAt(pos).attrs;
|
|
1446
|
-
tr.setNodeMarkup(tableStart + pos, null, setAttr(attrs, 'rowspan', attrs.rowspan + 1));
|
|
1447
|
-
col += attrs.colspan - 1;
|
|
1448
|
-
}
|
|
1449
|
-
else {
|
|
1450
|
-
var type = refRow == null ? tableNodeTypes(table.type.schema).cell : table.nodeAt(map$$1.map[index + refRow * map$$1.width]).type;
|
|
1451
|
-
cells.push(type.createAndFill());
|
|
1452
|
-
}
|
|
1453
|
-
}
|
|
1454
|
-
tr.insert(rowPos, tableNodeTypes(table.type.schema).row.create(null, cells));
|
|
1455
|
-
return tr;
|
|
73
|
+
var commonAttributes = function () {
|
|
74
|
+
return __assign({}, createDefaultAttributes(['class', 'id', 'style']));
|
|
1456
75
|
};
|
|
1457
76
|
/**
|
|
1458
77
|
* @hidden
|
|
1459
78
|
*/
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
var rect = selectedRect(state.selection);
|
|
1467
|
-
dispatch(addRow(state.tr, rect, rect.top));
|
|
1468
|
-
}
|
|
1469
|
-
return true;
|
|
79
|
+
var createDefaultAttributes = function (attrs) {
|
|
80
|
+
if (attrs === void 0) { attrs = []; }
|
|
81
|
+
return __assign({}, attrs.reduce(function (acc, curr) {
|
|
82
|
+
var _a;
|
|
83
|
+
return (__assign({}, acc, (_a = {}, _a[curr] = { default: null }, _a)));
|
|
84
|
+
}, {}));
|
|
1470
85
|
};
|
|
1471
86
|
/**
|
|
1472
87
|
* @hidden
|
|
1473
88
|
*/
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
89
|
+
var hole = 0;
|
|
90
|
+
|
|
91
|
+
var createSemanticNode = function (tagName) { return ({
|
|
92
|
+
// Uncaught SyntaxError: Mixing inline and block content (in content expression '(block | inline)*')
|
|
93
|
+
// content: '(block | inline)*',
|
|
94
|
+
content: 'block*',
|
|
95
|
+
group: 'block',
|
|
96
|
+
attrs: __assign({}, commonAttributes()),
|
|
97
|
+
parseDOM: [{
|
|
98
|
+
tag: tagName,
|
|
99
|
+
getAttrs: getAttributes
|
|
100
|
+
}],
|
|
101
|
+
toDOM: function (node) { return hasAttrs(node.attrs) ? [tagName, getAttrs(node.attrs), hole] : [tagName, hole]; }
|
|
102
|
+
}); };
|
|
1485
103
|
/**
|
|
1486
104
|
* @hidden
|
|
1487
105
|
*/
|
|
1488
|
-
|
|
1489
|
-
var
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
}
|
|
1493
|
-
if (dispatch) {
|
|
1494
|
-
var rect = selectedRect(state.selection);
|
|
1495
|
-
// if only one column left - delete the whole table
|
|
1496
|
-
if (rect.left === 0 && rect.right === rect.map.width) {
|
|
1497
|
-
return deleteTable$1(state, dispatch);
|
|
1498
|
-
}
|
|
1499
|
-
var mainTable = findParentNodeClosestToPos(state.selection.$anchor, isTable);
|
|
1500
|
-
var tr = state.tr;
|
|
1501
|
-
removeTableGroupColumn(tr, rect, mainTable, isTableFoot, tr.doc);
|
|
1502
|
-
removeTableGroupColumn(tr, rect, mainTable, isTableBody, tr.doc);
|
|
1503
|
-
removeTableGroupColumn(tr, rect, mainTable, isTableHead, tr.doc);
|
|
1504
|
-
dispatch(tr);
|
|
1505
|
-
}
|
|
1506
|
-
return true;
|
|
1507
|
-
};
|
|
1508
|
-
var removeRow = function (tr, _a, row) {
|
|
1509
|
-
var map$$1 = _a.map, table = _a.table, tableStart = _a.tableStart;
|
|
1510
|
-
var rowPos = 0;
|
|
1511
|
-
for (var i = 0; i < row; i++) {
|
|
1512
|
-
rowPos += table.child(i).nodeSize;
|
|
1513
|
-
}
|
|
1514
|
-
var nextRow = rowPos + table.child(row).nodeSize;
|
|
1515
|
-
var mapFrom = tr.mapping.maps.length;
|
|
1516
|
-
tr.delete(rowPos + tableStart, nextRow + tableStart);
|
|
1517
|
-
for (var col = 0, index = row * map$$1.width; col < map$$1.width; col++, index++) {
|
|
1518
|
-
var pos = map$$1.map[index];
|
|
1519
|
-
if (row > 0 && pos === map$$1.map[index - map$$1.width]) {
|
|
1520
|
-
// If this cell starts in the row above, simply reduce its rowspan
|
|
1521
|
-
var attrs = table.nodeAt(pos).attrs;
|
|
1522
|
-
tr.setNodeMarkup(tr.mapping.slice(mapFrom).map(pos + tableStart), null, setAttr(attrs, 'rowspan', attrs.rowspan - 1));
|
|
1523
|
-
col += attrs.colspan - 1;
|
|
1524
|
-
}
|
|
1525
|
-
else if (row < map$$1.width && pos === map$$1.map[index + map$$1.width]) {
|
|
1526
|
-
// Else, if it continues in the row below, it has to be moved down
|
|
1527
|
-
var cell = table.nodeAt(pos);
|
|
1528
|
-
var copy = cell.type.create(setAttr(cell.attrs, 'rowspan', cell.attrs.rowspan - 1), cell.content);
|
|
1529
|
-
var newPos = map$$1.positionAt(row + 1, col, table);
|
|
1530
|
-
tr.insert(tr.mapping.slice(mapFrom).map(tableStart + newPos), copy);
|
|
1531
|
-
col += cell.attrs.colspan - 1;
|
|
1532
|
-
}
|
|
1533
|
-
}
|
|
106
|
+
var semanticTagNames = ['article', 'main', 'nav', 'header', 'footer', 'aside', 'section'];
|
|
107
|
+
var ɵ1 = function (acc, curr) {
|
|
108
|
+
var _a;
|
|
109
|
+
return Object.assign(acc, (_a = {}, _a[curr] = createSemanticNode(curr), _a));
|
|
1534
110
|
};
|
|
1535
111
|
/**
|
|
1536
112
|
* @hidden
|
|
1537
113
|
*/
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
if (!isInTable(state)) {
|
|
1541
|
-
return false;
|
|
1542
|
-
}
|
|
1543
|
-
if (dispatch) {
|
|
1544
|
-
var rect_1 = selectedRect(state.selection);
|
|
1545
|
-
var tr = state.tr;
|
|
1546
|
-
if (rect_1.top === 0 && rect_1.bottom === rect_1.map.height) {
|
|
1547
|
-
var mainTable = findParentNodeClosestToPos(state.selection.$anchor, isTable);
|
|
1548
|
-
if (mainTable.node.childCount === 1) {
|
|
1549
|
-
deleteTable$1(state, dispatch);
|
|
1550
|
-
}
|
|
1551
|
-
else {
|
|
1552
|
-
deleteTableElement(function (n) { return n.type.name === rect_1.table.type.name; })(state, dispatch);
|
|
1553
|
-
}
|
|
1554
|
-
return true;
|
|
1555
|
-
}
|
|
1556
|
-
for (var i = rect_1.bottom - 1;; i--) {
|
|
1557
|
-
removeRow(tr, rect_1, i);
|
|
1558
|
-
if (i === rect_1.top) {
|
|
1559
|
-
break;
|
|
1560
|
-
}
|
|
1561
|
-
rect_1.table = rect_1.tableStart ? tr.doc.nodeAt(rect_1.tableStart - 1) : tr.doc;
|
|
1562
|
-
rect_1.map = TableMap.get(rect_1.table);
|
|
1563
|
-
}
|
|
1564
|
-
dispatch(tr);
|
|
1565
|
-
}
|
|
1566
|
-
return true;
|
|
1567
|
-
};
|
|
114
|
+
var semanticNodes = semanticTagNames.reduce(ɵ1, {});
|
|
115
|
+
|
|
1568
116
|
/**
|
|
1569
117
|
* @hidden
|
|
1570
118
|
*/
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
var mergeCells$1 = function (state, dispatch) {
|
|
1574
|
-
var sel = state.selection;
|
|
1575
|
-
if (!(sel instanceof CellSelection) || sel.$anchorCell.pos === sel.$headCell.pos) {
|
|
1576
|
-
return false;
|
|
1577
|
-
}
|
|
1578
|
-
var rect = selectedRect(state.selection);
|
|
1579
|
-
var map$$1 = rect.map;
|
|
1580
|
-
if (cellsOverlapRectangle(map$$1, rect)) {
|
|
1581
|
-
return false;
|
|
1582
|
-
}
|
|
1583
|
-
if (dispatch) {
|
|
1584
|
-
var tr = state.tr;
|
|
1585
|
-
var seen = {};
|
|
1586
|
-
var content = Fragment.empty;
|
|
1587
|
-
var mergedPos = void 0;
|
|
1588
|
-
var mergedCell = void 0;
|
|
1589
|
-
for (var row = rect.top; row < rect.bottom; row++) {
|
|
1590
|
-
for (var col = rect.left; col < rect.right; col++) {
|
|
1591
|
-
var cellPos = map$$1.map[row * map$$1.width + col], cell = rect.table.nodeAt(cellPos);
|
|
1592
|
-
if (seen[cellPos]) {
|
|
1593
|
-
continue;
|
|
1594
|
-
}
|
|
1595
|
-
seen[cellPos] = true;
|
|
1596
|
-
if (mergedPos === null) {
|
|
1597
|
-
mergedPos = cellPos;
|
|
1598
|
-
mergedCell = cell;
|
|
1599
|
-
}
|
|
1600
|
-
else {
|
|
1601
|
-
if (!isCellEmpty(cell)) {
|
|
1602
|
-
content = content.append(cell.content);
|
|
1603
|
-
}
|
|
1604
|
-
var mapped = tr.mapping.map(cellPos + rect.tableStart);
|
|
1605
|
-
tr.delete(mapped, mapped + cell.nodeSize);
|
|
1606
|
-
}
|
|
1607
|
-
}
|
|
1608
|
-
}
|
|
1609
|
-
tr.setNodeMarkup(mergedPos + rect.tableStart, null, setAttr(addColSpan(mergedCell.attrs, mergedCell.attrs.colspan, rect.right - rect.left - mergedCell.attrs.colspan), 'rowspan', rect.bottom - rect.top));
|
|
1610
|
-
if (content.size) {
|
|
1611
|
-
var end = mergedPos + 1 + mergedCell.content.size;
|
|
1612
|
-
var start = isCellEmpty(mergedCell) ? mergedPos + 1 : end;
|
|
1613
|
-
tr.replaceWith(start + rect.tableStart, end + rect.tableStart, content);
|
|
1614
|
-
}
|
|
1615
|
-
tr.setSelection(new CellSelection(tr.doc.resolve(mergedPos + rect.tableStart)));
|
|
1616
|
-
dispatch(tr);
|
|
1617
|
-
}
|
|
1618
|
-
return true;
|
|
1619
|
-
};
|
|
119
|
+
var marks$1 = marks;
|
|
120
|
+
var nodes$1 = Object.assign(nodes, semanticNodes);
|
|
1620
121
|
/**
|
|
1621
122
|
* @hidden
|
|
1622
123
|
*/
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
var node = _a.node;
|
|
1629
|
-
return nodeTypes[node.type.spec.tableRole];
|
|
1630
|
-
})(state, dispatch);
|
|
1631
|
-
};
|
|
1632
|
-
var deleteTableElement = function (selector) { return function (state, dispatch) {
|
|
1633
|
-
var $pos = state.selection.$anchor;
|
|
1634
|
-
for (var d = $pos.depth; d > 0; d--) {
|
|
1635
|
-
var node = $pos.node(d);
|
|
1636
|
-
if (selector(node)) {
|
|
1637
|
-
if (dispatch) {
|
|
1638
|
-
var tr = state.tr;
|
|
1639
|
-
tr.delete($pos.before(d), $pos.after(d)).scrollIntoView();
|
|
1640
|
-
dispatch(tr);
|
|
1641
|
-
}
|
|
1642
|
-
return true;
|
|
1643
|
-
}
|
|
1644
|
-
}
|
|
1645
|
-
return false;
|
|
1646
|
-
}; };
|
|
124
|
+
var schema = new Schema({
|
|
125
|
+
marks: marks$1,
|
|
126
|
+
nodes: nodes$1
|
|
127
|
+
});
|
|
128
|
+
|
|
1647
129
|
/**
|
|
1648
130
|
* @hidden
|
|
1649
131
|
*/
|
|
1650
|
-
|
|
1651
|
-
var
|
|
132
|
+
var insertTable = function (attrs) { return function (state, dispatch) {
|
|
133
|
+
var newTable = createTable(state.schema.nodes, attrs.rows, attrs.cols);
|
|
134
|
+
if (newTable) {
|
|
135
|
+
insertNode(newTable, true)(state, dispatch);
|
|
136
|
+
}
|
|
137
|
+
}; };
|
|
1652
138
|
|
|
1653
139
|
var alignRemove = function (state, dispatch) { return alignBlocks(alignRemoveRules)(state, dispatch); };
|
|
1654
|
-
var ɵ1$
|
|
140
|
+
var ɵ1$1 = function (applyToWord) { return expandToWordWrap(toggleInlineFormat, __assign({}, bold, { applyToWord: applyToWord })); }, ɵ2 = function (options) { return cleanFormatting(options); }, ɵ3 = function (attrs) { return expandToWordWrap(applyLink, { mark: 'link', attrs: attrs.value, applyToWord: attrs.applyToWord }); }, ɵ4 = function (attrs) { return expandToWordWrap(applyInlineStyle, { style: 'font-family', value: attrs.value, applyToWord: attrs.applyToWord }); }, ɵ5 = function (attrs) { return expandToWordWrap(applyInlineStyle, { style: 'font-size', value: attrs.value + 'px', applyToWord: attrs.applyToWord }); }, ɵ6 = function (attrs) { return expandToWordWrap(applyLink, { mark: 'link', attrs: attrs, applyToWord: attrs.applyToWord }); }, ɵ7 = function (text) { return insertText(text); }, ɵ8 = function (applyToWord) { return expandToWordWrap(toggleInlineFormat, __assign({}, italic, { applyToWord: applyToWord })); }, ɵ9 = function (applyToWord) { return expandToWordWrap(toggleInlineFormat, __assign({}, strikethrough, { applyToWord: applyToWord })); }, ɵ10 = function (applyToWord) { return expandToWordWrap(toggleInlineFormat, __assign({}, subscript, { applyToWord: applyToWord })); }, ɵ11 = function (applyToWord) { return expandToWordWrap(toggleInlineFormat, __assign({}, superscript, { applyToWord: applyToWord })); }, ɵ12 = function (applyToWord) { return expandToWordWrap(toggleInlineFormat, __assign({}, underline, { applyToWord: applyToWord })); }, ɵ13 = function () { return removeLink(link); }, ɵ14 = function (attrs) { return expandToWordWrap(applyInlineStyle, { style: 'color', value: attrs.value, applyToWord: attrs.applyToWord }); }, ɵ15 = function (attrs) { return expandToWordWrap(applyInlineStyle, { style: 'background-color', value: attrs.value, applyToWord: attrs.applyToWord }); }, ɵ16 = function () { return function (state, dispatch) { return selectAll(state, dispatch); }; };
|
|
1655
141
|
var inlineCommand = {
|
|
1656
|
-
bold: ɵ1$
|
|
1657
|
-
cleanFormatting: ɵ2
|
|
1658
|
-
createLink: ɵ3
|
|
1659
|
-
fontFamily: ɵ4
|
|
1660
|
-
fontSize: ɵ5
|
|
1661
|
-
insertFile: ɵ6
|
|
1662
|
-
insertText: ɵ7
|
|
1663
|
-
italic: ɵ8
|
|
1664
|
-
strikethrough: ɵ9
|
|
142
|
+
bold: ɵ1$1,
|
|
143
|
+
cleanFormatting: ɵ2,
|
|
144
|
+
createLink: ɵ3,
|
|
145
|
+
fontFamily: ɵ4,
|
|
146
|
+
fontSize: ɵ5,
|
|
147
|
+
insertFile: ɵ6,
|
|
148
|
+
insertText: ɵ7,
|
|
149
|
+
italic: ɵ8,
|
|
150
|
+
strikethrough: ɵ9,
|
|
1665
151
|
subscript: ɵ10,
|
|
1666
152
|
superscript: ɵ11,
|
|
1667
153
|
underline: ɵ12,
|
|
@@ -1673,7 +159,7 @@ var inlineCommand = {
|
|
|
1673
159
|
var ɵ17 = function () { return function (state, dispatch) { return isAligned(state, alignCenterRules) ? alignRemove(state, dispatch) : alignBlocks(alignCenterRules)(state, dispatch); }; }, ɵ18 = function () { return function (state, dispatch) { return isAligned(state, alignJustifyRules) ? alignRemove(state, dispatch) : alignBlocks(alignJustifyRules)(state, dispatch); }; }, ɵ19 = function () { return function (state, dispatch) { return isAligned(state, alignLeftRules) ? alignRemove(state, dispatch) : alignBlocks(alignLeftRules)(state, dispatch); }; }, ɵ20 = function () { return function (state, dispatch) { return isAligned(state, alignRightRules) ? alignRemove(state, dispatch) : alignBlocks(alignRightRules)(state, dispatch); }; }, ɵ21 = function (formatAttr) { return formatBlockElements(formatAttr.tag); }, ɵ22 = function () { return getHtml; }, ɵ23 = function () { return indent; }, ɵ24 = function (attrs) { return insertImage(attrs); }, ɵ25 = function () { return toggleOrderedList; }, ɵ26 = function () { return toggleUnorderedList; }, ɵ27 = function () { return outdent; }, ɵ28 = function () { return redo; }, ɵ29 = function (_a) {
|
|
1674
160
|
var content = _a.content, parseOptions = _a.parseOptions;
|
|
1675
161
|
return setHtml(content, 'setHTML', parseOptions);
|
|
1676
|
-
}, ɵ30 = function () { return undo; };
|
|
162
|
+
}, ɵ30 = function () { return undo; }, ɵ31 = function () { return blockquote; };
|
|
1677
163
|
var blockCommand = {
|
|
1678
164
|
alignCenter: ɵ17,
|
|
1679
165
|
alignJustify: ɵ18,
|
|
@@ -1690,20 +176,21 @@ var blockCommand = {
|
|
|
1690
176
|
outdent: ɵ27,
|
|
1691
177
|
redo: ɵ28,
|
|
1692
178
|
setHTML: ɵ29,
|
|
1693
|
-
undo: ɵ30
|
|
179
|
+
undo: ɵ30,
|
|
180
|
+
blockquote: ɵ31
|
|
1694
181
|
};
|
|
1695
|
-
var ɵ
|
|
182
|
+
var ɵ32 = function (attr) { return insertTable(attr); }, ɵ33 = function () { return addColumnBefore; }, ɵ34 = function () { return addColumnAfter; }, ɵ35 = function () { return addRowBefore; }, ɵ36 = function () { return addRowAfter; }, ɵ37 = function () { return deleteRow; }, ɵ38 = function () { return deleteColumn; }, ɵ39 = function () { return mergeCells; }, ɵ40 = function () { return splitCell; }, ɵ41 = function () { return deleteTable; };
|
|
1696
183
|
var tableCommand = {
|
|
1697
|
-
insertTable: ɵ
|
|
1698
|
-
addColumnBefore: ɵ
|
|
1699
|
-
addColumnAfter: ɵ
|
|
1700
|
-
addRowBefore: ɵ
|
|
1701
|
-
addRowAfter: ɵ
|
|
1702
|
-
deleteRow: ɵ
|
|
1703
|
-
deleteColumn: ɵ
|
|
1704
|
-
mergeCells: ɵ
|
|
1705
|
-
splitCell: ɵ
|
|
1706
|
-
deleteTable: ɵ
|
|
184
|
+
insertTable: ɵ32,
|
|
185
|
+
addColumnBefore: ɵ33,
|
|
186
|
+
addColumnAfter: ɵ34,
|
|
187
|
+
addRowBefore: ɵ35,
|
|
188
|
+
addRowAfter: ɵ36,
|
|
189
|
+
deleteRow: ɵ37,
|
|
190
|
+
deleteColumn: ɵ38,
|
|
191
|
+
mergeCells: ɵ39,
|
|
192
|
+
splitCell: ɵ40,
|
|
193
|
+
deleteTable: ɵ41
|
|
1707
194
|
};
|
|
1708
195
|
/**
|
|
1709
196
|
* @hidden
|
|
@@ -1742,6 +229,10 @@ var getToolbarState = function (state, options) { return ({
|
|
|
1742
229
|
selected: activeNode(state),
|
|
1743
230
|
disabled: false
|
|
1744
231
|
},
|
|
232
|
+
blockquote: {
|
|
233
|
+
selected: false,
|
|
234
|
+
disabled: !blockquote(state)
|
|
235
|
+
},
|
|
1745
236
|
indent: {
|
|
1746
237
|
selected: false,
|
|
1747
238
|
disabled: !(canIndentAsListItem(state, state.schema.nodes.list_item) || canBeIndented(state, indentRules))
|
|
@@ -1764,7 +255,11 @@ var getToolbarState = function (state, options) { return ({
|
|
|
1764
255
|
},
|
|
1765
256
|
outdent: {
|
|
1766
257
|
selected: false,
|
|
1767
|
-
disabled
|
|
258
|
+
get disabled() {
|
|
259
|
+
return !(hasNode(state, state.schema.nodes.blockquote) ||
|
|
260
|
+
canOutdentAsListItem(state, outdentRules) ||
|
|
261
|
+
isIndented(state, outdentRules.nodes));
|
|
262
|
+
}
|
|
1768
263
|
},
|
|
1769
264
|
redo: {
|
|
1770
265
|
selected: false,
|
|
@@ -1890,6 +385,7 @@ var initialToolBarState = {
|
|
|
1890
385
|
format: { selected: { text: 'Format', tag: null }, disabled: false },
|
|
1891
386
|
style: { selected: { marks: [], hasNodesWithoutMarks: false }, disabled: false },
|
|
1892
387
|
cleanFormatting: { selected: false, disabled: true },
|
|
388
|
+
blockquote: { selected: false, disabled: false },
|
|
1893
389
|
//indent
|
|
1894
390
|
indent: { selected: false, disabled: false },
|
|
1895
391
|
outdent: { selected: false, disabled: false },
|
|
@@ -1942,6 +438,7 @@ var disabledToolBarState = {
|
|
|
1942
438
|
format: { selected: { text: 'Format', tag: null }, disabled: true },
|
|
1943
439
|
style: { selected: { marks: [], hasNodesWithoutMarks: false }, disabled: true },
|
|
1944
440
|
cleanFormatting: { selected: false, disabled: true },
|
|
441
|
+
blockquote: { selected: false, disabled: true },
|
|
1945
442
|
//indent
|
|
1946
443
|
indent: { selected: false, disabled: true },
|
|
1947
444
|
outdent: { selected: false, disabled: true },
|
|
@@ -1975,6 +472,117 @@ var disabledToolBarState = {
|
|
|
1975
472
|
selectAll: { selected: false, disabled: true }
|
|
1976
473
|
};
|
|
1977
474
|
|
|
475
|
+
/**
|
|
476
|
+
* @hidden
|
|
477
|
+
*/
|
|
478
|
+
function outerWidth(element) {
|
|
479
|
+
var width = element.offsetWidth;
|
|
480
|
+
var style = getComputedStyle(element);
|
|
481
|
+
width += parseFloat(style.marginLeft) || 0 + parseFloat(style.marginRight) || 0;
|
|
482
|
+
return width;
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* @hidden
|
|
486
|
+
*/
|
|
487
|
+
var removeEntries = function (obj, predicate) {
|
|
488
|
+
return Object.keys(obj)
|
|
489
|
+
.filter(function (key) { return predicate(key); })
|
|
490
|
+
.reduce(function (acc, curr) {
|
|
491
|
+
var _a;
|
|
492
|
+
return Object.assign(acc, (_a = {}, _a[curr] = obj[curr], _a));
|
|
493
|
+
}, {});
|
|
494
|
+
};
|
|
495
|
+
/**
|
|
496
|
+
* @hidden
|
|
497
|
+
*/
|
|
498
|
+
var removeEmptyEntries = function (obj) {
|
|
499
|
+
var predicate = function (key) { return obj[key] !== null && obj[key] !== undefined && obj[key] !== ''; };
|
|
500
|
+
return removeEntries(obj, predicate);
|
|
501
|
+
};
|
|
502
|
+
/**
|
|
503
|
+
* @hidden
|
|
504
|
+
*/
|
|
505
|
+
var isNullOrUndefined = function (value) { return value === undefined || value === null; };
|
|
506
|
+
/**
|
|
507
|
+
* @hidden
|
|
508
|
+
*/
|
|
509
|
+
var isPresent = function (value) { return !isNullOrUndefined(value); };
|
|
510
|
+
/**
|
|
511
|
+
* @hidden
|
|
512
|
+
*/
|
|
513
|
+
var detectIE = function () {
|
|
514
|
+
if (!isDocumentAvailable()) {
|
|
515
|
+
return false;
|
|
516
|
+
}
|
|
517
|
+
var ua = window.navigator.userAgent;
|
|
518
|
+
var msie = ua.indexOf('MSIE ');
|
|
519
|
+
var trident = ua.indexOf('Trident/');
|
|
520
|
+
return msie > 0 || trident > 0;
|
|
521
|
+
};
|
|
522
|
+
/**
|
|
523
|
+
* @hidden
|
|
524
|
+
*/
|
|
525
|
+
var safeString = function (value) { return (isNullOrUndefined(value) ? '' : value.toString()); };
|
|
526
|
+
/**
|
|
527
|
+
* @hidden
|
|
528
|
+
*/
|
|
529
|
+
var first = function (arr) { return arr[0]; };
|
|
530
|
+
/**
|
|
531
|
+
* @hidden
|
|
532
|
+
*/
|
|
533
|
+
var last = function (arr) { return arr[arr.length - 1]; };
|
|
534
|
+
/**
|
|
535
|
+
* @hidden
|
|
536
|
+
*/
|
|
537
|
+
var split = function (splitter) { return function (value) { return value.split(splitter); }; };
|
|
538
|
+
/**
|
|
539
|
+
* @hidden
|
|
540
|
+
*/
|
|
541
|
+
var trim = function (value) { return value.trim(); };
|
|
542
|
+
/**
|
|
543
|
+
* @hidden
|
|
544
|
+
*/
|
|
545
|
+
var filter$1 = function (predicate) { return function (arr) { return arr.filter(predicate); }; };
|
|
546
|
+
/**
|
|
547
|
+
* @hidden
|
|
548
|
+
*/
|
|
549
|
+
var getUniqueStyleValues = function (style, cssStyle) {
|
|
550
|
+
if (style.hasNodesWithoutMarks) {
|
|
551
|
+
return '';
|
|
552
|
+
}
|
|
553
|
+
var uniqueMarkValues = style.marks
|
|
554
|
+
.filter(function (m) { return m.type.name === 'style'; })
|
|
555
|
+
.map(function (m) { return m.attrs.style; })
|
|
556
|
+
.map(safeString)
|
|
557
|
+
.map(split(';'))
|
|
558
|
+
.map(filter$1(function (m) { return m.includes(cssStyle); }))
|
|
559
|
+
// guards against empty array
|
|
560
|
+
.map(function (cssStyleValues) { return (cssStyleValues.length !== 0 ? cssStyleValues : [cssStyle + ": INVALID"]); })
|
|
561
|
+
.map(first)
|
|
562
|
+
.map(split(':'))
|
|
563
|
+
.map(last)
|
|
564
|
+
.map(trim)
|
|
565
|
+
.reduce(function (acc, curr) { return (acc.indexOf(curr) > -1 ? acc : acc.concat([curr])); }, []);
|
|
566
|
+
if (uniqueMarkValues.indexOf('INVALID') > -1 || uniqueMarkValues.length !== 1) {
|
|
567
|
+
return '';
|
|
568
|
+
}
|
|
569
|
+
return uniqueMarkValues[0];
|
|
570
|
+
};
|
|
571
|
+
/**
|
|
572
|
+
* @hidden
|
|
573
|
+
*/
|
|
574
|
+
var conditionallyExecute = function (fn) { return function (condition) { return function (param) { return (condition ? fn(param) : param); }; }; };
|
|
575
|
+
/**
|
|
576
|
+
* @hidden
|
|
577
|
+
*/
|
|
578
|
+
var pipe = function () {
|
|
579
|
+
var fns = [];
|
|
580
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
581
|
+
fns[_i] = arguments[_i];
|
|
582
|
+
}
|
|
583
|
+
return function (x) { return fns.reduce(function (y, f) { return f(y); }, x); };
|
|
584
|
+
};
|
|
585
|
+
|
|
1978
586
|
/**
|
|
1979
587
|
* @hidden
|
|
1980
588
|
*/
|
|
@@ -2137,7 +745,7 @@ var ImageDialogComponent = /** @class */ (function (_super) {
|
|
|
2137
745
|
], ImageDialogComponent.prototype, "srcInput", void 0);
|
|
2138
746
|
ImageDialogComponent = __decorate([
|
|
2139
747
|
Component({
|
|
2140
|
-
template: "\n <kendo-dialog-titlebar (close)=\"onCancelAction()\">\n {{ textFor('insertImage') }}\n </kendo-dialog-titlebar>\n <div class=\"k-editor-dialog\">\n <div class=\"k-editor-dialog k-popup-edit-form k-window-content k-content\">\n <div class=\"k-edit-form-container k-window-content\">\n <div class=\"k-edit-label\">\n <label [for]=\"srcInputId\">{{ textFor('imageWebAddress') }}</label>\n </div>\n <div class=\"k-edit-field\">\n <input [id]=\"srcInputId\" #srcInput [formControl]=\"src\" type=\"text\" class=\"k-textbox\" />\n </div>\n <div class=\"k-edit-label\">\n <label [for]=\"altTextInputId\">{{ textFor('imageAltText') }}</label>\n </div>\n <div class=\"k-edit-field\">\n <input [id]=\"altTextInputId\" [formControl]=\"alt\" type=\"text\" class=\"k-textbox\" />\n </div>\n <div class=\"k-edit-label\">\n <label [for]=\"widthInputId\">{{ textFor('imageWidth') }}</label>\n </div>\n <div class=\"k-edit-field\">\n <input [id]=\"widthInputId\" [formControl]=\"width\" type=\"text\" class=\"k-textbox\" />\n </div>\n <div class=\"k-edit-label\">\n <label [for]=\"heightInputId\">{{ textFor('imageHeight') }}</label>\n </div>\n <div class=\"k-edit-field\">\n <input [id]=\"heightInputId\" [formControl]=\"height\" type=\"text\" class=\"k-textbox\" />\n </div>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)=\"onCancelAction()\">{{ textFor('dialogCancel') }}</button>\n <button kendoButton [disabled]=\"imageData.invalid\"\n (click)=\"onConfirmAction()\" [primary]=\"true\">{{ textFor('dialogInsert') }}</button>\n </kendo-dialog-actions>\n "
|
|
748
|
+
template: "\n <kendo-dialog-titlebar (close)=\"onCancelAction()\">\n {{ textFor('insertImage') }}\n </kendo-dialog-titlebar>\n <div class=\"k-editor-dialog\">\n <div class=\"k-editor-dialog k-popup-edit-form k-window-content k-content\">\n <div class=\"k-edit-form-container k-window-content\">\n <div class=\"k-edit-label\">\n <label [for]=\"srcInputId\">{{ textFor('imageWebAddress') }}</label>\n </div>\n <div class=\"k-edit-field\">\n <input [id]=\"srcInputId\" #srcInput [formControl]=\"src\" type=\"text\" class=\"k-textbox k-input k-rounded-md\" />\n </div>\n <div class=\"k-edit-label\">\n <label [for]=\"altTextInputId\">{{ textFor('imageAltText') }}</label>\n </div>\n <div class=\"k-edit-field\">\n <input [id]=\"altTextInputId\" [formControl]=\"alt\" type=\"text\" class=\"k-textbox k-input k-rounded-md\" />\n </div>\n <div class=\"k-edit-label\">\n <label [for]=\"widthInputId\">{{ textFor('imageWidth') }}</label>\n </div>\n <div class=\"k-edit-field\">\n <input [id]=\"widthInputId\" [formControl]=\"width\" type=\"text\" class=\"k-textbox k-input k-rounded-md\" />\n </div>\n <div class=\"k-edit-label\">\n <label [for]=\"heightInputId\">{{ textFor('imageHeight') }}</label>\n </div>\n <div class=\"k-edit-field\">\n <input [id]=\"heightInputId\" [formControl]=\"height\" type=\"text\" class=\"k-textbox k-input k-rounded-md\" />\n </div>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)=\"onCancelAction()\">{{ textFor('dialogCancel') }}</button>\n <button kendoButton [disabled]=\"imageData.invalid\"\n (click)=\"onConfirmAction()\" [primary]=\"true\">{{ textFor('dialogInsert') }}</button>\n </kendo-dialog-actions>\n "
|
|
2141
749
|
}),
|
|
2142
750
|
__metadata("design:paramtypes", [DialogRef,
|
|
2143
751
|
EditorLocalizationService])
|
|
@@ -2253,7 +861,7 @@ var FileLinkDialogComponent = /** @class */ (function (_super) {
|
|
|
2253
861
|
], FileLinkDialogComponent.prototype, "hrefInput", void 0);
|
|
2254
862
|
FileLinkDialogComponent = __decorate([
|
|
2255
863
|
Component({
|
|
2256
|
-
template: "\n <kendo-dialog-titlebar (close)=\"onCancelAction()\">\n {{ titleText }}\n </kendo-dialog-titlebar>\n <div class=\"k-editor-dialog\">\n <div class=\"k-editor-dialog k-popup-edit-form k-window-content k-content\">\n <div class=\"k-edit-form-container k-window-content\">\n <form novalidate [formGroup]=\"linkForm\">\n <div class=\"k-edit-label\">\n <label (click)=\"hrefInput.focus()\">{{ textForWithPrefix('WebAddress') }}</label>\n </div>\n <div class=\"k-edit-field\">\n <input #hrefInput formControlName=\"href\" type=\"text\" class=\"k-textbox\" />\n </div>\n\n <div class=\"k-edit-label\">\n <label (click)=\"textInput.focus()\">{{ textForWithPrefix('Text') }}</label>\n </div>\n <div class=\"k-edit-field\">\n <input #textInput formControlName=\"text\" type=\"text\" class=\"k-textbox\" />\n </div>\n\n <div class=\"k-edit-label\">\n <label (click)=\"titleInput.focus()\">{{ textForWithPrefix('Title') }}</label>\n </div>\n <div class=\"k-edit-field\">\n <input #titleInput formControlName=\"title\" type=\"text\" class=\"k-textbox\" />\n </div>\n <ng-container *ngIf=\"command === 'createLink'\">\n <div class=\"k-edit-label\"></div>\n <div class=\"k-edit-field\">\n <input type=\"checkbox\" id=\"k-target-blank\"
|
|
864
|
+
template: "\n <kendo-dialog-titlebar (close)=\"onCancelAction()\">\n {{ titleText }}\n </kendo-dialog-titlebar>\n <div class=\"k-editor-dialog\">\n <div class=\"k-editor-dialog k-popup-edit-form k-window-content k-content\">\n <div class=\"k-edit-form-container k-window-content\">\n <form novalidate [formGroup]=\"linkForm\">\n <div class=\"k-edit-label\">\n <label (click)=\"hrefInput.focus()\">{{ textForWithPrefix('WebAddress') }}</label>\n </div>\n <div class=\"k-edit-field\">\n <input #hrefInput formControlName=\"href\" type=\"text\" class=\"k-textbox k-input k-rounded-md\" />\n </div>\n\n <div class=\"k-edit-label\">\n <label (click)=\"textInput.focus()\">{{ textForWithPrefix('Text') }}</label>\n </div>\n <div class=\"k-edit-field\">\n <input #textInput formControlName=\"text\" type=\"text\" class=\"k-textbox k-input k-rounded-md\" />\n </div>\n\n <div class=\"k-edit-label\">\n <label (click)=\"titleInput.focus()\">{{ textForWithPrefix('Title') }}</label>\n </div>\n <div class=\"k-edit-field\">\n <input #titleInput formControlName=\"title\" type=\"text\" class=\"k-textbox k-input k-rounded-md\" />\n </div>\n <ng-container *ngIf=\"command === 'createLink'\">\n <div class=\"k-edit-label\"></div>\n <div class=\"k-edit-field\">\n <input type=\"checkbox\" id=\"k-target-blank\" kendoCheckBox formControlName=\"target\" />\n <label class=\"k-checkbox-label\" for=\"k-target-blank\">{{ textForWithPrefix('OpenInNewWindow') }}</label>\n </div>\n </ng-container>\n </form>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)=\"onCancelAction()\">{{ textFor('dialogCancel') }}</button>\n <button kendoButton [disabled]=\"linkForm.invalid\" (click)=\"onConfirmAction()\" [primary]=\"true\">\n {{ textFor('dialogInsert') }}\n </button>\n </kendo-dialog-actions>\n "
|
|
2257
865
|
}),
|
|
2258
866
|
__metadata("design:paramtypes", [DialogRef, EditorLocalizationService])
|
|
2259
867
|
], FileLinkDialogComponent);
|
|
@@ -2273,7 +881,7 @@ var tablesStyles = "\n .ProseMirror .tableWrapper {\n overflow-x: auto;\n
|
|
|
2273
881
|
*/
|
|
2274
882
|
var rtlStyles = 'body { direction: rtl }';
|
|
2275
883
|
|
|
2276
|
-
var ɵ0$
|
|
884
|
+
var ɵ0$2 = function (arg) { return "plugins must be a function, but received " + JSON.stringify(arg) + "."; }, ɵ1$2 = function (arg) { return "pastedContent must be a function, but received " + JSON.stringify(arg) + "."; };
|
|
2277
885
|
/* tslint:disable:variable-name */
|
|
2278
886
|
/**
|
|
2279
887
|
* @hidden
|
|
@@ -2281,10 +889,10 @@ var ɵ0$6 = function (arg) { return "plugins must be a function, but received "
|
|
|
2281
889
|
var EditorErrorMessages = {
|
|
2282
890
|
schemaType: 'Expected value of type Schema. See http://www.telerik.com/kendo-angular-ui/components/editor/schema/',
|
|
2283
891
|
setSchemaOnce: 'The Schema cannot be changed dynamically. See http://www.telerik.com/kendo-angular-ui/components/editor/schema/',
|
|
2284
|
-
pluginsCallbackType: ɵ0$
|
|
2285
|
-
pastedContentCallbackType: ɵ1$
|
|
892
|
+
pluginsCallbackType: ɵ0$2,
|
|
893
|
+
pastedContentCallbackType: ɵ1$2,
|
|
2286
894
|
setPluginsOnce: 'The plugins cannot be changed dynamically. See http://www.telerik.com/kendo-angular-ui/components/editor/plugins/',
|
|
2287
|
-
setPlaceHolderOnce: 'The placeholder cannot be changed dynamically. See
|
|
895
|
+
setPlaceHolderOnce: 'The placeholder cannot be changed dynamically. See https://www.telerik.com/kendo-angular-ui/components/editor/plugins/#toc-custom-plugins/',
|
|
2288
896
|
printTool: 'The Print tool and functionality are supported only in iframe mode. See https://www.telerik.com/kendo-angular-ui-develop/components/editor/api/EditorPrintButtonDirective/'
|
|
2289
897
|
};
|
|
2290
898
|
|
|
@@ -2418,6 +1026,9 @@ var EditorComponent = /** @class */ (function () {
|
|
|
2418
1026
|
this.contentAreaLoaded = new Subject();
|
|
2419
1027
|
this.dispatchTransaction = function (tr) {
|
|
2420
1028
|
var docChanged = tr.docChanged;
|
|
1029
|
+
if (_this.disabled || (_this.readonly && docChanged)) {
|
|
1030
|
+
return;
|
|
1031
|
+
}
|
|
2421
1032
|
if (docChanged) {
|
|
2422
1033
|
var doc = tr.doc;
|
|
2423
1034
|
var html_1 = getHtml({ doc: doc });
|
|
@@ -2794,7 +1405,7 @@ var EditorComponent = /** @class */ (function () {
|
|
|
2794
1405
|
* @param {any} attr - Optional parameters for the command. Apart from the following list,
|
|
2795
1406
|
* the parameters do not expect specific attributes when you call them:
|
|
2796
1407
|
* - `format` - Accepts an object with the `tag` property.
|
|
2797
|
-
* The supported tags are `p
|
|
1408
|
+
* The supported tags are `p` and any of the `h1` to `h6` heading tags.
|
|
2798
1409
|
* - `createLink` - Accepts an object with the `href`, `title`, and `target` properties. The `href` property is mandatory.
|
|
2799
1410
|
* - `setHTML` - Accepts a `string` parameter.
|
|
2800
1411
|
* - `insertTable` - Accepts an object with the `rows` and `cols` properties. The number values are zero based.
|
|
@@ -3006,16 +1617,13 @@ var EditorComponent = /** @class */ (function () {
|
|
|
3006
1617
|
}
|
|
3007
1618
|
}); }
|
|
3008
1619
|
}),
|
|
3009
|
-
new Plugin({
|
|
3010
|
-
key: new PluginKey('editor-filter-disabled-state'),
|
|
3011
|
-
filterTransaction: function () { return !_this.disabled || _this.inForm; }
|
|
3012
|
-
}),
|
|
3013
1620
|
history(),
|
|
3014
1621
|
keymap(buildListKeymap(currentSchema)),
|
|
3015
1622
|
keymap(buildKeymap(currentSchema, { applyToWord: this.applyToWord })),
|
|
3016
1623
|
keymap(baseKeymap),
|
|
3017
1624
|
gapCursor(),
|
|
3018
|
-
imageResizing()
|
|
1625
|
+
imageResizing(),
|
|
1626
|
+
tableEditing()
|
|
3019
1627
|
];
|
|
3020
1628
|
if (this.placeholder) {
|
|
3021
1629
|
defaultPlugins.push(placeholder(this.placeholder));
|
|
@@ -3054,7 +1662,7 @@ var EditorComponent = /** @class */ (function () {
|
|
|
3054
1662
|
this.subs.add(fromEvent(containerElement, 'focusin')
|
|
3055
1663
|
.subscribe(function () {
|
|
3056
1664
|
if (_this.readonly) {
|
|
3057
|
-
contentAreaClasslist_1.add('k-
|
|
1665
|
+
contentAreaClasslist_1.add('k-focus');
|
|
3058
1666
|
}
|
|
3059
1667
|
if (!_this.focusChangedProgrammatically || _this.shouldEmitFocus) {
|
|
3060
1668
|
_this.ngZone.run(function () { return _this.onFocus.emit(); });
|
|
@@ -3064,7 +1672,7 @@ var EditorComponent = /** @class */ (function () {
|
|
|
3064
1672
|
this.subs.add(fromEvent(containerElement, 'focusout')
|
|
3065
1673
|
.subscribe(function () {
|
|
3066
1674
|
if (_this.readonly) {
|
|
3067
|
-
contentAreaClasslist_1.remove('k-
|
|
1675
|
+
contentAreaClasslist_1.remove('k-focus');
|
|
3068
1676
|
}
|
|
3069
1677
|
if (!_this.focusChangedProgrammatically) {
|
|
3070
1678
|
_this.ngZone.run(function () { return _this.onBlur.emit(); });
|
|
@@ -3211,7 +1819,7 @@ var EditorComponent = /** @class */ (function () {
|
|
|
3211
1819
|
__metadata("design:paramtypes", [])
|
|
3212
1820
|
], EditorComponent.prototype, "resizableClass", null);
|
|
3213
1821
|
__decorate([
|
|
3214
|
-
HostBinding('class.k-
|
|
1822
|
+
HostBinding('class.k-disabled'),
|
|
3215
1823
|
__metadata("design:type", Boolean),
|
|
3216
1824
|
__metadata("design:paramtypes", [])
|
|
3217
1825
|
], EditorComponent.prototype, "isDisabled", null);
|
|
@@ -3304,7 +1912,7 @@ var EditorComponent = /** @class */ (function () {
|
|
|
3304
1912
|
}
|
|
3305
1913
|
],
|
|
3306
1914
|
/* tslint:disable:max-line-length */
|
|
3307
|
-
template: "\n <ng-container\n kendoEditorLocalizedMessages\n i18n-alignCenter=\"kendo.editor.alignCenter|The title of the tool that aligns text in the center.\"\n alignCenter=\"Center text\"\n i18n-alignJustify=\"kendo.editor.alignJustify|The title of the tool that justifies text both left and right.\"\n alignJustify=\"Justify\"\n i18n-alignLeft=\"kendo.editor.alignLeft|The title of the tool that aligns text on the left.\"\n alignLeft=\"Align text left\"\n i18n-alignRight=\"kendo.editor.alignRight|The title of the tool that aligns text on the right.\"\n alignRight=\"Align text right\"\n i18n-backColor=\"kendo.editor.backColor|The title of the tool that changes the text background color.\"\n backColor=\"Background color\"\n i18n-bold=\"kendo.editor.bold|The title of the tool that makes text bold.\"\n bold=\"Bold\"\n i18n-cleanFormatting=\"kendo.editor.cleanFormatting|The title of the Clean Formatting tool.\"\n cleanFormatting=\"Clean formatting\"\n i18n-createLink=\"kendo.editor.createLink|The title of the tool that creates hyperlinks.\"\n createLink=\"Insert link\"\n i18n-dialogApply=\"kendo.editor.dialogApply|The label of the **Apply** button in all editor dialogs.\"\n dialogApply=\"Apply\"\n i18n-dialogCancel=\"kendo.editor.dialogCancel|The label of the **Cancel** button in all editor dialogs.\"\n dialogCancel=\"Cancel\"\n i18n-dialogInsert=\"kendo.editor.dialogInsert|The label of the **Insert** button in all editor dialogs.\"\n dialogInsert=\"Insert\"\n i18n-dialogUpdate=\"kendo.editor.dialogUpdate|The label of the **Update** button in all editor dialogs.\"\n dialogUpdate=\"Update\"\n i18n-fileText=\"kendo.editor.fileText|The caption for the file text in the insertFile dialog.\"\n fileText=\"Text\"\n i18n-fileTitle=\"kendo.editor.fileTitle|The caption for the file Title in the insertFile dialog.\"\n fileTitle=\"Title\"\n i18n-fileWebAddress=\"kendo.editor.fileWebAddress|The caption for the file URL in the insertFile dialog.\"\n fileWebAddress=\"Web address\"\n i18n-fontFamily=\"kendo.editor.fontFamily|The title of the tool that changes the text font.\"\n fontFamily=\"Select font family\"\n i18n-fontSize=\"kendo.editor.fontSize|The title of the tool that changes the text size.\"\n fontSize=\"Select font size\"\n i18n-foreColor=\"kendo.editor.foreColor|The title of the tool that changes the text color.\"\n foreColor=\"Color\"\n i18n-format=\"kendo.editor.format|The title of the tool that lets users choose block formats.\"\n format=\"Format\"\n i18n-imageAltText=\"kendo.editor.imageAltText|The caption for the image alternate text in the insertImage dialog.\"\n imageAltText=\"Alternate text\"\n i18n-imageHeight=\"kendo.editor.imageHeight|The caption for the image height in the insertImage dialog.\"\n imageHeight=\"Height (px)\"\n i18n-imageWebAddress=\"kendo.editor.imageWebAddress|The caption for the image URL in the insertImage dialog.\"\n imageWebAddress=\"Web address\"\n i18n-imageWidth=\"kendo.editor.imageWidth|The caption for the image width in the insertImage dialog.\"\n imageWidth=\"Width (px)\"\n i18n-indent=\"kendo.editor.indent|The title of the tool that indents the content.\"\n indent=\"Indent\"\n i18n-insertFile=\"kendo.editor.insertFile|The title of the tool that inserts links to files.\"\n insertFile=\"Insert file\"\n i18n-insertImage=\"kendo.editor.insertImage|The title of the tool that inserts images.\"\n insertImage=\"Insert image\"\n i18n-insertOrderedList=\"kendo.editor.insertOrderedList|The title of the tool that inserts an ordered list.\"\n insertOrderedList=\"Insert ordered list\"\n i18n-insertUnorderedList=\"kendo.editor.insertUnorderedList|The title of the tool that inserts an unordered list.\"\n insertUnorderedList=\"Insert unordered list\"\n i18n-italic=\"kendo.editor.italic|The title of the tool that makes text italicized.\"\n italic=\"Italic\"\n i18n-linkOpenInNewWindow=\"kendo.editor.linkOpenInNewWindow|The caption for the checkbox for opening the link in a new window in the createLink dialog.\"\n linkOpenInNewWindow=\"Open link in new window\"\n i18n-linkText=\"kendo.editor.linkText|The caption for the link text in the createLink dialog.\"\n linkText=\"Text\"\n i18n-linkTitle=\"kendo.editor.linkTitle|The caption for the link title in the createLink dialog.\"\n linkTitle=\"Title\"\n i18n-linkWebAddress=\"kendo.editor.linkWebAddress|The caption for the URL in the createLink dialog.\"\n linkWebAddress=\"Web address\"\n i18n-outdent=\"kendo.editor.outdent|The title of the tool that outdents the content.\"\n outdent=\"Outdent\"\n i18n-print=\"kendo.editor.print|The title of the print tool.\"\n print=\"Print\"\n i18n-redo=\"kendo.editor.redo|The title of the tool that undos the last action.\"\n redo=\"Redo\"\n i18n-selectAll=\"kendo.editor.selectAll|The title of the tool that selects all content.\"\n selectAll=\"Select All\"\n i18n-strikethrough=\"kendo.editor.strikethrough|The title of the tool that strikes through text.\"\n strikethrough=\"Strikethrough\"\n i18n-subscript=\"kendo.editor.subscript|The title of the tool that makes text subscript.\"\n subscript=\"Subscript\"\n i18n-superscript=\"kendo.editor.superscript|The title of the tool that makes text superscript.\"\n superscript=\"Superscript\"\n i18n-underline=\"kendo.editor.underline|The title of the tool that underlines text.\"\n underline=\"Underline\"\n i18n-unlink=\"kendo.editor.unlink|The title of the tool that removes hyperlinks.\"\n unlink=\"Remove Link\"\n i18n-undo=\"kendo.editor.undo|The title of the tool that undos the last action.\"\n undo=\"Undo\"\n i18n-viewSource=\"kendo.editor.viewSource|The title of the tool that shows the editor value as HTML.\"\n viewSource=\"View source\"\n i18n-insertTable=\"kendo.editor.insertTable|The title of the tool that inserts table.\"\n insertTable=\"Insert Table\"\n i18n-addColumnBefore=\"kendo.editor.addColumnBefore|The title of the tool that adds new column before currently selected column.\"\n addColumnBefore=\"Add column before\"\n i18n-addColumnAfter=\"kendo.editor.addColumnAfter|The title of the tool that adds new column after currently selected column.\"\n addColumnAfter=\"Add column after\"\n i18n-addRowBefore=\"kendo.editor.addRowBefore|The title of the tool that adds new row before currently selected row.\"\n addRowBefore=\"Add row before\"\n i18n-addRowAfter=\"kendo.editor.addRowAfter|The title of the tool that adds new row after currently selected row.\"\n addRowAfter=\"Add row after\"\n i18n-deleteColumn=\"kendo.editor.deleteColumn|The title of the tool that deletes a table column.\"\n deleteColumn=\"Delete column\"\n i18n-deleteRow=\"kendo.editor.deleteRow|The title of the tool that deletes a table row.\"\n deleteRow=\"Delete row\"\n i18n-deleteTable=\"kendo.editor.deleteTable|The title of the tool that deletes a table.\"\n deleteTable=\"Delete table\"\n >\n </ng-container>\n\n <ng-content select=\"kendo-toolbar\"></ng-content>\n <kendo-toolbar [overflow]=\"true\" [tabindex]=\"readonly ? -1 : 0\" *ngIf=\"!userToolBarElement\" #defaultToolbar>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorBoldButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorItalicButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorUnderlineButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-dropdownlist kendoEditorFormat></kendo-toolbar-dropdownlist>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorAlignLeftButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignCenterButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignRightButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignJustifyButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorInsertUnorderedListButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorInsertOrderedListButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorIndentButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorOutdentButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorCreateLinkButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorUnlinkButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorInsertImageButton></kendo-toolbar-button>\n </kendo-toolbar>\n\n <div *ngIf=\"!iframe\" #content [attr.dir]=\"direction\" class=\"k-editor-content\"></div>\n\n <div class=\"k-editor-content\" *ngIf=\"iframe\">\n <iframe #content srcdoc=\"<!DOCTYPE html>\" frameborder=\"0\" class=\"k-iframe\" (load)=\"iframeOnLoad()\"></iframe>\n </div>\n\n <ng-container #dialogsContainer></ng-container>\n ",
|
|
1915
|
+
template: "\n <ng-container\n kendoEditorLocalizedMessages\n i18n-alignCenter=\"kendo.editor.alignCenter|The title of the tool that aligns text in the center.\"\n alignCenter=\"Center text\"\n i18n-alignJustify=\"kendo.editor.alignJustify|The title of the tool that justifies text both left and right.\"\n alignJustify=\"Justify\"\n i18n-alignLeft=\"kendo.editor.alignLeft|The title of the tool that aligns text on the left.\"\n alignLeft=\"Align text left\"\n i18n-alignRight=\"kendo.editor.alignRight|The title of the tool that aligns text on the right.\"\n alignRight=\"Align text right\"\n i18n-backColor=\"kendo.editor.backColor|The title of the tool that changes the text background color.\"\n backColor=\"Background color\"\n i18n-blockquote=\"kendo.editor.blockquote|The title of the tool that wraps an element in a blockquote\"\n blockquote=\"Quotation\"\n i18n-bold=\"kendo.editor.bold|The title of the tool that makes text bold.\"\n bold=\"Bold\"\n i18n-cleanFormatting=\"kendo.editor.cleanFormatting|The title of the Clean Formatting tool.\"\n cleanFormatting=\"Clean formatting\"\n i18n-createLink=\"kendo.editor.createLink|The title of the tool that creates hyperlinks.\"\n createLink=\"Insert link\"\n i18n-dialogApply=\"kendo.editor.dialogApply|The label of the **Apply** button in all editor dialogs.\"\n dialogApply=\"Apply\"\n i18n-dialogCancel=\"kendo.editor.dialogCancel|The label of the **Cancel** button in all editor dialogs.\"\n dialogCancel=\"Cancel\"\n i18n-dialogInsert=\"kendo.editor.dialogInsert|The label of the **Insert** button in all editor dialogs.\"\n dialogInsert=\"Insert\"\n i18n-dialogUpdate=\"kendo.editor.dialogUpdate|The label of the **Update** button in all editor dialogs.\"\n dialogUpdate=\"Update\"\n i18n-fileText=\"kendo.editor.fileText|The caption for the file text in the insertFile dialog.\"\n fileText=\"Text\"\n i18n-fileTitle=\"kendo.editor.fileTitle|The caption for the file Title in the insertFile dialog.\"\n fileTitle=\"Title\"\n i18n-fileWebAddress=\"kendo.editor.fileWebAddress|The caption for the file URL in the insertFile dialog.\"\n fileWebAddress=\"Web address\"\n i18n-fontFamily=\"kendo.editor.fontFamily|The title of the tool that changes the text font.\"\n fontFamily=\"Select font family\"\n i18n-fontSize=\"kendo.editor.fontSize|The title of the tool that changes the text size.\"\n fontSize=\"Select font size\"\n i18n-foreColor=\"kendo.editor.foreColor|The title of the tool that changes the text color.\"\n foreColor=\"Color\"\n i18n-format=\"kendo.editor.format|The title of the tool that lets users choose block formats.\"\n format=\"Format\"\n i18n-imageAltText=\"kendo.editor.imageAltText|The caption for the image alternate text in the insertImage dialog.\"\n imageAltText=\"Alternate text\"\n i18n-imageHeight=\"kendo.editor.imageHeight|The caption for the image height in the insertImage dialog.\"\n imageHeight=\"Height (px)\"\n i18n-imageWebAddress=\"kendo.editor.imageWebAddress|The caption for the image URL in the insertImage dialog.\"\n imageWebAddress=\"Web address\"\n i18n-imageWidth=\"kendo.editor.imageWidth|The caption for the image width in the insertImage dialog.\"\n imageWidth=\"Width (px)\"\n i18n-indent=\"kendo.editor.indent|The title of the tool that indents the content.\"\n indent=\"Indent\"\n i18n-insertFile=\"kendo.editor.insertFile|The title of the tool that inserts links to files.\"\n insertFile=\"Insert file\"\n i18n-insertImage=\"kendo.editor.insertImage|The title of the tool that inserts images.\"\n insertImage=\"Insert image\"\n i18n-insertOrderedList=\"kendo.editor.insertOrderedList|The title of the tool that inserts an ordered list.\"\n insertOrderedList=\"Insert ordered list\"\n i18n-insertUnorderedList=\"kendo.editor.insertUnorderedList|The title of the tool that inserts an unordered list.\"\n insertUnorderedList=\"Insert unordered list\"\n i18n-italic=\"kendo.editor.italic|The title of the tool that makes text italicized.\"\n italic=\"Italic\"\n i18n-linkOpenInNewWindow=\"kendo.editor.linkOpenInNewWindow|The caption for the checkbox for opening the link in a new window in the createLink dialog.\"\n linkOpenInNewWindow=\"Open link in new window\"\n i18n-linkText=\"kendo.editor.linkText|The caption for the link text in the createLink dialog.\"\n linkText=\"Text\"\n i18n-linkTitle=\"kendo.editor.linkTitle|The caption for the link title in the createLink dialog.\"\n linkTitle=\"Title\"\n i18n-linkWebAddress=\"kendo.editor.linkWebAddress|The caption for the URL in the createLink dialog.\"\n linkWebAddress=\"Web address\"\n i18n-outdent=\"kendo.editor.outdent|The title of the tool that outdents the content.\"\n outdent=\"Outdent\"\n i18n-print=\"kendo.editor.print|The title of the print tool.\"\n print=\"Print\"\n i18n-redo=\"kendo.editor.redo|The title of the tool that undos the last action.\"\n redo=\"Redo\"\n i18n-selectAll=\"kendo.editor.selectAll|The title of the tool that selects all content.\"\n selectAll=\"Select All\"\n i18n-strikethrough=\"kendo.editor.strikethrough|The title of the tool that strikes through text.\"\n strikethrough=\"Strikethrough\"\n i18n-subscript=\"kendo.editor.subscript|The title of the tool that makes text subscript.\"\n subscript=\"Subscript\"\n i18n-superscript=\"kendo.editor.superscript|The title of the tool that makes text superscript.\"\n superscript=\"Superscript\"\n i18n-underline=\"kendo.editor.underline|The title of the tool that underlines text.\"\n underline=\"Underline\"\n i18n-unlink=\"kendo.editor.unlink|The title of the tool that removes hyperlinks.\"\n unlink=\"Remove Link\"\n i18n-undo=\"kendo.editor.undo|The title of the tool that undos the last action.\"\n undo=\"Undo\"\n i18n-viewSource=\"kendo.editor.viewSource|The title of the tool that shows the editor value as HTML.\"\n viewSource=\"View source\"\n i18n-insertTable=\"kendo.editor.insertTable|The title of the tool that inserts table.\"\n insertTable=\"Insert Table\"\n i18n-addColumnBefore=\"kendo.editor.addColumnBefore|The title of the tool that adds new column before currently selected column.\"\n addColumnBefore=\"Add column before\"\n i18n-addColumnAfter=\"kendo.editor.addColumnAfter|The title of the tool that adds new column after currently selected column.\"\n addColumnAfter=\"Add column after\"\n i18n-addRowBefore=\"kendo.editor.addRowBefore|The title of the tool that adds new row before currently selected row.\"\n addRowBefore=\"Add row before\"\n i18n-addRowAfter=\"kendo.editor.addRowAfter|The title of the tool that adds new row after currently selected row.\"\n addRowAfter=\"Add row after\"\n i18n-deleteColumn=\"kendo.editor.deleteColumn|The title of the tool that deletes a table column.\"\n deleteColumn=\"Delete column\"\n i18n-deleteRow=\"kendo.editor.deleteRow|The title of the tool that deletes a table row.\"\n deleteRow=\"Delete row\"\n i18n-deleteTable=\"kendo.editor.deleteTable|The title of the tool that deletes a table.\"\n deleteTable=\"Delete table\"\n >\n </ng-container>\n\n <ng-content select=\"kendo-toolbar\"></ng-content>\n <kendo-toolbar [overflow]=\"true\" [tabindex]=\"readonly ? -1 : 0\" *ngIf=\"!userToolBarElement\" #defaultToolbar>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorBoldButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorItalicButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorUnderlineButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-dropdownlist kendoEditorFormat></kendo-toolbar-dropdownlist>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorAlignLeftButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignCenterButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignRightButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignJustifyButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorInsertUnorderedListButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorInsertOrderedListButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorIndentButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorOutdentButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorCreateLinkButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorUnlinkButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorInsertImageButton></kendo-toolbar-button>\n </kendo-toolbar>\n\n <div *ngIf=\"!iframe\" #content [attr.dir]=\"direction\" class=\"k-editor-content\"></div>\n\n <div class=\"k-editor-content\" *ngIf=\"iframe\">\n <iframe #content srcdoc=\"<!DOCTYPE html>\" frameborder=\"0\" class=\"k-iframe\" (load)=\"iframeOnLoad()\"></iframe>\n </div>\n\n <ng-container #dialogsContainer></ng-container>\n ",
|
|
3308
1916
|
styles: [
|
|
3309
1917
|
"\n >>> .k-editor-content > .ProseMirror {\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n outline: none;\n overflow: auto;\n }\n\n .k-iframe {\n width: 100%;\n height: 100%;\n display: block;\n }\n "
|
|
3310
1918
|
]
|
|
@@ -3376,7 +1984,7 @@ var FormatDropDownListComponent = /** @class */ (function () {
|
|
|
3376
1984
|
Component({
|
|
3377
1985
|
// tslint:disable-next-line:no-forward-ref
|
|
3378
1986
|
selector: 'kendo-editor-format-dropdownlist',
|
|
3379
|
-
template: "\n <kendo-dropdownlist\n #element\n kendoEditorDropDownTool\n [defaultItem]=\"defaultItem\"\n [textField]=\"'text'\"\n [valueField]=\"'tag'\"\n [data]=\"data\"\n [(value)]=\"value\"\n [valuePrimitive]=\"true\"\n [itemDisabled]=\"itemDisabled\"\n [attr.title]=\"title\"\n [disabled]=\"disabled\"\n [tabindex]=\"tabindex\"\n (valueChange)=\"onValueChange($event)\"\n >\n <ng-template kendoDropDownListItemTemplate let-dataItem>\n <ng-container [ngSwitch]=\"dataItem.tag\">\n <span *ngSwitchCase=\"'h1'\" style=\"display: block; font-size: 2em; margin-left: 0; font-weight: bold;\">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase=\"'h2'\" style=\"display: block; font-size: 1.5em; margin-left: 0; font-weight: bold;\">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase=\"'h3'\" style=\"display: block; font-size: 1.17em; margin-left: 0; font-weight: bold;\">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase=\"'h4'\" style=\"display: block; font-size: 1em; margin-left: 0; font-weight: bold;\">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase=\"'h5'\" style=\"display: block; font-size: .83em; margin-left: 0; font-weight: bold;\">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase=\"'h6'\" style=\"display: block; font-size: .67em; margin-left: 0; font-weight: bold;\">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase=\"'p'\" style=\"display: block; margin-left: 0;\">\n {{ dataItem.text }}\n </span>\n\n <span *
|
|
1987
|
+
template: "\n <kendo-dropdownlist\n #element\n kendoEditorDropDownTool\n [defaultItem]=\"defaultItem\"\n [textField]=\"'text'\"\n [valueField]=\"'tag'\"\n [data]=\"data\"\n [(value)]=\"value\"\n [valuePrimitive]=\"true\"\n [itemDisabled]=\"itemDisabled\"\n [attr.title]=\"title\"\n [disabled]=\"disabled\"\n [tabindex]=\"tabindex\"\n (valueChange)=\"onValueChange($event)\"\n >\n <ng-template kendoDropDownListItemTemplate let-dataItem>\n <ng-container [ngSwitch]=\"dataItem.tag\">\n <span *ngSwitchCase=\"'h1'\" style=\"display: block; font-size: 2em; margin-left: 0; font-weight: bold;\">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase=\"'h2'\" style=\"display: block; font-size: 1.5em; margin-left: 0; font-weight: bold;\">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase=\"'h3'\" style=\"display: block; font-size: 1.17em; margin-left: 0; font-weight: bold;\">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase=\"'h4'\" style=\"display: block; font-size: 1em; margin-left: 0; font-weight: bold;\">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase=\"'h5'\" style=\"display: block; font-size: .83em; margin-left: 0; font-weight: bold;\">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase=\"'h6'\" style=\"display: block; font-size: .67em; margin-left: 0; font-weight: bold;\">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase=\"'p'\" style=\"display: block; margin-left: 0;\">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchDefault>{{ dataItem.text }}</span>\n </ng-container>\n </ng-template>\n </kendo-dropdownlist>\n "
|
|
3380
1988
|
})
|
|
3381
1989
|
], FormatDropDownListComponent);
|
|
3382
1990
|
return FormatDropDownListComponent;
|
|
@@ -3488,7 +2096,7 @@ var ColorPickerDialogComponent = /** @class */ (function (_super) {
|
|
|
3488
2096
|
], ColorPickerDialogComponent.prototype, "colorPicker", void 0);
|
|
3489
2097
|
ColorPickerDialogComponent = __decorate([
|
|
3490
2098
|
Component({
|
|
3491
|
-
template: "\n <kendo-dialog-titlebar (close)=\"onCancelAction()\">\n {{ textFor(editorCommand) }}\n </kendo-dialog-titlebar>\n <div class=\"k-editor-dialog\">\n <div class=\"k-editor-dialog k-popup-edit-form k-window-content k-content\">\n <div class=\"k-edit-form-container k-window-content\" style=\"text-align: center;\">\n <kendo-colorpicker\n #colorpicker\n [
|
|
2099
|
+
template: "\n <kendo-dialog-titlebar (close)=\"onCancelAction()\">\n {{ textFor(editorCommand) }}\n </kendo-dialog-titlebar>\n <div class=\"k-editor-dialog\">\n <div class=\"k-editor-dialog k-popup-edit-form k-window-content k-content\">\n <div class=\"k-edit-form-container k-window-content\" style=\"text-align: center;\">\n <kendo-colorpicker\n #colorpicker\n [views]=\"['palette']\"\n [format]=\"'hex'\"\n [attr.title]=\"title\"\n [icon]=\"icon\"\n [(value)]=\"value\"\n [paletteSettings]=\"paletteSettings\"\n (activeColorClick)=\"handleActiveColorClick($event)\"\n >\n </kendo-colorpicker>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)=\"onCancelAction()\">{{ textFor('dialogCancel') }}</button>\n <button kendoButton\n (click)=\"onConfirmAction()\" [primary]=\"true\">{{ textFor('dialogApply') }}</button>\n </kendo-dialog-actions>\n "
|
|
3492
2100
|
}),
|
|
3493
2101
|
__metadata("design:paramtypes", [DialogRef,
|
|
3494
2102
|
EditorLocalizationService])
|
|
@@ -3681,7 +2289,6 @@ var EditorFormatComponent = /** @class */ (function (_super) {
|
|
|
3681
2289
|
_this.valueChange = new EventEmitter();
|
|
3682
2290
|
_this._data = [
|
|
3683
2291
|
{ text: 'Paragraph', tag: 'p' },
|
|
3684
|
-
{ text: 'Quotation', tag: 'blockquote' },
|
|
3685
2292
|
{ text: 'Heading 1', tag: 'h1' },
|
|
3686
2293
|
{ text: 'Heading 2', tag: 'h2' },
|
|
3687
2294
|
{ text: 'Heading 3', tag: 'h3' },
|
|
@@ -4370,14 +2977,26 @@ var EditorColorPickerComponent = /** @class */ (function (_super) {
|
|
|
4370
2977
|
*/
|
|
4371
2978
|
_this.disabled = false;
|
|
4372
2979
|
/**
|
|
4373
|
-
* Specifies whether the ColorPicker will render a gradient, palette or
|
|
2980
|
+
* Specifies whether the ColorPicker will render a gradient, palette, or both in its popup.
|
|
4374
2981
|
*
|
|
4375
|
-
* @default 'palette'
|
|
2982
|
+
* @default ['palette']
|
|
4376
2983
|
*/
|
|
4377
|
-
_this.
|
|
2984
|
+
_this.views = ['palette'];
|
|
4378
2985
|
return _this;
|
|
4379
2986
|
}
|
|
4380
2987
|
EditorColorPickerComponent_1 = EditorColorPickerComponent;
|
|
2988
|
+
Object.defineProperty(EditorColorPickerComponent.prototype, "view", {
|
|
2989
|
+
/**
|
|
2990
|
+
* @hidden
|
|
2991
|
+
*
|
|
2992
|
+
* For backward compatibility with configurations using the deprecated "view" input.
|
|
2993
|
+
*/
|
|
2994
|
+
set: function (view) {
|
|
2995
|
+
this.views = [view];
|
|
2996
|
+
},
|
|
2997
|
+
enumerable: true,
|
|
2998
|
+
configurable: true
|
|
2999
|
+
});
|
|
4381
3000
|
Object.defineProperty(EditorColorPickerComponent.prototype, "title", {
|
|
4382
3001
|
/**
|
|
4383
3002
|
* @hidden
|
|
@@ -4459,7 +3078,7 @@ var EditorColorPickerComponent = /** @class */ (function (_super) {
|
|
|
4459
3078
|
editorCommand: this.editorCommand,
|
|
4460
3079
|
paletteSettings: this.paletteSettings,
|
|
4461
3080
|
icon: this.icon,
|
|
4462
|
-
|
|
3081
|
+
views: this.views
|
|
4463
3082
|
});
|
|
4464
3083
|
};
|
|
4465
3084
|
/**
|
|
@@ -4510,8 +3129,13 @@ var EditorColorPickerComponent = /** @class */ (function (_super) {
|
|
|
4510
3129
|
], EditorColorPickerComponent.prototype, "disabled", void 0);
|
|
4511
3130
|
__decorate([
|
|
4512
3131
|
Input(),
|
|
4513
|
-
__metadata("design:type",
|
|
4514
|
-
], EditorColorPickerComponent.prototype, "
|
|
3132
|
+
__metadata("design:type", Array)
|
|
3133
|
+
], EditorColorPickerComponent.prototype, "views", void 0);
|
|
3134
|
+
__decorate([
|
|
3135
|
+
Input(),
|
|
3136
|
+
__metadata("design:type", String),
|
|
3137
|
+
__metadata("design:paramtypes", [String])
|
|
3138
|
+
], EditorColorPickerComponent.prototype, "view", null);
|
|
4515
3139
|
__decorate([
|
|
4516
3140
|
ViewChild('toolbarTemplate', { static: true }),
|
|
4517
3141
|
__metadata("design:type", TemplateRef)
|
|
@@ -4536,7 +3160,7 @@ var EditorColorPickerComponent = /** @class */ (function (_super) {
|
|
|
4536
3160
|
Component({
|
|
4537
3161
|
providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(function () { return EditorColorPickerComponent_1; }) }],
|
|
4538
3162
|
selector: 'kendo-toolbar-colorpicker',
|
|
4539
|
-
template: "\n <ng-template #toolbarTemplate>\n <kendo-colorpicker\n #colorpicker\n [
|
|
3163
|
+
template: "\n <ng-template #toolbarTemplate>\n <kendo-colorpicker\n #colorpicker\n [views]=\"['palette']\"\n [format]=\"'hex'\"\n [attr.title]=\"title\"\n [icon]=\"icon\"\n [value]=\"value\"\n [paletteSettings]=\"paletteSettings\"\n [disabled]=\"disabled\"\n [tabindex]=\"tabindex\"\n (valueChange)=\"handleValueChange($event)\"\n (activeColorClick)=\"handleActiveColorClick($event)\"\n (open)=\"onOpen(colorpicker)\"\n (close)=\"onClose(colorpicker)\"\n >\n </kendo-colorpicker>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n tabindex=\"-1\"\n type=\"button\"\n kendoButton\n #colorPickerButton\n class=\"k-overflow-button\"\n [icon]=\"icon\"\n [attr.title]=\"title\"\n [disabled]=\"disabled\"\n [tabindex]=\"tabindex\"\n (click)=\"openDialog()\"\n >\n {{ title }}\n </button>\n </ng-template>\n "
|
|
4540
3164
|
}),
|
|
4541
3165
|
__param(0, Host()),
|
|
4542
3166
|
__metadata("design:paramtypes", [EditorComponent,
|
|
@@ -4790,7 +3414,7 @@ var PopupTableGridComponent = /** @class */ (function () {
|
|
|
4790
3414
|
PopupTableGridComponent = __decorate([
|
|
4791
3415
|
Component({
|
|
4792
3416
|
selector: 'kendo-popup-table-grid',
|
|
4793
|
-
template: "\n <div style=\"border-color: inherit;\" (mouseleave)=\"resetState()\" (click)=\"insertTable()\">\n <span *ngFor=\"let i of cells\"\n class=\"k-ct-cell\"\n [class.k-
|
|
3417
|
+
template: "\n <div style=\"border-color: inherit;\" (mouseleave)=\"resetState()\" (click)=\"insertTable()\">\n <span *ngFor=\"let i of cells\"\n class=\"k-ct-cell\"\n [class.k-selected]=\"selected(i)\"\n [class.k-disabled]=\"!selected(i)\"\n (mouseenter)=\"setState(i)\">\n </span>\n </div>\n <div class=\"k-status\" unselectable=\"on\">{{ message }}</div>\n <!-- uncomment when TableWizard is completed\n <div class=\"k-editor-toolbar\" unselectable=\"on\">\n <button type=\"button\" kendoButton class=\"k-tool\" [icon]=\"'table-wizard'\" (click)=\"openTableWizard()\" title=\"Table Wizard\">Table Wizard</button>\n </div>\n -->\n "
|
|
4794
3418
|
})
|
|
4795
3419
|
], PopupTableGridComponent);
|
|
4796
3420
|
return PopupTableGridComponent;
|
|
@@ -4805,6 +3429,7 @@ var commandIcons = {
|
|
|
4805
3429
|
alignLeft: 'align-left',
|
|
4806
3430
|
alignRight: 'align-right',
|
|
4807
3431
|
backColor: 'background',
|
|
3432
|
+
blockquote: 'blockquote',
|
|
4808
3433
|
bold: 'bold',
|
|
4809
3434
|
cleanFormatting: 'clear-css',
|
|
4810
3435
|
createLink: 'link-horizontal',
|
|
@@ -5056,6 +3681,43 @@ var EditorAlignJustifyButtonDirective = /** @class */ (function (_super) {
|
|
|
5056
3681
|
return EditorAlignJustifyButtonDirective;
|
|
5057
3682
|
}(EditorCommandButton));
|
|
5058
3683
|
|
|
3684
|
+
/**
|
|
3685
|
+
* A directive which configures an existing `ToolBarButtonComponent` as an Editor Blockquote tool
|
|
3686
|
+
* ([see example]({% slug toolbartools_editor %}#toc-built-in-tools)).
|
|
3687
|
+
* The directive will predefine the `icon` and `click` event handlers of the button.
|
|
3688
|
+
*
|
|
3689
|
+
* @example
|
|
3690
|
+
* ```ts-no-run
|
|
3691
|
+
* <kendo-toolbar-button kendoEditorBlockquoteButton></kendo-toolbar-button>
|
|
3692
|
+
* ```
|
|
3693
|
+
*
|
|
3694
|
+
* The following example demonstrates how to change the default icon that is applied by the directive.
|
|
3695
|
+
*
|
|
3696
|
+
* @example
|
|
3697
|
+
* ```ts-no-run
|
|
3698
|
+
* <kendo-toolbar-button kendoEditorBlockquoteButton icon="blogger"></kendo-toolbar-button>
|
|
3699
|
+
* ```
|
|
3700
|
+
*/
|
|
3701
|
+
var EditorBlockquoteDirective = /** @class */ (function (_super) {
|
|
3702
|
+
__extends(EditorBlockquoteDirective, _super);
|
|
3703
|
+
function EditorBlockquoteDirective(button, editor, localization, toolsService) {
|
|
3704
|
+
var _this = _super.call(this, 'blockquote', button, editor, localization, toolsService) || this;
|
|
3705
|
+
_this.editor = editor;
|
|
3706
|
+
return _this;
|
|
3707
|
+
}
|
|
3708
|
+
EditorBlockquoteDirective = __decorate([
|
|
3709
|
+
Directive({
|
|
3710
|
+
selector: 'kendo-toolbar-button[kendoEditorBlockquoteButton]'
|
|
3711
|
+
}),
|
|
3712
|
+
__param(1, Host()),
|
|
3713
|
+
__metadata("design:paramtypes", [ToolBarButtonComponent,
|
|
3714
|
+
EditorComponent,
|
|
3715
|
+
EditorLocalizationService,
|
|
3716
|
+
EditorToolsService])
|
|
3717
|
+
], EditorBlockquoteDirective);
|
|
3718
|
+
return EditorBlockquoteDirective;
|
|
3719
|
+
}(EditorCommandButton));
|
|
3720
|
+
|
|
5059
3721
|
/**
|
|
5060
3722
|
* A directive which configures an existing `ToolBarButtonComponent` as an Editor Redo tool
|
|
5061
3723
|
* ([see example]({% slug toolbartools_editor %}#toc-built-in-tools)).
|
|
@@ -6050,6 +4712,10 @@ var Messages = /** @class */ (function (_super) {
|
|
|
6050
4712
|
Input(),
|
|
6051
4713
|
__metadata("design:type", String)
|
|
6052
4714
|
], Messages.prototype, "backColor", void 0);
|
|
4715
|
+
__decorate([
|
|
4716
|
+
Input(),
|
|
4717
|
+
__metadata("design:type", String)
|
|
4718
|
+
], Messages.prototype, "blockquote", void 0);
|
|
6053
4719
|
__decorate([
|
|
6054
4720
|
Input(),
|
|
6055
4721
|
__metadata("design:type", String)
|
|
@@ -6485,7 +5151,9 @@ var COMPONENT_DIRECTIVES = [
|
|
|
6485
5151
|
// print
|
|
6486
5152
|
EditorPrintDirective,
|
|
6487
5153
|
// select all
|
|
6488
|
-
EditorSelectAllButtonDirective
|
|
5154
|
+
EditorSelectAllButtonDirective,
|
|
5155
|
+
// blockquote
|
|
5156
|
+
EditorBlockquoteDirective
|
|
6489
5157
|
];
|
|
6490
5158
|
var TOOLBAR_TOOLS = [
|
|
6491
5159
|
EditorFontSizeComponent,
|
|
@@ -6590,6 +5258,7 @@ var EditorModule = /** @class */ (function () {
|
|
|
6590
5258
|
DialogModule,
|
|
6591
5259
|
DropDownsModule,
|
|
6592
5260
|
NumericTextBoxModule,
|
|
5261
|
+
CheckBoxModule,
|
|
6593
5262
|
ToolBarModule,
|
|
6594
5263
|
TextBoxModule
|
|
6595
5264
|
]
|
|
@@ -6602,4 +5271,4 @@ var EditorModule = /** @class */ (function () {
|
|
|
6602
5271
|
* Generated bundle index. Do not edit.
|
|
6603
5272
|
*/
|
|
6604
5273
|
|
|
6605
|
-
export { ColorPickerDialogComponent, FileLinkDialogComponent, FontFamilyDialogComponent, FontSizeDialogComponent, FormatDialogComponent, ImageDialogComponent, InsertTableDialogComponent, SourceDialogComponent, CustomMessagesComponent, EditorLocalizationService, LocalizedMessagesDirective, Messages, EditorAlignCenterButtonDirective, EditorAlignJustifyButtonDirective, EditorAlignLeftButtonDirective, EditorAlignRightButtonDirective, EditorBackColorDirective, EditorColorPickerComponent, EditorForeColorDirective, EditorCleanFormattingButtonDirective, FontFamilyDropDownListComponent, EditorFontFamilyComponent, FontSizeDropDownListComponent, EditorFontSizeComponent, FormatDropDownListComponent, EditorFormatComponent, EditorRedoButtonDirective, EditorUndoButtonDirective, EditorInsertImageButtonDirective, EditorIndentButtonDirective, EditorOutdentButtonDirective, EditorCreateLinkButtonDirective, EditorInsertFileButtonDirective, EditorUnlinkButtonDirective, EditorInsertOrderedListButtonDirective, EditorInsertUnorderedListButtonDirective, EditorPrintDirective, EditorSelectAllButtonDirective, DropDownToolDirective, EditorCommandBase, EditorCommandButton, EditorCommandDialog, EditorViewSourceButtonDirective, EditorAddColumnAfterButtonDirective, EditorAddColumnBeforeButtonDirective, EditorAddRowAfterButtonDirective, EditorAddRowBeforeButtonDirective, EditorDeleteColumnButtonDirective, EditorDeleteRowButtonDirective, EditorDeleteTableButtonDirective, EditorInsertTableButtonComponent, EditorMergeCellsButtonDirective, EditorSplitCellButtonDirective, PopupTableGridComponent, EditorToolsService, EditorBoldButtonDirective, EditorItalicButtonDirective, EditorStrikethroughButtonDirective, EditorSubscriptButtonDirective, EditorSuperscriptButtonDirective, EditorUnderlineButtonDirective, EditorComponent, EditorModule, schema, EditorPasteEvent };
|
|
5274
|
+
export { semanticNodes, semanticTagNames, ColorPickerDialogComponent, FileLinkDialogComponent, FontFamilyDialogComponent, FontSizeDialogComponent, FormatDialogComponent, ImageDialogComponent, InsertTableDialogComponent, SourceDialogComponent, CustomMessagesComponent, EditorLocalizationService, LocalizedMessagesDirective, Messages, EditorAlignCenterButtonDirective, EditorAlignJustifyButtonDirective, EditorAlignLeftButtonDirective, EditorAlignRightButtonDirective, EditorBlockquoteDirective, EditorBackColorDirective, EditorColorPickerComponent, EditorForeColorDirective, EditorCleanFormattingButtonDirective, FontFamilyDropDownListComponent, EditorFontFamilyComponent, FontSizeDropDownListComponent, EditorFontSizeComponent, FormatDropDownListComponent, EditorFormatComponent, EditorRedoButtonDirective, EditorUndoButtonDirective, EditorInsertImageButtonDirective, EditorIndentButtonDirective, EditorOutdentButtonDirective, EditorCreateLinkButtonDirective, EditorInsertFileButtonDirective, EditorUnlinkButtonDirective, EditorInsertOrderedListButtonDirective, EditorInsertUnorderedListButtonDirective, EditorPrintDirective, EditorSelectAllButtonDirective, DropDownToolDirective, EditorCommandBase, EditorCommandButton, EditorCommandDialog, EditorViewSourceButtonDirective, EditorAddColumnAfterButtonDirective, EditorAddColumnBeforeButtonDirective, EditorAddRowAfterButtonDirective, EditorAddRowBeforeButtonDirective, EditorDeleteColumnButtonDirective, EditorDeleteRowButtonDirective, EditorDeleteTableButtonDirective, EditorInsertTableButtonComponent, EditorMergeCellsButtonDirective, EditorSplitCellButtonDirective, PopupTableGridComponent, EditorToolsService, EditorBoldButtonDirective, EditorItalicButtonDirective, EditorStrikethroughButtonDirective, EditorSubscriptButtonDirective, EditorSuperscriptButtonDirective, EditorUnderlineButtonDirective, EditorComponent, EditorModule, schema, EditorPasteEvent };
|