@progress/kendo-editor-common 1.9.7-dev.202306221639 → 1.10.0-dev.202307170654
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/dist/cdn/js/kendo-editor-common.js +1 -1
- package/dist/cdn/main.js +1 -1
- package/dist/es/config/schema.js +26 -1
- package/dist/es/main.js +1 -1
- package/dist/es/source.js +40 -1
- package/dist/es/table.js +6 -4
- package/dist/es2015/config/schema.js +26 -1
- package/dist/es2015/main.js +1 -1
- package/dist/es2015/source.js +40 -1
- package/dist/es2015/table.js +7 -5
- package/dist/npm/config/schema.js +26 -1
- package/dist/npm/main.d.ts +1 -1
- package/dist/npm/main.js +4 -3
- package/dist/npm/source.js +40 -1
- package/dist/npm/table.js +6 -4
- package/dist/systemjs/kendo-editor-common.js +1 -1
- package/package.json +2 -2
package/dist/es/config/schema.js
CHANGED
|
@@ -83,7 +83,7 @@ var cellAttribute = function (name) {
|
|
|
83
83
|
},
|
|
84
84
|
_a;
|
|
85
85
|
};
|
|
86
|
-
var cellAttributes = __assign(__assign(__assign(__assign({}, cellAttribute('style')), cellAttribute('class')), cellAttribute('id')), cellAttribute('headers'));
|
|
86
|
+
var cellAttributes = __assign(__assign(__assign(__assign(__assign({}, cellAttribute('style')), cellAttribute('class')), cellAttribute('id')), cellAttribute('headers')), cellAttribute('scope'));
|
|
87
87
|
var colgroupNodes = {
|
|
88
88
|
doc: { content: 'colgroup*' },
|
|
89
89
|
col: {
|
|
@@ -167,6 +167,31 @@ var nodes = __assign({
|
|
|
167
167
|
getAttrs: domAttributes
|
|
168
168
|
}],
|
|
169
169
|
toDOM: function (node) { return hasAttrs(node.attrs) ? ['p', pmAttributes(node.attrs), hole] : ['p', hole]; }
|
|
170
|
+
}, table_wrapper: {
|
|
171
|
+
content: '(table_caption_external | table)+',
|
|
172
|
+
group: 'block',
|
|
173
|
+
defining: true,
|
|
174
|
+
attrs: {
|
|
175
|
+
table: { default: null },
|
|
176
|
+
style: { default: null }
|
|
177
|
+
},
|
|
178
|
+
parseDOM: [{
|
|
179
|
+
tag: 'div[table]',
|
|
180
|
+
getAttrs: domAttributes
|
|
181
|
+
}],
|
|
182
|
+
toDOM: function (node) { return hasAttrs(node.attrs) ? ['div', pmAttributes(node.attrs), hole] : ['div', hole]; }
|
|
183
|
+
}, table_caption_external: {
|
|
184
|
+
content: 'inline+',
|
|
185
|
+
group: 'block',
|
|
186
|
+
attrs: {
|
|
187
|
+
caption: { default: null },
|
|
188
|
+
style: { default: null }
|
|
189
|
+
},
|
|
190
|
+
parseDOM: [{
|
|
191
|
+
tag: 'div[caption]',
|
|
192
|
+
getAttrs: domAttributes
|
|
193
|
+
}],
|
|
194
|
+
toDOM: function (node) { return hasAttrs(node.attrs) ? ['div', pmAttributes(node.attrs), hole] : ['div', hole]; }
|
|
170
195
|
}, div: {
|
|
171
196
|
// Uncaught SyntaxError: Mixing inline and block content (in content expression '(block | inline)*')
|
|
172
197
|
// content: '(block | inline)*',
|
package/dist/es/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { getHtml, setHtml, parseContent, trimWhitespace, htmlToFragment, domToPmDoc, pmDocToFragment } from './source';
|
|
1
|
+
export { getHtml, setHtml, parseContent, trimWhitespace, htmlToFragment, domToPmDoc, pmDocToFragment, fragmentToHtml } from './source';
|
|
2
2
|
export { applyInlineStyle, getInlineStyles, toggleInlineFormat } from './inline-style';
|
|
3
3
|
export { applyLink, removeLink } from './link';
|
|
4
4
|
export { insertText } from './text';
|
package/dist/es/source.js
CHANGED
|
@@ -2,7 +2,7 @@ import { DOMSerializer, DOMParser as ProseMirrorDOMParser } from 'prosemirror-mo
|
|
|
2
2
|
import { AllSelection } from 'prosemirror-state';
|
|
3
3
|
import { rowTypeAttr, colgroupAttr } from './config/constants';
|
|
4
4
|
var blockWrappers = [
|
|
5
|
-
'div', 'ol', 'ul', 'li', 'table', 'tbody', 'thead', 'tfoot', 'td', 'th', 'p',
|
|
5
|
+
'div', 'ol', 'ul', 'li', 'table', 'tbody', 'thead', 'tfoot', 'caption', 'td', 'th', 'p',
|
|
6
6
|
'tr', 'col', 'colgroup', 'article', 'main', 'nav', 'header', 'footer', 'aside', 'section'
|
|
7
7
|
];
|
|
8
8
|
var removeRowType = function (table, nodeName) {
|
|
@@ -24,6 +24,23 @@ var restoreTables = function (fragment) {
|
|
|
24
24
|
if (emptyElement) {
|
|
25
25
|
emptyElement.remove();
|
|
26
26
|
}
|
|
27
|
+
var wrapper = table.parentNode instanceof HTMLDivElement ? table.parentNode : null;
|
|
28
|
+
if (wrapper && wrapper.matches('div[table]')) {
|
|
29
|
+
table.style.marginLeft = wrapper.style.marginLeft;
|
|
30
|
+
table.style.marginRight = wrapper.style.marginRight;
|
|
31
|
+
var captionDiv = Array.from(wrapper.children).find(function (el) { return el.matches('div[caption]'); });
|
|
32
|
+
if (captionDiv) {
|
|
33
|
+
var caption = table.createCaption();
|
|
34
|
+
caption.style.textAlign = captionDiv.style.textAlign;
|
|
35
|
+
caption.style.verticalAlign = captionDiv.style.verticalAlign;
|
|
36
|
+
caption.style.captionSide = captionDiv.style.captionSide;
|
|
37
|
+
while (captionDiv.firstChild) {
|
|
38
|
+
caption.appendChild(captionDiv.firstChild);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
wrapper.parentNode.insertBefore(table, wrapper);
|
|
42
|
+
wrapper.parentNode.removeChild(wrapper);
|
|
43
|
+
}
|
|
27
44
|
});
|
|
28
45
|
};
|
|
29
46
|
var setRowType = function (children, nodeName) {
|
|
@@ -51,6 +68,28 @@ var validateTablesToPmSchema = function (fragment) {
|
|
|
51
68
|
table.setAttribute(colgroupAttr, colgroup.outerHTML);
|
|
52
69
|
colgroup.remove();
|
|
53
70
|
}
|
|
71
|
+
if (table.caption || table.style.marginLeft || table.style.marginRight) {
|
|
72
|
+
var wrapper = document.createElement('div');
|
|
73
|
+
wrapper.setAttribute('table', '');
|
|
74
|
+
wrapper.style.display = 'table';
|
|
75
|
+
wrapper.style.marginLeft = table.style.marginLeft;
|
|
76
|
+
wrapper.style.marginRight = table.style.marginRight;
|
|
77
|
+
if (table.caption) {
|
|
78
|
+
var captionDiv = document.createElement('div');
|
|
79
|
+
captionDiv.setAttribute('caption', '');
|
|
80
|
+
captionDiv.style.display = 'table-caption';
|
|
81
|
+
captionDiv.style.textAlign = table.caption.style.textAlign;
|
|
82
|
+
captionDiv.style.verticalAlign = table.caption.style.verticalAlign;
|
|
83
|
+
captionDiv.style.captionSide = table.caption.style.captionSide;
|
|
84
|
+
while (table.caption.firstChild) {
|
|
85
|
+
captionDiv.appendChild(table.caption.firstChild);
|
|
86
|
+
}
|
|
87
|
+
table.removeChild(table.caption);
|
|
88
|
+
wrapper.appendChild(captionDiv);
|
|
89
|
+
}
|
|
90
|
+
table.parentNode.insertBefore(wrapper, table);
|
|
91
|
+
wrapper.appendChild(table);
|
|
92
|
+
}
|
|
54
93
|
});
|
|
55
94
|
};
|
|
56
95
|
/**
|
package/dist/es/table.js
CHANGED
|
@@ -117,13 +117,15 @@ export var addColumnAfter = function (state, dispatch) {
|
|
|
117
117
|
return pmAddColumnAfter(state, cmdDispatch);
|
|
118
118
|
};
|
|
119
119
|
export var deleteColumn = function (state, dispatch) {
|
|
120
|
-
var
|
|
120
|
+
var parentTable = closest(state.selection, reTable);
|
|
121
|
+
var colgroup = parentTable && parentTable.node.attrs[colgroupAttr];
|
|
122
|
+
var colIndex = columnIndex(parentTable, state.selection);
|
|
121
123
|
var cmdDispatch = dispatch && (function (tr) {
|
|
122
|
-
|
|
123
|
-
if (!table.node.attrs[colgroupAttr]) {
|
|
124
|
+
if (!colgroup) {
|
|
124
125
|
return dispatch(tr);
|
|
125
126
|
}
|
|
126
|
-
|
|
127
|
+
var table = tr.doc.nodeAt(parentTable.pos);
|
|
128
|
+
deleteCol(tr, { node: table, pos: parentTable.pos }, colIndex);
|
|
127
129
|
return dispatch(tr);
|
|
128
130
|
});
|
|
129
131
|
return pmDeleteColumn(state, cmdDispatch);
|
|
@@ -76,7 +76,7 @@ const cellAttribute = (name) => {
|
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
78
|
};
|
|
79
|
-
const cellAttributes = Object.assign(Object.assign(Object.assign(Object.assign({}, cellAttribute('style')), cellAttribute('class')), cellAttribute('id')), cellAttribute('headers'));
|
|
79
|
+
const cellAttributes = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, cellAttribute('style')), cellAttribute('class')), cellAttribute('id')), cellAttribute('headers')), cellAttribute('scope'));
|
|
80
80
|
const colgroupNodes = {
|
|
81
81
|
doc: { content: 'colgroup*' },
|
|
82
82
|
col: {
|
|
@@ -160,6 +160,31 @@ const nodes = Object.assign({
|
|
|
160
160
|
getAttrs: domAttributes
|
|
161
161
|
}],
|
|
162
162
|
toDOM: node => hasAttrs(node.attrs) ? ['p', pmAttributes(node.attrs), hole] : ['p', hole]
|
|
163
|
+
}, table_wrapper: {
|
|
164
|
+
content: '(table_caption_external | table)+',
|
|
165
|
+
group: 'block',
|
|
166
|
+
defining: true,
|
|
167
|
+
attrs: {
|
|
168
|
+
table: { default: null },
|
|
169
|
+
style: { default: null }
|
|
170
|
+
},
|
|
171
|
+
parseDOM: [{
|
|
172
|
+
tag: 'div[table]',
|
|
173
|
+
getAttrs: domAttributes
|
|
174
|
+
}],
|
|
175
|
+
toDOM: node => hasAttrs(node.attrs) ? ['div', pmAttributes(node.attrs), hole] : ['div', hole]
|
|
176
|
+
}, table_caption_external: {
|
|
177
|
+
content: 'inline+',
|
|
178
|
+
group: 'block',
|
|
179
|
+
attrs: {
|
|
180
|
+
caption: { default: null },
|
|
181
|
+
style: { default: null }
|
|
182
|
+
},
|
|
183
|
+
parseDOM: [{
|
|
184
|
+
tag: 'div[caption]',
|
|
185
|
+
getAttrs: domAttributes
|
|
186
|
+
}],
|
|
187
|
+
toDOM: node => hasAttrs(node.attrs) ? ['div', pmAttributes(node.attrs), hole] : ['div', hole]
|
|
163
188
|
}, div: {
|
|
164
189
|
// Uncaught SyntaxError: Mixing inline and block content (in content expression '(block | inline)*')
|
|
165
190
|
// content: '(block | inline)*',
|
package/dist/es2015/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { getHtml, setHtml, parseContent, trimWhitespace, htmlToFragment, domToPmDoc, pmDocToFragment } from './source';
|
|
1
|
+
export { getHtml, setHtml, parseContent, trimWhitespace, htmlToFragment, domToPmDoc, pmDocToFragment, fragmentToHtml } from './source';
|
|
2
2
|
export { applyInlineStyle, getInlineStyles, toggleInlineFormat } from './inline-style';
|
|
3
3
|
export { applyLink, removeLink } from './link';
|
|
4
4
|
export { insertText } from './text';
|
package/dist/es2015/source.js
CHANGED
|
@@ -2,7 +2,7 @@ import { DOMSerializer, DOMParser as ProseMirrorDOMParser } from 'prosemirror-mo
|
|
|
2
2
|
import { AllSelection } from 'prosemirror-state';
|
|
3
3
|
import { rowTypeAttr, colgroupAttr } from './config/constants';
|
|
4
4
|
const blockWrappers = [
|
|
5
|
-
'div', 'ol', 'ul', 'li', 'table', 'tbody', 'thead', 'tfoot', 'td', 'th', 'p',
|
|
5
|
+
'div', 'ol', 'ul', 'li', 'table', 'tbody', 'thead', 'tfoot', 'caption', 'td', 'th', 'p',
|
|
6
6
|
'tr', 'col', 'colgroup', 'article', 'main', 'nav', 'header', 'footer', 'aside', 'section'
|
|
7
7
|
];
|
|
8
8
|
const removeRowType = (table, nodeName) => {
|
|
@@ -24,6 +24,23 @@ const restoreTables = (fragment) => {
|
|
|
24
24
|
if (emptyElement) {
|
|
25
25
|
emptyElement.remove();
|
|
26
26
|
}
|
|
27
|
+
const wrapper = table.parentNode instanceof HTMLDivElement ? table.parentNode : null;
|
|
28
|
+
if (wrapper && wrapper.matches('div[table]')) {
|
|
29
|
+
table.style.marginLeft = wrapper.style.marginLeft;
|
|
30
|
+
table.style.marginRight = wrapper.style.marginRight;
|
|
31
|
+
const captionDiv = Array.from(wrapper.children).find(el => el.matches('div[caption]'));
|
|
32
|
+
if (captionDiv) {
|
|
33
|
+
const caption = table.createCaption();
|
|
34
|
+
caption.style.textAlign = captionDiv.style.textAlign;
|
|
35
|
+
caption.style.verticalAlign = captionDiv.style.verticalAlign;
|
|
36
|
+
caption.style.captionSide = captionDiv.style.captionSide;
|
|
37
|
+
while (captionDiv.firstChild) {
|
|
38
|
+
caption.appendChild(captionDiv.firstChild);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
wrapper.parentNode.insertBefore(table, wrapper);
|
|
42
|
+
wrapper.parentNode.removeChild(wrapper);
|
|
43
|
+
}
|
|
27
44
|
});
|
|
28
45
|
};
|
|
29
46
|
const setRowType = (children, nodeName) => {
|
|
@@ -51,6 +68,28 @@ const validateTablesToPmSchema = (fragment) => {
|
|
|
51
68
|
table.setAttribute(colgroupAttr, colgroup.outerHTML);
|
|
52
69
|
colgroup.remove();
|
|
53
70
|
}
|
|
71
|
+
if (table.caption || table.style.marginLeft || table.style.marginRight) {
|
|
72
|
+
const wrapper = document.createElement('div');
|
|
73
|
+
wrapper.setAttribute('table', '');
|
|
74
|
+
wrapper.style.display = 'table';
|
|
75
|
+
wrapper.style.marginLeft = table.style.marginLeft;
|
|
76
|
+
wrapper.style.marginRight = table.style.marginRight;
|
|
77
|
+
if (table.caption) {
|
|
78
|
+
const captionDiv = document.createElement('div');
|
|
79
|
+
captionDiv.setAttribute('caption', '');
|
|
80
|
+
captionDiv.style.display = 'table-caption';
|
|
81
|
+
captionDiv.style.textAlign = table.caption.style.textAlign;
|
|
82
|
+
captionDiv.style.verticalAlign = table.caption.style.verticalAlign;
|
|
83
|
+
captionDiv.style.captionSide = table.caption.style.captionSide;
|
|
84
|
+
while (table.caption.firstChild) {
|
|
85
|
+
captionDiv.appendChild(table.caption.firstChild);
|
|
86
|
+
}
|
|
87
|
+
table.removeChild(table.caption);
|
|
88
|
+
wrapper.appendChild(captionDiv);
|
|
89
|
+
}
|
|
90
|
+
table.parentNode.insertBefore(wrapper, table);
|
|
91
|
+
wrapper.appendChild(table);
|
|
92
|
+
}
|
|
54
93
|
});
|
|
55
94
|
};
|
|
56
95
|
/**
|
package/dist/es2015/table.js
CHANGED
|
@@ -112,13 +112,15 @@ export const addColumnAfter = (state, dispatch) => {
|
|
|
112
112
|
return pmAddColumnAfter(state, cmdDispatch);
|
|
113
113
|
};
|
|
114
114
|
export const deleteColumn = (state, dispatch) => {
|
|
115
|
-
const
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
const parentTable = closest(state.selection, reTable);
|
|
116
|
+
const colgroup = parentTable && parentTable.node.attrs[colgroupAttr];
|
|
117
|
+
const colIndex = columnIndex(parentTable, state.selection);
|
|
118
|
+
const cmdDispatch = dispatch && ((tr) => {
|
|
119
|
+
if (!colgroup) {
|
|
119
120
|
return dispatch(tr);
|
|
120
121
|
}
|
|
121
|
-
|
|
122
|
+
const table = tr.doc.nodeAt(parentTable.pos);
|
|
123
|
+
deleteCol(tr, { node: table, pos: parentTable.pos }, colIndex);
|
|
122
124
|
return dispatch(tr);
|
|
123
125
|
});
|
|
124
126
|
return pmDeleteColumn(state, cmdDispatch);
|
|
@@ -87,7 +87,7 @@ var cellAttribute = function (name) {
|
|
|
87
87
|
},
|
|
88
88
|
_a;
|
|
89
89
|
};
|
|
90
|
-
var cellAttributes = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, cellAttribute('style')), cellAttribute('class')), cellAttribute('id')), cellAttribute('headers'));
|
|
90
|
+
var cellAttributes = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, cellAttribute('style')), cellAttribute('class')), cellAttribute('id')), cellAttribute('headers')), cellAttribute('scope'));
|
|
91
91
|
var colgroupNodes = {
|
|
92
92
|
doc: { content: 'colgroup*' },
|
|
93
93
|
col: {
|
|
@@ -172,6 +172,31 @@ var nodes = tslib_1.__assign({
|
|
|
172
172
|
getAttrs: domAttributes
|
|
173
173
|
}],
|
|
174
174
|
toDOM: function (node) { return hasAttrs(node.attrs) ? ['p', pmAttributes(node.attrs), hole] : ['p', hole]; }
|
|
175
|
+
}, table_wrapper: {
|
|
176
|
+
content: '(table_caption_external | table)+',
|
|
177
|
+
group: 'block',
|
|
178
|
+
defining: true,
|
|
179
|
+
attrs: {
|
|
180
|
+
table: { default: null },
|
|
181
|
+
style: { default: null }
|
|
182
|
+
},
|
|
183
|
+
parseDOM: [{
|
|
184
|
+
tag: 'div[table]',
|
|
185
|
+
getAttrs: domAttributes
|
|
186
|
+
}],
|
|
187
|
+
toDOM: function (node) { return hasAttrs(node.attrs) ? ['div', pmAttributes(node.attrs), hole] : ['div', hole]; }
|
|
188
|
+
}, table_caption_external: {
|
|
189
|
+
content: 'inline+',
|
|
190
|
+
group: 'block',
|
|
191
|
+
attrs: {
|
|
192
|
+
caption: { default: null },
|
|
193
|
+
style: { default: null }
|
|
194
|
+
},
|
|
195
|
+
parseDOM: [{
|
|
196
|
+
tag: 'div[caption]',
|
|
197
|
+
getAttrs: domAttributes
|
|
198
|
+
}],
|
|
199
|
+
toDOM: function (node) { return hasAttrs(node.attrs) ? ['div', pmAttributes(node.attrs), hole] : ['div', hole]; }
|
|
175
200
|
}, div: {
|
|
176
201
|
// Uncaught SyntaxError: Mixing inline and block content (in content expression '(block | inline)*')
|
|
177
202
|
// content: '(block | inline)*',
|
package/dist/npm/main.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { getHtml, setHtml, parseContent, trimWhitespace, htmlToFragment, domToPmDoc, pmDocToFragment } from './source';
|
|
1
|
+
export { getHtml, setHtml, parseContent, trimWhitespace, htmlToFragment, domToPmDoc, pmDocToFragment, fragmentToHtml } from './source';
|
|
2
2
|
export { applyInlineStyle, getInlineStyles, toggleInlineFormat } from './inline-style';
|
|
3
3
|
export { applyLink, removeLink } from './link';
|
|
4
4
|
export { insertText } from './text';
|
package/dist/npm/main.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.pmDeleteColumn = exports.pmAddRowBefore = exports.pmAddRowAfter = exports.pmAddColumnAfter = exports.pmAddColumnBefore = exports.deleteColumn = exports.addColumnAfter = exports.addColumnBefore = exports.addRowBefore = exports.addRowAfter = exports.createTable = exports.nextCell = exports.moveCellForward = exports.removeColSpan = exports.findCell = exports.cellAround = exports.updateColumnsOnResize = exports.columnResizingPluginKey = exports.columnResizing = exports.columnIsHeader = exports.colCount = exports.addColumn = exports.addColSpan = exports.addRow = exports.rowIsHeader = exports.deleteRow = exports.mergeCells = exports.splitCellWithType = exports.splitCell = exports.toggleHeaderRow = exports.toggleHeaderColumn = exports.toggleHeaderCell = exports.toggleHeader = exports.goToNextCell = exports.setCellAttr = exports.selectionCell = exports.selectedRect = exports.CellSelection = exports.inSameTable = exports.deleteTable = exports.isInTable = exports.fixTablesKey = exports.fixTables = exports.tableNodes = exports.tableNodeTypes = void 0;
|
|
3
|
+
exports.expandSelection = exports.selectedLineTextOnly = exports.getNodeFromSelection = exports.getSelectionText = exports.hasSameMarkup = exports.liftBlockquote = exports.blockquote = exports.listStyle = exports.toggleList = exports.toggleUnorderedList = exports.toggleOrderedList = exports.indentBlocks = exports.canBeIndented = exports.isIndented = exports.canOutdentAsListItem = exports.outdent = exports.canIndentAsListItem = exports.indent = exports.selectionMarks = exports.cleanMarks = exports.removeAllMarks = exports.getActiveMarks = exports.getMark = exports.hasMark = exports.cleanTextBlockFormatting = exports.blockNodes = exports.changeTextBlock = exports.parentBlockFormat = exports.getBlockFormats = exports.formatBlockElements = exports.activeNode = exports.hasNode = exports.cleanFormatting = exports.isAligned = exports.alignBlocks = exports.insertImage = exports.insertText = exports.removeLink = exports.applyLink = exports.toggleInlineFormat = exports.getInlineStyles = exports.applyInlineStyle = exports.fragmentToHtml = exports.pmDocToFragment = exports.domToPmDoc = exports.htmlToFragment = exports.trimWhitespace = exports.parseContent = exports.setHtml = exports.getHtml = void 0;
|
|
4
|
+
exports.tableEditing = exports.TableMap = exports.tableRowResizeKey = exports.tableColumnResizeKey = exports.tableResizeKey = exports.tableResizing = exports.caretColorKey = exports.caretColor = exports.imageResizeKey = exports.imageResizing = exports.textHighlightKey = exports.textHighlight = exports.spacesFix = exports.placeholder = exports.replaceAll = exports.replace = exports.findAll = exports.findAt = exports.find = exports.convertMsLists = exports.replaceImageSourcesFromRtf = exports.removeAttribute = exports.sanitizeStyleAttr = exports.sanitizeClassAttr = exports.pasteCleanup = exports.removeTag = exports.removeComments = exports.sanitize = exports.link = exports.superscript = exports.subscript = exports.strikethrough = exports.underline = exports.italic = exports.bold = exports.buildListKeymap = exports.buildKeymap = exports.marks = exports.nodes = exports.outdentRules = exports.indentRules = exports.alignRemoveRules = exports.alignJustifyRules = exports.alignRightRules = exports.alignCenterRules = exports.alignLeftRules = exports.indentHtml = exports.insertNode = exports.canInsert = exports.expandToWordWrap = void 0;
|
|
5
|
+
exports.pmDeleteColumn = exports.pmAddRowBefore = exports.pmAddRowAfter = exports.pmAddColumnAfter = exports.pmAddColumnBefore = exports.deleteColumn = exports.addColumnAfter = exports.addColumnBefore = exports.addRowBefore = exports.addRowAfter = exports.createTable = exports.nextCell = exports.moveCellForward = exports.removeColSpan = exports.findCell = exports.cellAround = exports.updateColumnsOnResize = exports.columnResizingPluginKey = exports.columnResizing = exports.columnIsHeader = exports.colCount = exports.addColumn = exports.addColSpan = exports.addRow = exports.rowIsHeader = exports.deleteRow = exports.mergeCells = exports.splitCellWithType = exports.splitCell = exports.toggleHeaderRow = exports.toggleHeaderColumn = exports.toggleHeaderCell = exports.toggleHeader = exports.goToNextCell = exports.setCellAttr = exports.selectionCell = exports.selectedRect = exports.CellSelection = exports.inSameTable = exports.deleteTable = exports.isInTable = exports.fixTablesKey = exports.fixTables = exports.tableNodes = exports.tableNodeTypes = exports.tableEditingKey = void 0;
|
|
6
6
|
var tslib_1 = require("tslib");
|
|
7
7
|
var source_1 = require("./source");
|
|
8
8
|
Object.defineProperty(exports, "getHtml", { enumerable: true, get: function () { return source_1.getHtml; } });
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "trimWhitespace", { enumerable: true, get: functi
|
|
|
12
12
|
Object.defineProperty(exports, "htmlToFragment", { enumerable: true, get: function () { return source_1.htmlToFragment; } });
|
|
13
13
|
Object.defineProperty(exports, "domToPmDoc", { enumerable: true, get: function () { return source_1.domToPmDoc; } });
|
|
14
14
|
Object.defineProperty(exports, "pmDocToFragment", { enumerable: true, get: function () { return source_1.pmDocToFragment; } });
|
|
15
|
+
Object.defineProperty(exports, "fragmentToHtml", { enumerable: true, get: function () { return source_1.fragmentToHtml; } });
|
|
15
16
|
var inline_style_1 = require("./inline-style");
|
|
16
17
|
Object.defineProperty(exports, "applyInlineStyle", { enumerable: true, get: function () { return inline_style_1.applyInlineStyle; } });
|
|
17
18
|
Object.defineProperty(exports, "getInlineStyles", { enumerable: true, get: function () { return inline_style_1.getInlineStyles; } });
|
package/dist/npm/source.js
CHANGED
|
@@ -5,7 +5,7 @@ var prosemirror_model_1 = require("prosemirror-model");
|
|
|
5
5
|
var prosemirror_state_1 = require("prosemirror-state");
|
|
6
6
|
var constants_1 = require("./config/constants");
|
|
7
7
|
var blockWrappers = [
|
|
8
|
-
'div', 'ol', 'ul', 'li', 'table', 'tbody', 'thead', 'tfoot', 'td', 'th', 'p',
|
|
8
|
+
'div', 'ol', 'ul', 'li', 'table', 'tbody', 'thead', 'tfoot', 'caption', 'td', 'th', 'p',
|
|
9
9
|
'tr', 'col', 'colgroup', 'article', 'main', 'nav', 'header', 'footer', 'aside', 'section'
|
|
10
10
|
];
|
|
11
11
|
var removeRowType = function (table, nodeName) {
|
|
@@ -27,6 +27,23 @@ var restoreTables = function (fragment) {
|
|
|
27
27
|
if (emptyElement) {
|
|
28
28
|
emptyElement.remove();
|
|
29
29
|
}
|
|
30
|
+
var wrapper = table.parentNode instanceof HTMLDivElement ? table.parentNode : null;
|
|
31
|
+
if (wrapper && wrapper.matches('div[table]')) {
|
|
32
|
+
table.style.marginLeft = wrapper.style.marginLeft;
|
|
33
|
+
table.style.marginRight = wrapper.style.marginRight;
|
|
34
|
+
var captionDiv = Array.from(wrapper.children).find(function (el) { return el.matches('div[caption]'); });
|
|
35
|
+
if (captionDiv) {
|
|
36
|
+
var caption = table.createCaption();
|
|
37
|
+
caption.style.textAlign = captionDiv.style.textAlign;
|
|
38
|
+
caption.style.verticalAlign = captionDiv.style.verticalAlign;
|
|
39
|
+
caption.style.captionSide = captionDiv.style.captionSide;
|
|
40
|
+
while (captionDiv.firstChild) {
|
|
41
|
+
caption.appendChild(captionDiv.firstChild);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
wrapper.parentNode.insertBefore(table, wrapper);
|
|
45
|
+
wrapper.parentNode.removeChild(wrapper);
|
|
46
|
+
}
|
|
30
47
|
});
|
|
31
48
|
};
|
|
32
49
|
var setRowType = function (children, nodeName) {
|
|
@@ -54,6 +71,28 @@ var validateTablesToPmSchema = function (fragment) {
|
|
|
54
71
|
table.setAttribute(constants_1.colgroupAttr, colgroup.outerHTML);
|
|
55
72
|
colgroup.remove();
|
|
56
73
|
}
|
|
74
|
+
if (table.caption || table.style.marginLeft || table.style.marginRight) {
|
|
75
|
+
var wrapper = document.createElement('div');
|
|
76
|
+
wrapper.setAttribute('table', '');
|
|
77
|
+
wrapper.style.display = 'table';
|
|
78
|
+
wrapper.style.marginLeft = table.style.marginLeft;
|
|
79
|
+
wrapper.style.marginRight = table.style.marginRight;
|
|
80
|
+
if (table.caption) {
|
|
81
|
+
var captionDiv = document.createElement('div');
|
|
82
|
+
captionDiv.setAttribute('caption', '');
|
|
83
|
+
captionDiv.style.display = 'table-caption';
|
|
84
|
+
captionDiv.style.textAlign = table.caption.style.textAlign;
|
|
85
|
+
captionDiv.style.verticalAlign = table.caption.style.verticalAlign;
|
|
86
|
+
captionDiv.style.captionSide = table.caption.style.captionSide;
|
|
87
|
+
while (table.caption.firstChild) {
|
|
88
|
+
captionDiv.appendChild(table.caption.firstChild);
|
|
89
|
+
}
|
|
90
|
+
table.removeChild(table.caption);
|
|
91
|
+
wrapper.appendChild(captionDiv);
|
|
92
|
+
}
|
|
93
|
+
table.parentNode.insertBefore(wrapper, table);
|
|
94
|
+
wrapper.appendChild(table);
|
|
95
|
+
}
|
|
57
96
|
});
|
|
58
97
|
};
|
|
59
98
|
/**
|
package/dist/npm/table.js
CHANGED
|
@@ -130,13 +130,15 @@ var addColumnAfter = function (state, dispatch) {
|
|
|
130
130
|
};
|
|
131
131
|
exports.addColumnAfter = addColumnAfter;
|
|
132
132
|
var deleteColumn = function (state, dispatch) {
|
|
133
|
-
var
|
|
133
|
+
var parentTable = closest(state.selection, reTable);
|
|
134
|
+
var colgroup = parentTable && parentTable.node.attrs[constants_1.colgroupAttr];
|
|
135
|
+
var colIndex = columnIndex(parentTable, state.selection);
|
|
134
136
|
var cmdDispatch = dispatch && (function (tr) {
|
|
135
|
-
|
|
136
|
-
if (!table.node.attrs[constants_1.colgroupAttr]) {
|
|
137
|
+
if (!colgroup) {
|
|
137
138
|
return dispatch(tr);
|
|
138
139
|
}
|
|
139
|
-
|
|
140
|
+
var table = tr.doc.nodeAt(parentTable.pos);
|
|
141
|
+
deleteCol(tr, { node: table, pos: parentTable.pos }, colIndex);
|
|
140
142
|
return dispatch(tr);
|
|
141
143
|
});
|
|
142
144
|
return prosemirror_tables_1.deleteColumn(state, cmdDispatch);
|