@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
|
@@ -13,7 +13,7 @@ export var EditorErrorMessages = {
|
|
|
13
13
|
pluginsCallbackType: ɵ0,
|
|
14
14
|
pastedContentCallbackType: ɵ1,
|
|
15
15
|
setPluginsOnce: 'The plugins cannot be changed dynamically. See http://www.telerik.com/kendo-angular-ui/components/editor/plugins/',
|
|
16
|
-
setPlaceHolderOnce: 'The placeholder cannot be changed dynamically. See
|
|
16
|
+
setPlaceHolderOnce: 'The placeholder cannot be changed dynamically. See https://www.telerik.com/kendo-angular-ui/components/editor/plugins/#toc-custom-plugins/',
|
|
17
17
|
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/'
|
|
18
18
|
};
|
|
19
19
|
export { ɵ0, ɵ1 };
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
|
-
import { alignBlocks, alignLeftRules, alignCenterRules, alignRightRules, alignJustifyRules, alignRemoveRules, indent, outdent, setHtml, getHtml, insertImage, insertText, applyLink, removeLink, expandToWordWrap,
|
|
6
|
+
import { alignBlocks, alignLeftRules, alignCenterRules, alignRightRules, alignJustifyRules, alignRemoveRules, indent, outdent, setHtml, getHtml, insertImage, insertText, applyLink, removeLink, expandToWordWrap, blockquote,
|
|
7
7
|
//marks
|
|
8
|
-
bold, italic, underline, strikethrough, subscript, superscript, link, toggleInlineFormat, applyInlineStyle, formatBlockElements, toggleOrderedList, toggleUnorderedList, isAligned, undo, redo, cleanFormatting, selectAll } from '@progress/kendo-editor-common';
|
|
9
|
-
import { insertTable
|
|
8
|
+
bold, italic, underline, strikethrough, subscript, superscript, link, toggleInlineFormat, applyInlineStyle, formatBlockElements, toggleOrderedList, toggleUnorderedList, isAligned, undo, redo, cleanFormatting, selectAll, addColumnBefore, addColumnAfter, addRowBefore, addRowAfter, deleteRow, deleteColumn, deleteTable, mergeCells, splitCell } from '@progress/kendo-editor-common';
|
|
9
|
+
import { insertTable } from './table-commands';
|
|
10
10
|
var alignRemove = function (state, dispatch) { return alignBlocks(alignRemoveRules)(state, dispatch); };
|
|
11
11
|
var ɵ0 = alignRemove;
|
|
12
12
|
var ɵ1 = function (applyToWord) { return expandToWordWrap(toggleInlineFormat, tslib_1.__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, tslib_1.__assign({}, italic, { applyToWord: applyToWord })); }, ɵ9 = function (applyToWord) { return expandToWordWrap(toggleInlineFormat, tslib_1.__assign({}, strikethrough, { applyToWord: applyToWord })); }, ɵ10 = function (applyToWord) { return expandToWordWrap(toggleInlineFormat, tslib_1.__assign({}, subscript, { applyToWord: applyToWord })); }, ɵ11 = function (applyToWord) { return expandToWordWrap(toggleInlineFormat, tslib_1.__assign({}, superscript, { applyToWord: applyToWord })); }, ɵ12 = function (applyToWord) { return expandToWordWrap(toggleInlineFormat, tslib_1.__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); }; };
|
|
@@ -31,7 +31,7 @@ var inlineCommand = {
|
|
|
31
31
|
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) {
|
|
32
32
|
var content = _a.content, parseOptions = _a.parseOptions;
|
|
33
33
|
return setHtml(content, 'setHTML', parseOptions);
|
|
34
|
-
}, ɵ30 = function () { return undo; };
|
|
34
|
+
}, ɵ30 = function () { return undo; }, ɵ31 = function () { return blockquote; };
|
|
35
35
|
var blockCommand = {
|
|
36
36
|
alignCenter: ɵ17,
|
|
37
37
|
alignJustify: ɵ18,
|
|
@@ -48,23 +48,24 @@ var blockCommand = {
|
|
|
48
48
|
outdent: ɵ27,
|
|
49
49
|
redo: ɵ28,
|
|
50
50
|
setHTML: ɵ29,
|
|
51
|
-
undo: ɵ30
|
|
51
|
+
undo: ɵ30,
|
|
52
|
+
blockquote: ɵ31
|
|
52
53
|
};
|
|
53
|
-
var ɵ
|
|
54
|
+
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; };
|
|
54
55
|
var tableCommand = {
|
|
55
|
-
insertTable: ɵ
|
|
56
|
-
addColumnBefore: ɵ
|
|
57
|
-
addColumnAfter: ɵ
|
|
58
|
-
addRowBefore: ɵ
|
|
59
|
-
addRowAfter: ɵ
|
|
60
|
-
deleteRow: ɵ
|
|
61
|
-
deleteColumn: ɵ
|
|
62
|
-
mergeCells: ɵ
|
|
63
|
-
splitCell: ɵ
|
|
64
|
-
deleteTable: ɵ
|
|
56
|
+
insertTable: ɵ32,
|
|
57
|
+
addColumnBefore: ɵ33,
|
|
58
|
+
addColumnAfter: ɵ34,
|
|
59
|
+
addRowBefore: ɵ35,
|
|
60
|
+
addRowAfter: ɵ36,
|
|
61
|
+
deleteRow: ɵ37,
|
|
62
|
+
deleteColumn: ɵ38,
|
|
63
|
+
mergeCells: ɵ39,
|
|
64
|
+
splitCell: ɵ40,
|
|
65
|
+
deleteTable: ɵ41
|
|
65
66
|
};
|
|
66
67
|
/**
|
|
67
68
|
* @hidden
|
|
68
69
|
*/
|
|
69
70
|
export var editorCommands = Object.assign({}, inlineCommand, blockCommand, tableCommand);
|
|
70
|
-
export { ɵ0, ɵ1, ɵ2, ɵ3, ɵ4, ɵ5, ɵ6, ɵ7, ɵ8, ɵ9, ɵ10, ɵ11, ɵ12, ɵ13, ɵ14, ɵ15, ɵ16, ɵ17, ɵ18, ɵ19, ɵ20, ɵ21, ɵ22, ɵ23, ɵ24, ɵ25, ɵ26, ɵ27, ɵ28, ɵ29, ɵ30, ɵ31, ɵ32, ɵ33, ɵ34, ɵ35, ɵ36, ɵ37, ɵ38, ɵ39, ɵ40 };
|
|
71
|
+
export { ɵ0, ɵ1, ɵ2, ɵ3, ɵ4, ɵ5, ɵ6, ɵ7, ɵ8, ɵ9, ɵ10, ɵ11, ɵ12, ɵ13, ɵ14, ɵ15, ɵ16, ɵ17, ɵ18, ɵ19, ɵ20, ɵ21, ɵ22, ɵ23, ɵ24, ɵ25, ɵ26, ɵ27, ɵ28, ɵ29, ɵ30, ɵ31, ɵ32, ɵ33, ɵ34, ɵ35, ɵ36, ɵ37, ɵ38, ɵ39, ɵ40, ɵ41 };
|
package/dist/es/config/schema.js
CHANGED
|
@@ -2,21 +2,19 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import * as tslib_1 from "tslib";
|
|
6
5
|
import { semanticNodes } from './semantic-nodes';
|
|
7
6
|
import { marks as commonMarks, nodes as commonNodes, Schema } from '@progress/kendo-editor-common';
|
|
8
|
-
import { tableNodes } from './table-nodes';
|
|
9
7
|
/**
|
|
10
8
|
* @hidden
|
|
11
9
|
*/
|
|
12
10
|
var marks = commonMarks;
|
|
13
|
-
var nodes = Object.assign(commonNodes,
|
|
11
|
+
var nodes = Object.assign(commonNodes, semanticNodes);
|
|
14
12
|
/**
|
|
15
13
|
* @hidden
|
|
16
14
|
*/
|
|
17
15
|
export var schema = new Schema({
|
|
18
16
|
marks: marks,
|
|
19
|
-
nodes:
|
|
17
|
+
nodes: nodes
|
|
20
18
|
});
|
|
21
19
|
/**
|
|
22
20
|
* @hidden
|
|
@@ -2,11 +2,7 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { insertNode,
|
|
6
|
-
import { createTable, isInTable, selectedRect, tableNodeTypes, rowIsHeader, setAttr, addColSpan, removeColSpan, isCellEmpty, splitCellWithType, cellsOverlapRectangle, findParentNodeClosestToPos } from './tables/table-utils';
|
|
7
|
-
import { isTable, isTableBody, isTableHead, isTableFoot, isTableHeaderCell, isTableCell } from './utils';
|
|
8
|
-
import { TableMap } from './tables/TableMap';
|
|
9
|
-
import { CellSelection } from './tables/CellSelection';
|
|
5
|
+
import { insertNode, createTable } from '@progress/kendo-editor-common';
|
|
10
6
|
/**
|
|
11
7
|
* @hidden
|
|
12
8
|
*/
|
|
@@ -16,361 +12,3 @@ export var insertTable = function (attrs) { return function (state, dispatch) {
|
|
|
16
12
|
insertNode(newTable, true)(state, dispatch);
|
|
17
13
|
}
|
|
18
14
|
}; };
|
|
19
|
-
var addTableGroupColumn = function (tr, _a, col, mainTable, requiredGroup, doc) {
|
|
20
|
-
var left = _a.left, right = _a.right;
|
|
21
|
-
var refColumn = col > 0 ? -1 : 0;
|
|
22
|
-
// not sure if this should be deleted
|
|
23
|
-
// if (columnIsHeader(map, table, col + refColumn)) {
|
|
24
|
-
// refColumn = col === 0 || col === map.width ? null : 0;
|
|
25
|
-
// }
|
|
26
|
-
var rect;
|
|
27
|
-
mainTable.node.descendants(function (tableChildNode, offset) {
|
|
28
|
-
if (requiredGroup(tableChildNode)) {
|
|
29
|
-
var i_1 = -1;
|
|
30
|
-
tableChildNode.firstChild.descendants(function (childNode, pos) {
|
|
31
|
-
if (isTableCell(childNode) || isTableHeaderCell(childNode)) {
|
|
32
|
-
i_1 = i_1 + 1;
|
|
33
|
-
if (i_1 === right || i_1 === left) {
|
|
34
|
-
var selection = new Selection(doc.resolve(pos + offset + mainTable.start), doc.resolve(pos + offset + mainTable.start));
|
|
35
|
-
rect = selectedRect(selection);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
// Do nothing if thead, tfoot or tbody is missing
|
|
42
|
-
if (!rect) {
|
|
43
|
-
return tr;
|
|
44
|
-
}
|
|
45
|
-
for (var row = 0; row < rect.map.height; row++) {
|
|
46
|
-
var index = row * rect.map.width + col;
|
|
47
|
-
// If this position falls inside a col-spanning cell
|
|
48
|
-
if (col > 0 && col < rect.map.width && rect.map.map[index - 1] === rect.map.map[index]) {
|
|
49
|
-
var pos = rect.map.map[index];
|
|
50
|
-
var cell = rect.table.nodeAt(pos);
|
|
51
|
-
tr.setNodeMarkup(tr.mapping.map(rect.tableStart + pos), null, addColSpan(cell.attrs, col - rect.map.colCount(pos)));
|
|
52
|
-
// Skip ahead if rowspan > 1
|
|
53
|
-
row += cell.attrs.rowspan - 1;
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
var type = rect.table.nodeAt(rect.map.map[index + refColumn]).type;
|
|
57
|
-
var pos = rect.map.positionAt(row, col, rect.table);
|
|
58
|
-
tr.insert(tr.mapping.map(rect.tableStart + pos), type.createAndFill());
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return tr;
|
|
62
|
-
};
|
|
63
|
-
var ɵ0 = addTableGroupColumn;
|
|
64
|
-
var removeTableGroupColumn = function (tr, _a, mainTable, requiredGroup, doc) {
|
|
65
|
-
var right = _a.right, left = _a.left;
|
|
66
|
-
var rect;
|
|
67
|
-
mainTable.node.descendants(function (tableChildNode, offset) {
|
|
68
|
-
if (requiredGroup(tableChildNode)) {
|
|
69
|
-
var i_2 = -1;
|
|
70
|
-
tableChildNode.firstChild.descendants(function (childNode, pos) {
|
|
71
|
-
if (isTableCell(childNode) || isTableHeaderCell(childNode)) {
|
|
72
|
-
i_2 = i_2 + 1;
|
|
73
|
-
if (i_2 >= left && i_2 < right) {
|
|
74
|
-
var resolvedPos = doc.resolve(pos + offset + mainTable.start + childNode.nodeSize);
|
|
75
|
-
var selection = new Selection(resolvedPos, resolvedPos);
|
|
76
|
-
rect = selectedRect(selection);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
// Do nothing if thead, tfoot or tbody is missing
|
|
83
|
-
if (!rect) {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
for (var i = rect.right - 1;; i--) {
|
|
87
|
-
removeColumn(tr, rect, i);
|
|
88
|
-
if (i === rect.left) {
|
|
89
|
-
break;
|
|
90
|
-
}
|
|
91
|
-
rect.table = rect.tableStart ? tr.doc.nodeAt(rect.tableStart - 1) : tr.doc;
|
|
92
|
-
rect.map = TableMap.get(rect.table);
|
|
93
|
-
}
|
|
94
|
-
return;
|
|
95
|
-
};
|
|
96
|
-
var ɵ1 = removeTableGroupColumn;
|
|
97
|
-
var removeColumn = function (tr, _a, col) {
|
|
98
|
-
var map = _a.map, table = _a.table, tableStart = _a.tableStart;
|
|
99
|
-
for (var row = 0; row < map.height;) {
|
|
100
|
-
var index = row * map.width + col;
|
|
101
|
-
var pos = map.map[index];
|
|
102
|
-
var cell = table.nodeAt(pos);
|
|
103
|
-
// If this is part of a col-spanning cell
|
|
104
|
-
if ((col > 0 && map.map[index - 1] === pos) || (col < map.width - 1 && map.map[index + 1] === pos)) {
|
|
105
|
-
tr.setNodeMarkup(tr.mapping.map(tableStart + pos), null, removeColSpan(cell.attrs, col - map.colCount(pos)));
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
var start = tr.mapping.map(tableStart + pos);
|
|
109
|
-
tr.delete(start, start + cell.nodeSize);
|
|
110
|
-
}
|
|
111
|
-
row += cell.attrs.rowspan;
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
var ɵ2 = removeColumn;
|
|
115
|
-
/**
|
|
116
|
-
* @hidden
|
|
117
|
-
*/
|
|
118
|
-
// Command to add a column before the column with the selection.
|
|
119
|
-
export var addColumnBefore = function (state, dispatch) {
|
|
120
|
-
if (!isInTable(state)) {
|
|
121
|
-
return false;
|
|
122
|
-
}
|
|
123
|
-
if (dispatch) {
|
|
124
|
-
var rect = selectedRect(state.selection);
|
|
125
|
-
var mainTable = findParentNodeClosestToPos(state.selection.$anchor, isTable);
|
|
126
|
-
var tHeadTr = addTableGroupColumn(state.tr, rect, rect.left, mainTable, isTableHead, state.doc);
|
|
127
|
-
var tBodyTr = addTableGroupColumn(tHeadTr, rect, rect.left, mainTable, isTableBody, state.doc);
|
|
128
|
-
var tFootTr = addTableGroupColumn(tBodyTr, rect, rect.left, mainTable, isTableFoot, state.doc);
|
|
129
|
-
dispatch(tFootTr);
|
|
130
|
-
}
|
|
131
|
-
return true;
|
|
132
|
-
};
|
|
133
|
-
/**
|
|
134
|
-
* @hidden
|
|
135
|
-
*/
|
|
136
|
-
// Command to add a column after the column with the selection.
|
|
137
|
-
export var addColumnAfter = function (state, dispatch) {
|
|
138
|
-
if (!isInTable(state)) {
|
|
139
|
-
return false;
|
|
140
|
-
}
|
|
141
|
-
if (dispatch) {
|
|
142
|
-
var rect = selectedRect(state.selection);
|
|
143
|
-
var mainTable = findParentNodeClosestToPos(state.selection.$anchor, isTable);
|
|
144
|
-
var theadTr = addTableGroupColumn(state.tr, rect, rect.right, mainTable, isTableHead, state.doc);
|
|
145
|
-
var tBodyTr = addTableGroupColumn(theadTr, rect, rect.right, mainTable, isTableBody, state.doc);
|
|
146
|
-
var tFootTr = addTableGroupColumn(tBodyTr, rect, rect.right, mainTable, isTableFoot, state.doc);
|
|
147
|
-
dispatch(tFootTr);
|
|
148
|
-
}
|
|
149
|
-
return true;
|
|
150
|
-
};
|
|
151
|
-
var addRow = function (tr, _a, row) {
|
|
152
|
-
var map = _a.map, tableStart = _a.tableStart, table = _a.table;
|
|
153
|
-
var rowPos = tableStart;
|
|
154
|
-
for (var i = 0; i < row; i++) {
|
|
155
|
-
rowPos += table.child(i).nodeSize;
|
|
156
|
-
}
|
|
157
|
-
var cells = [];
|
|
158
|
-
var refRow = row > 0 ? -1 : 0;
|
|
159
|
-
if (rowIsHeader(map, table, row + refRow)) {
|
|
160
|
-
refRow = row === 0 || row === map.height ? null : 0;
|
|
161
|
-
}
|
|
162
|
-
for (var col = 0, index = map.width * row; col < map.width; col++, index++) {
|
|
163
|
-
// Covered by a rowspan cell
|
|
164
|
-
if (row > 0 && row < map.height && map.map[index] === map.map[index - map.width]) {
|
|
165
|
-
var pos = map.map[index];
|
|
166
|
-
var attrs = table.nodeAt(pos).attrs;
|
|
167
|
-
tr.setNodeMarkup(tableStart + pos, null, setAttr(attrs, 'rowspan', attrs.rowspan + 1));
|
|
168
|
-
col += attrs.colspan - 1;
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
var type = refRow == null ? tableNodeTypes(table.type.schema).cell : table.nodeAt(map.map[index + refRow * map.width]).type;
|
|
172
|
-
cells.push(type.createAndFill());
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
tr.insert(rowPos, tableNodeTypes(table.type.schema).row.create(null, cells));
|
|
176
|
-
return tr;
|
|
177
|
-
};
|
|
178
|
-
var ɵ3 = addRow;
|
|
179
|
-
/**
|
|
180
|
-
* @hidden
|
|
181
|
-
*/
|
|
182
|
-
// Add a table row before the selection.
|
|
183
|
-
export var addRowBefore = function (state, dispatch) {
|
|
184
|
-
if (!isInTable(state)) {
|
|
185
|
-
return false;
|
|
186
|
-
}
|
|
187
|
-
if (dispatch) {
|
|
188
|
-
var rect = selectedRect(state.selection);
|
|
189
|
-
dispatch(addRow(state.tr, rect, rect.top));
|
|
190
|
-
}
|
|
191
|
-
return true;
|
|
192
|
-
};
|
|
193
|
-
/**
|
|
194
|
-
* @hidden
|
|
195
|
-
*/
|
|
196
|
-
// Add a table row after the selection.
|
|
197
|
-
export var addRowAfter = function (state, dispatch) {
|
|
198
|
-
if (!isInTable(state)) {
|
|
199
|
-
return false;
|
|
200
|
-
}
|
|
201
|
-
if (dispatch) {
|
|
202
|
-
var rect = selectedRect(state.selection);
|
|
203
|
-
dispatch(addRow(state.tr, rect, rect.bottom));
|
|
204
|
-
}
|
|
205
|
-
return true;
|
|
206
|
-
};
|
|
207
|
-
/**
|
|
208
|
-
* @hidden
|
|
209
|
-
*/
|
|
210
|
-
// Command function that removes the selected columns from a table.
|
|
211
|
-
export var deleteColumn = function (state, dispatch) {
|
|
212
|
-
if (!isInTable(state)) {
|
|
213
|
-
return false;
|
|
214
|
-
}
|
|
215
|
-
if (dispatch) {
|
|
216
|
-
var rect = selectedRect(state.selection);
|
|
217
|
-
// if only one column left - delete the whole table
|
|
218
|
-
if (rect.left === 0 && rect.right === rect.map.width) {
|
|
219
|
-
return deleteTable(state, dispatch);
|
|
220
|
-
}
|
|
221
|
-
var mainTable = findParentNodeClosestToPos(state.selection.$anchor, isTable);
|
|
222
|
-
var tr = state.tr;
|
|
223
|
-
removeTableGroupColumn(tr, rect, mainTable, isTableFoot, tr.doc);
|
|
224
|
-
removeTableGroupColumn(tr, rect, mainTable, isTableBody, tr.doc);
|
|
225
|
-
removeTableGroupColumn(tr, rect, mainTable, isTableHead, tr.doc);
|
|
226
|
-
dispatch(tr);
|
|
227
|
-
}
|
|
228
|
-
return true;
|
|
229
|
-
};
|
|
230
|
-
var removeRow = function (tr, _a, row) {
|
|
231
|
-
var map = _a.map, table = _a.table, tableStart = _a.tableStart;
|
|
232
|
-
var rowPos = 0;
|
|
233
|
-
for (var i = 0; i < row; i++) {
|
|
234
|
-
rowPos += table.child(i).nodeSize;
|
|
235
|
-
}
|
|
236
|
-
var nextRow = rowPos + table.child(row).nodeSize;
|
|
237
|
-
var mapFrom = tr.mapping.maps.length;
|
|
238
|
-
tr.delete(rowPos + tableStart, nextRow + tableStart);
|
|
239
|
-
for (var col = 0, index = row * map.width; col < map.width; col++, index++) {
|
|
240
|
-
var pos = map.map[index];
|
|
241
|
-
if (row > 0 && pos === map.map[index - map.width]) {
|
|
242
|
-
// If this cell starts in the row above, simply reduce its rowspan
|
|
243
|
-
var attrs = table.nodeAt(pos).attrs;
|
|
244
|
-
tr.setNodeMarkup(tr.mapping.slice(mapFrom).map(pos + tableStart), null, setAttr(attrs, 'rowspan', attrs.rowspan - 1));
|
|
245
|
-
col += attrs.colspan - 1;
|
|
246
|
-
}
|
|
247
|
-
else if (row < map.width && pos === map.map[index + map.width]) {
|
|
248
|
-
// Else, if it continues in the row below, it has to be moved down
|
|
249
|
-
var cell = table.nodeAt(pos);
|
|
250
|
-
var copy = cell.type.create(setAttr(cell.attrs, 'rowspan', cell.attrs.rowspan - 1), cell.content);
|
|
251
|
-
var newPos = map.positionAt(row + 1, col, table);
|
|
252
|
-
tr.insert(tr.mapping.slice(mapFrom).map(tableStart + newPos), copy);
|
|
253
|
-
col += cell.attrs.colspan - 1;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
};
|
|
257
|
-
var ɵ4 = removeRow;
|
|
258
|
-
/**
|
|
259
|
-
* @hidden
|
|
260
|
-
*/
|
|
261
|
-
// Remove the selected rows from a table.
|
|
262
|
-
export var deleteRow = function (state, dispatch) {
|
|
263
|
-
if (!isInTable(state)) {
|
|
264
|
-
return false;
|
|
265
|
-
}
|
|
266
|
-
if (dispatch) {
|
|
267
|
-
var rect_1 = selectedRect(state.selection);
|
|
268
|
-
var tr = state.tr;
|
|
269
|
-
if (rect_1.top === 0 && rect_1.bottom === rect_1.map.height) {
|
|
270
|
-
var mainTable = findParentNodeClosestToPos(state.selection.$anchor, isTable);
|
|
271
|
-
if (mainTable.node.childCount === 1) {
|
|
272
|
-
deleteTable(state, dispatch);
|
|
273
|
-
}
|
|
274
|
-
else {
|
|
275
|
-
deleteTableElement(function (n) { return n.type.name === rect_1.table.type.name; })(state, dispatch);
|
|
276
|
-
}
|
|
277
|
-
return true;
|
|
278
|
-
}
|
|
279
|
-
for (var i = rect_1.bottom - 1;; i--) {
|
|
280
|
-
removeRow(tr, rect_1, i);
|
|
281
|
-
if (i === rect_1.top) {
|
|
282
|
-
break;
|
|
283
|
-
}
|
|
284
|
-
rect_1.table = rect_1.tableStart ? tr.doc.nodeAt(rect_1.tableStart - 1) : tr.doc;
|
|
285
|
-
rect_1.map = TableMap.get(rect_1.table);
|
|
286
|
-
}
|
|
287
|
-
dispatch(tr);
|
|
288
|
-
}
|
|
289
|
-
return true;
|
|
290
|
-
};
|
|
291
|
-
/**
|
|
292
|
-
* @hidden
|
|
293
|
-
*/
|
|
294
|
-
// Merge the selected cells into a single cell. Only available when
|
|
295
|
-
// the selected cells' outline forms a rectangle.
|
|
296
|
-
export var mergeCells = function (state, dispatch) {
|
|
297
|
-
var sel = state.selection;
|
|
298
|
-
if (!(sel instanceof CellSelection) || sel.$anchorCell.pos === sel.$headCell.pos) {
|
|
299
|
-
return false;
|
|
300
|
-
}
|
|
301
|
-
var rect = selectedRect(state.selection);
|
|
302
|
-
var map = rect.map;
|
|
303
|
-
if (cellsOverlapRectangle(map, rect)) {
|
|
304
|
-
return false;
|
|
305
|
-
}
|
|
306
|
-
if (dispatch) {
|
|
307
|
-
var tr = state.tr;
|
|
308
|
-
var seen = {};
|
|
309
|
-
var content = Fragment.empty;
|
|
310
|
-
var mergedPos = void 0;
|
|
311
|
-
var mergedCell = void 0;
|
|
312
|
-
for (var row = rect.top; row < rect.bottom; row++) {
|
|
313
|
-
for (var col = rect.left; col < rect.right; col++) {
|
|
314
|
-
var cellPos = map.map[row * map.width + col], cell = rect.table.nodeAt(cellPos);
|
|
315
|
-
if (seen[cellPos]) {
|
|
316
|
-
continue;
|
|
317
|
-
}
|
|
318
|
-
seen[cellPos] = true;
|
|
319
|
-
if (mergedPos === null) {
|
|
320
|
-
mergedPos = cellPos;
|
|
321
|
-
mergedCell = cell;
|
|
322
|
-
}
|
|
323
|
-
else {
|
|
324
|
-
if (!isCellEmpty(cell)) {
|
|
325
|
-
content = content.append(cell.content);
|
|
326
|
-
}
|
|
327
|
-
var mapped = tr.mapping.map(cellPos + rect.tableStart);
|
|
328
|
-
tr.delete(mapped, mapped + cell.nodeSize);
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
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));
|
|
333
|
-
if (content.size) {
|
|
334
|
-
var end = mergedPos + 1 + mergedCell.content.size;
|
|
335
|
-
var start = isCellEmpty(mergedCell) ? mergedPos + 1 : end;
|
|
336
|
-
tr.replaceWith(start + rect.tableStart, end + rect.tableStart, content);
|
|
337
|
-
}
|
|
338
|
-
tr.setSelection(new CellSelection(tr.doc.resolve(mergedPos + rect.tableStart)));
|
|
339
|
-
dispatch(tr);
|
|
340
|
-
}
|
|
341
|
-
return true;
|
|
342
|
-
};
|
|
343
|
-
/**
|
|
344
|
-
* @hidden
|
|
345
|
-
*/
|
|
346
|
-
// Split a selected cell, whose rowpan or colspan is greater than one,
|
|
347
|
-
// into smaller cells. Use the first cell type for the new cells.
|
|
348
|
-
export var splitCell = function (state, dispatch) {
|
|
349
|
-
var nodeTypes = tableNodeTypes(state.schema);
|
|
350
|
-
return splitCellWithType(function (_a) {
|
|
351
|
-
var node = _a.node;
|
|
352
|
-
return nodeTypes[node.type.spec.tableRole];
|
|
353
|
-
})(state, dispatch);
|
|
354
|
-
};
|
|
355
|
-
var deleteTableElement = function (selector) { return function (state, dispatch) {
|
|
356
|
-
var $pos = state.selection.$anchor;
|
|
357
|
-
for (var d = $pos.depth; d > 0; d--) {
|
|
358
|
-
var node = $pos.node(d);
|
|
359
|
-
if (selector(node)) {
|
|
360
|
-
if (dispatch) {
|
|
361
|
-
var tr = state.tr;
|
|
362
|
-
tr.delete($pos.before(d), $pos.after(d)).scrollIntoView();
|
|
363
|
-
dispatch(tr);
|
|
364
|
-
}
|
|
365
|
-
return true;
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
return false;
|
|
369
|
-
}; };
|
|
370
|
-
var ɵ5 = deleteTableElement;
|
|
371
|
-
/**
|
|
372
|
-
* @hidden
|
|
373
|
-
*/
|
|
374
|
-
// Deletes the table around the selection, if any.
|
|
375
|
-
export var deleteTable = deleteTableElement(isTable);
|
|
376
|
-
export { ɵ0, ɵ1, ɵ2, ɵ3, ɵ4, ɵ5 };
|
|
@@ -59,7 +59,7 @@ var ColorPickerDialogComponent = /** @class */ (function (_super) {
|
|
|
59
59
|
], ColorPickerDialogComponent.prototype, "colorPicker", void 0);
|
|
60
60
|
ColorPickerDialogComponent = tslib_1.__decorate([
|
|
61
61
|
Component({
|
|
62
|
-
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 [
|
|
62
|
+
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 "
|
|
63
63
|
}),
|
|
64
64
|
tslib_1.__metadata("design:paramtypes", [DialogRef,
|
|
65
65
|
EditorLocalizationService])
|
|
@@ -117,7 +117,7 @@ var FileLinkDialogComponent = /** @class */ (function (_super) {
|
|
|
117
117
|
], FileLinkDialogComponent.prototype, "hrefInput", void 0);
|
|
118
118
|
FileLinkDialogComponent = tslib_1.__decorate([
|
|
119
119
|
Component({
|
|
120
|
-
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\"
|
|
120
|
+
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 "
|
|
121
121
|
}),
|
|
122
122
|
tslib_1.__metadata("design:paramtypes", [DialogRef, EditorLocalizationService])
|
|
123
123
|
], FileLinkDialogComponent);
|
|
@@ -92,7 +92,7 @@ var ImageDialogComponent = /** @class */ (function (_super) {
|
|
|
92
92
|
], ImageDialogComponent.prototype, "srcInput", void 0);
|
|
93
93
|
ImageDialogComponent = tslib_1.__decorate([
|
|
94
94
|
Component({
|
|
95
|
-
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 "
|
|
95
|
+
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 "
|
|
96
96
|
}),
|
|
97
97
|
tslib_1.__metadata("design:paramtypes", [DialogRef,
|
|
98
98
|
EditorLocalizationService])
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { cleanFormatting } from '@progress/kendo-editor-common';
|
|
5
|
+
import { blockquote, cleanFormatting, isIndented } from '@progress/kendo-editor-common';
|
|
6
6
|
import { alignRightRules, alignCenterRules, alignLeftRules, alignJustifyRules, isAligned, bold, italic, underline, strikethrough, subscript, superscript, link, activeNode, hasNode, getActiveMarks, hasMark, expandSelection, indentRules, outdentRules, canIndentAsListItem, canOutdentAsListItem, canBeIndented, undo, redo, addRowBefore, addRowAfter, addColumnBefore, addColumnAfter, deleteRow, deleteColumn, deleteTable, mergeCells, splitCell } from '@progress/kendo-editor-common';
|
|
7
7
|
/**
|
|
8
8
|
* @hidden
|
|
@@ -36,6 +36,10 @@ export var getToolbarState = function (state, options) { return ({
|
|
|
36
36
|
selected: activeNode(state),
|
|
37
37
|
disabled: false
|
|
38
38
|
},
|
|
39
|
+
blockquote: {
|
|
40
|
+
selected: false,
|
|
41
|
+
disabled: !blockquote(state)
|
|
42
|
+
},
|
|
39
43
|
indent: {
|
|
40
44
|
selected: false,
|
|
41
45
|
disabled: !(canIndentAsListItem(state, state.schema.nodes.list_item) || canBeIndented(state, indentRules))
|
|
@@ -58,7 +62,11 @@ export var getToolbarState = function (state, options) { return ({
|
|
|
58
62
|
},
|
|
59
63
|
outdent: {
|
|
60
64
|
selected: false,
|
|
61
|
-
disabled
|
|
65
|
+
get disabled() {
|
|
66
|
+
return !(hasNode(state, state.schema.nodes.blockquote) ||
|
|
67
|
+
canOutdentAsListItem(state, outdentRules) ||
|
|
68
|
+
isIndented(state, outdentRules.nodes));
|
|
69
|
+
}
|
|
62
70
|
},
|
|
63
71
|
redo: {
|
|
64
72
|
selected: false,
|
|
@@ -184,6 +192,7 @@ export var initialToolBarState = {
|
|
|
184
192
|
format: { selected: { text: 'Format', tag: null }, disabled: false },
|
|
185
193
|
style: { selected: { marks: [], hasNodesWithoutMarks: false }, disabled: false },
|
|
186
194
|
cleanFormatting: { selected: false, disabled: true },
|
|
195
|
+
blockquote: { selected: false, disabled: false },
|
|
187
196
|
//indent
|
|
188
197
|
indent: { selected: false, disabled: false },
|
|
189
198
|
outdent: { selected: false, disabled: false },
|
|
@@ -236,6 +245,7 @@ export var disabledToolBarState = {
|
|
|
236
245
|
format: { selected: { text: 'Format', tag: null }, disabled: true },
|
|
237
246
|
style: { selected: { marks: [], hasNodesWithoutMarks: false }, disabled: true },
|
|
238
247
|
cleanFormatting: { selected: false, disabled: true },
|
|
248
|
+
blockquote: { selected: false, disabled: true },
|
|
239
249
|
//indent
|
|
240
250
|
indent: { selected: false, disabled: true },
|
|
241
251
|
outdent: { selected: false, disabled: true },
|