@progress/kendo-editor-common 1.11.1 → 1.11.2-dev.202402291213

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.
Files changed (94) hide show
  1. package/dist/es/DOMSerializer.js +8 -8
  2. package/dist/es/align.js +1 -1
  3. package/dist/es/blockNode.js +5 -7
  4. package/dist/es/blockquote.js +1 -1
  5. package/dist/es/config/keymap.js +3 -3
  6. package/dist/es/config/schema.js +2 -1
  7. package/dist/es/find-replace.js +1 -1
  8. package/dist/es/indent.js +4 -4
  9. package/dist/es/inline-style.js +3 -3
  10. package/dist/es/listConvert.js +2 -2
  11. package/dist/es/lists.js +2 -1
  12. package/dist/es/paste.js +2 -2
  13. package/dist/es/plugins/caret-color.js +1 -1
  14. package/dist/es/plugins/csp-fix.js +4 -4
  15. package/dist/es/plugins/highlight.js +1 -1
  16. package/dist/es/plugins/image-resize.js +6 -6
  17. package/dist/es/plugins/list-markers-styles.js +3 -3
  18. package/dist/es/plugins/placeholder.js +1 -1
  19. package/dist/es/plugins/spaces-fix.js +1 -1
  20. package/dist/es/plugins/table-resize/column-resize.js +14 -12
  21. package/dist/es/plugins/table-resize/row-resize.js +7 -7
  22. package/dist/es/plugins/table-resize/table-resize.js +6 -6
  23. package/dist/es/source.js +1 -0
  24. package/dist/es/table.js +1 -0
  25. package/dist/es/utils.js +3 -3
  26. package/dist/es2015/DOMSerializer.js +37 -37
  27. package/dist/es2015/blockNode.js +9 -11
  28. package/dist/es2015/blockquote.js +1 -1
  29. package/dist/es2015/config/keymap.js +3 -3
  30. package/dist/es2015/config/schema.js +4 -3
  31. package/dist/es2015/find-replace.js +1 -1
  32. package/dist/es2015/inline-style.js +5 -5
  33. package/dist/es2015/listConvert.js +6 -6
  34. package/dist/es2015/lists.js +6 -5
  35. package/dist/es2015/mark.js +17 -17
  36. package/dist/es2015/plugins/caret-color.js +1 -1
  37. package/dist/es2015/plugins/csp-fix.js +5 -5
  38. package/dist/es2015/plugins/highlight.js +1 -1
  39. package/dist/es2015/plugins/image-resize.js +10 -10
  40. package/dist/es2015/plugins/list-markers-styles.js +2 -2
  41. package/dist/es2015/plugins/placeholder.js +1 -1
  42. package/dist/es2015/plugins/spaces-fix.js +1 -1
  43. package/dist/es2015/plugins/table-resize/column-resize.js +41 -39
  44. package/dist/es2015/plugins/table-resize/row-resize.js +27 -27
  45. package/dist/es2015/plugins/table-resize/table-resize.js +6 -6
  46. package/dist/es2015/plugins/table-resize/table-view.js +2 -2
  47. package/dist/es2015/source.js +1 -0
  48. package/dist/es2015/table.js +1 -0
  49. package/dist/es2015/utils.js +6 -6
  50. package/dist/npm/DOMSerializer.d.ts +2 -2
  51. package/dist/npm/DOMSerializer.js +8 -8
  52. package/dist/npm/align.js +5 -5
  53. package/dist/npm/blockNode.js +13 -15
  54. package/dist/npm/blockquote.js +2 -2
  55. package/dist/npm/cleanFormatting.js +2 -2
  56. package/dist/npm/config/keymap.js +7 -7
  57. package/dist/npm/config/schema.js +6 -5
  58. package/dist/npm/find-replace.js +7 -7
  59. package/dist/npm/image.js +1 -1
  60. package/dist/npm/indent.js +24 -24
  61. package/dist/npm/inline-style.js +13 -13
  62. package/dist/npm/link.js +7 -7
  63. package/dist/npm/listConvert.js +4 -4
  64. package/dist/npm/lists.d.ts +2 -1
  65. package/dist/npm/lists.js +10 -9
  66. package/dist/npm/mark.js +7 -7
  67. package/dist/npm/paste.js +8 -8
  68. package/dist/npm/plugins/caret-color.js +1 -1
  69. package/dist/npm/plugins/csp-fix.d.ts +1 -1
  70. package/dist/npm/plugins/csp-fix.js +3 -3
  71. package/dist/npm/plugins/highlight.d.ts +1 -1
  72. package/dist/npm/plugins/image-resize.d.ts +1 -1
  73. package/dist/npm/plugins/image-resize.js +4 -4
  74. package/dist/npm/plugins/list-markers-styles.js +8 -8
  75. package/dist/npm/plugins/table-resize/column-resize.js +23 -21
  76. package/dist/npm/plugins/table-resize/index.js +3 -3
  77. package/dist/npm/plugins/table-resize/row-resize.js +18 -18
  78. package/dist/npm/plugins/table-resize/table-resize.js +25 -25
  79. package/dist/npm/plugins/table-resize/table-view.js +4 -4
  80. package/dist/npm/plugins/table-resize/utils.js +1 -1
  81. package/dist/npm/source.d.ts +1 -0
  82. package/dist/npm/source.js +6 -5
  83. package/dist/npm/table.d.ts +1 -0
  84. package/dist/npm/table.js +8 -7
  85. package/dist/npm/types/command.d.ts +1 -1
  86. package/dist/npm/types/dispatchFn.d.ts +1 -1
  87. package/dist/npm/types/predicate.d.ts +1 -1
  88. package/dist/npm/utils.d.ts +1 -1
  89. package/dist/npm/utils.js +10 -10
  90. package/package.json +26 -19
  91. package/NOTICE.txt +0 -614
  92. package/dist/cdn/js/kendo-editor-common.js +0 -1
  93. package/dist/cdn/main.js +0 -1
  94. package/dist/systemjs/kendo-editor-common.js +0 -1
@@ -75,7 +75,7 @@ var blockNodes = function (state, options) {
75
75
  ranges.forEach(function (range) {
76
76
  var from = range.$from.pos;
77
77
  var to = range.$to.pos;
78
- doc.nodesBetween(from, to, function (node, pos, _parent, _index) {
78
+ doc.nodesBetween(from, to, function (node, pos) {
79
79
  if (node.isBlock && (!blocksInSelection || (pos >= from && pos + node.content.size + 2 <= to))) {
80
80
  result.push(node);
81
81
  }
@@ -87,7 +87,7 @@ var blockNodes = function (state, options) {
87
87
  exports.blockNodes = blockNodes;
88
88
  var formatBlockElements = function (value, commandName) {
89
89
  return function (state, dispatch) {
90
- var blocks = exports.blockNodes(state);
90
+ var blocks = (0, exports.blockNodes)(state);
91
91
  var nodes = state.schema.nodes;
92
92
  var tr = state.tr;
93
93
  tr.setMeta('commandName', commandName);
@@ -95,16 +95,14 @@ var formatBlockElements = function (value, commandName) {
95
95
  blocks.forEach(function (node) {
96
96
  if (node.type.isTextblock) {
97
97
  if (value === 'p') {
98
- var _a = node.attrs, level = _a.level, attrs = tslib_1.__rest(_a, ["level"]);
99
- exports.changeTextBlock(tr, node, nodes.paragraph, attrs);
98
+ (0, exports.changeTextBlock)(tr, node, nodes.paragraph, node.attrs);
100
99
  }
101
100
  else if (/^h[1-6]$/i.test(value)) {
102
101
  var level = parseInt(value.substr(1), 10);
103
- exports.changeTextBlock(tr, node, nodes.heading, tslib_1.__assign(tslib_1.__assign({}, node.attrs), { level: level }));
102
+ (0, exports.changeTextBlock)(tr, node, nodes.heading, tslib_1.__assign(tslib_1.__assign({}, node.attrs), { level: level }));
104
103
  }
105
104
  else if (value === 'blockquote') {
106
- var _b = node.attrs, level = _b.level, attrs = tslib_1.__rest(_b, ["level"]);
107
- exports.changeTextBlock(tr, node, nodes.blockquote, attrs);
105
+ (0, exports.changeTextBlock)(tr, node, nodes.blockquote, node.attrs);
108
106
  }
109
107
  }
110
108
  });
@@ -127,19 +125,19 @@ var cleanTextBlockFormatting = function (tr, options) {
127
125
  if (options === void 0) { options = { blocksInSelection: true }; }
128
126
  var doc = tr.doc, selection = tr.selection;
129
127
  var blocksInSelection = options.blocksInSelection, blockNodeType = options.blockNodeType;
130
- var nodes = exports.blockNodes({ doc: doc, selection: selection }, { blocksInSelection: blocksInSelection });
128
+ var nodes = (0, exports.blockNodes)({ doc: doc, selection: selection }, { blocksInSelection: blocksInSelection });
131
129
  var textBlocks = nodes.filter(function (node) { return node.isTextblock; });
132
130
  textBlocks.forEach(function (node) {
133
131
  var _a = node.attrs || {}, _b = _a.style, style = _b === void 0 ? '' : _b, _c = _a.class, className = _c === void 0 ? '' : _c, attrs = tslib_1.__rest(_a, ["style", "class"]);
134
132
  var nodeType = blockNodeType || node.type;
135
133
  if (style || className || nodeType !== node.type) {
136
- exports.changeTextBlock(tr, node, nodeType, attrs);
134
+ (0, exports.changeTextBlock)(tr, node, nodeType, attrs);
137
135
  }
138
136
  });
139
137
  };
140
138
  exports.cleanTextBlockFormatting = cleanTextBlockFormatting;
141
139
  var getBlockFormats = function (state) {
142
- var blocks = exports.blockNodes(state);
140
+ var blocks = (0, exports.blockNodes)(state);
143
141
  var nodes = state.schema.nodes;
144
142
  var result = [];
145
143
  blocks.forEach(function (node) {
@@ -147,7 +145,7 @@ var getBlockFormats = function (state) {
147
145
  result.push('p');
148
146
  }
149
147
  else if (node.type === nodes.heading) {
150
- result.push("h" + node.attrs.level);
148
+ result.push("h".concat(node.attrs.level));
151
149
  }
152
150
  else if (node.type === nodes.blockquote && nodes.blockquote.isTextblock) {
153
151
  // In case the blockquote can have inline content.
@@ -162,11 +160,11 @@ var addStyles = function (node, stylesToApply) {
162
160
  if (currentStyles) {
163
161
  stylesToApply.forEach(function (style) {
164
162
  toChange = { style: style.name, value: /^.+$/, newValue: style.value };
165
- changedStyleResult = utils_1.changeStylesString(currentStyles, toChange);
163
+ changedStyleResult = (0, utils_1.changeStylesString)(currentStyles, toChange);
166
164
  currentStyles = changedStyleResult.changed ? changedStyleResult.style : currentStyles;
167
165
  });
168
166
  }
169
- var reducer = function (acc, curr) { return ((acc && curr.value ? acc + ' ' : '') + curr.value ? curr.name + ": " + curr.value + ";" : ''); };
167
+ var reducer = function (acc, curr) { return ((acc && curr.value ? acc + ' ' : '') + curr.value ? "".concat(curr.name, ": ").concat(curr.value, ";") : ''); };
170
168
  currentStyles = currentStyles || stylesToApply.reduce(reducer, '');
171
169
  return Object.assign({}, node.attrs, { style: currentStyles || null });
172
170
  };
@@ -182,7 +180,7 @@ var hasNode = function (state, nodeType) {
182
180
  };
183
181
  exports.hasNode = hasNode;
184
182
  var parentBlockFormat = function (state) {
185
- var formats = exports.getBlockFormats(state);
183
+ var formats = (0, exports.getBlockFormats)(state);
186
184
  return new Set(formats).size === 1 ? formats[0] : null;
187
185
  };
188
186
  exports.parentBlockFormat = parentBlockFormat;
@@ -190,6 +188,6 @@ exports.parentBlockFormat = parentBlockFormat;
190
188
  * **Deprecated.** Use `parentBlockFormat` function instead.
191
189
  */
192
190
  var activeNode = function (state) {
193
- return { tag: exports.parentBlockFormat(state) || '' };
191
+ return { tag: (0, exports.parentBlockFormat)(state) || '' };
194
192
  };
195
193
  exports.activeNode = activeNode;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.liftBlockquote = exports.blockquote = void 0;
4
4
  var prosemirror_commands_1 = require("prosemirror-commands");
5
5
  var blockquote = function (state, dispatch) {
6
- return prosemirror_commands_1.wrapIn(state.schema.nodes.blockquote)(state, dispatch);
6
+ return (0, prosemirror_commands_1.wrapIn)(state.schema.nodes.blockquote)(state, dispatch);
7
7
  };
8
8
  exports.blockquote = blockquote;
9
9
  var liftBlockquote = function (state, dispatch) {
@@ -13,7 +13,7 @@ var liftBlockquote = function (state, dispatch) {
13
13
  var target = -1;
14
14
  var range = $from.blockRange($to);
15
15
  if (range) {
16
- doc.nodesBetween(range.start, range.end, function (node, pos, _parent, _index) {
16
+ doc.nodesBetween(range.start, range.end, function (node, pos) {
17
17
  if (node.type === nodeType) {
18
18
  target = pos;
19
19
  }
@@ -12,8 +12,8 @@ var cleanFormatting = function (options) {
12
12
  var tr = state.tr;
13
13
  var blocksInSelection = options.blocksInSelection, blockNodeType = options.blockNodeType, exceptMarks = options.exceptMarks;
14
14
  var except = (exceptMarks || [state.schema.marks.link]).filter(Boolean);
15
- mark_1.cleanMarks(tr, { except: except });
16
- blockNode_1.cleanTextBlockFormatting(tr, { blocksInSelection: blocksInSelection, blockNodeType: blockNodeType });
15
+ (0, mark_1.cleanMarks)(tr, { except: except });
16
+ (0, blockNode_1.cleanTextBlockFormatting)(tr, { blocksInSelection: blocksInSelection, blockNodeType: blockNodeType });
17
17
  var result = tr.docChanged;
18
18
  if (result && dispatch) {
19
19
  dispatch(tr);
@@ -17,24 +17,24 @@ var buildKeymap = function (schema, options) {
17
17
  keys['Mod-z'] = prosemirror_history_1.undo;
18
18
  keys['Shift-Mod-z'] = prosemirror_history_1.redo;
19
19
  // tslint:disable-next-line:no-string-literal
20
- keys['Backspace'] = prosemirror_commands_1.chainCommands(prosemirror_inputrules_1.undoInputRule, prosemirror_commands_1.deleteSelection, prosemirror_commands_1.joinBackward, prosemirror_commands_1.selectNodeBackward);
20
+ keys.Backspace = (0, prosemirror_commands_1.chainCommands)(prosemirror_inputrules_1.undoInputRule, prosemirror_commands_1.deleteSelection, prosemirror_commands_1.joinBackward, prosemirror_commands_1.selectNodeBackward);
21
21
  // tslint:disable-next-line:no-string-literal
22
- keys['Enter'] = prosemirror_commands_1.chainCommands(prosemirror_commands_1.newlineInCode, prosemirror_commands_1.createParagraphNear, prosemirror_commands_1.liftEmptyBlock, prosemirror_commands_1.splitBlockKeepMarks);
22
+ keys.Enter = (0, prosemirror_commands_1.chainCommands)(prosemirror_commands_1.newlineInCode, prosemirror_commands_1.createParagraphNear, prosemirror_commands_1.liftEmptyBlock, prosemirror_commands_1.splitBlockKeepMarks);
23
23
  if (!mac) {
24
24
  keys['Mod-y'] = prosemirror_history_1.redo;
25
25
  }
26
26
  if (schema.marks.strong) {
27
- keys['Mod-b'] = utils_1.expandToWordWrap(inline_style_1.toggleInlineFormat, tslib_1.__assign(tslib_1.__assign({}, commands_1.bold), { applyToWord: applyToWord }));
27
+ keys['Mod-b'] = (0, utils_1.expandToWordWrap)(inline_style_1.toggleInlineFormat, tslib_1.__assign(tslib_1.__assign({}, commands_1.bold), { applyToWord: applyToWord }));
28
28
  }
29
29
  if (schema.marks.em) {
30
- keys['Mod-i'] = utils_1.expandToWordWrap(inline_style_1.toggleInlineFormat, tslib_1.__assign(tslib_1.__assign({}, commands_1.italic), { applyToWord: applyToWord }));
30
+ keys['Mod-i'] = (0, utils_1.expandToWordWrap)(inline_style_1.toggleInlineFormat, tslib_1.__assign(tslib_1.__assign({}, commands_1.italic), { applyToWord: applyToWord }));
31
31
  }
32
32
  if (schema.marks.u) {
33
- keys['Mod-u'] = utils_1.expandToWordWrap(inline_style_1.toggleInlineFormat, tslib_1.__assign(tslib_1.__assign({}, commands_1.underline), { applyToWord: applyToWord }));
33
+ keys['Mod-u'] = (0, utils_1.expandToWordWrap)(inline_style_1.toggleInlineFormat, tslib_1.__assign(tslib_1.__assign({}, commands_1.underline), { applyToWord: applyToWord }));
34
34
  }
35
35
  if (schema.nodes.hard_break) {
36
36
  var br_1 = schema.nodes.hard_break;
37
- var cmd = prosemirror_commands_1.chainCommands(prosemirror_commands_1.exitCode, function (state, dispatch) {
37
+ var cmd = (0, prosemirror_commands_1.chainCommands)(prosemirror_commands_1.exitCode, function (state, dispatch) {
38
38
  dispatch(state.tr.replaceSelectionWith(br_1.create()).scrollIntoView());
39
39
  return true;
40
40
  });
@@ -47,7 +47,7 @@ var buildListKeymap = function (schema) {
47
47
  var keys = {};
48
48
  if (schema.nodes.list_item) {
49
49
  // tslint:disable-next-line:no-string-literal
50
- keys['Enter'] = lists_1.splitListItemKeepMarks(schema.nodes.list_item);
50
+ keys.Enter = (0, lists_1.splitListItemKeepMarks)(schema.nodes.list_item);
51
51
  }
52
52
  return keys;
53
53
  };
@@ -11,7 +11,8 @@ var blockquoteDOM = ['blockquote', hole], hrDOM = ['hr'], preDOM = ['pre', ['cod
11
11
  var olDOM = ['ol', 0], ulDOM = ['ul', 0], liDOM = ['li', 0];
12
12
  var domAttributes = function (dom) {
13
13
  var result = {};
14
- var attributes = dom.attributes, attr;
14
+ var attributes = dom.attributes;
15
+ var attr;
15
16
  for (var i = 0; i < attributes.length; i++) {
16
17
  attr = attributes[i];
17
18
  result[attr.name] = attr.value;
@@ -118,13 +119,13 @@ var shouldSkipColgroup = function (node) {
118
119
  return shouldSkip;
119
120
  };
120
121
  var parseStrColgroup = function (colgroup) {
121
- var doc = source_1.domToPmDoc(source_1.htmlToFragment(colgroup), colgroupSchema, { preserveWhitespace: false });
122
- var fragment = source_1.pmDocToFragment(doc);
122
+ var doc = (0, source_1.domToPmDoc)((0, source_1.htmlToFragment)(colgroup), colgroupSchema, { preserveWhitespace: false });
123
+ var fragment = (0, source_1.pmDocToFragment)(doc);
123
124
  var colgroupEl = fragment.firstChild;
124
125
  return colgroupEl;
125
126
  };
126
127
  exports.parseStrColgroup = parseStrColgroup;
127
- var tNodes = prosemirror_tables_1.tableNodes({ tableGroup: 'block', cellContent: 'block+', cellAttributes: cellAttributes });
128
+ var tNodes = (0, prosemirror_tables_1.tableNodes)({ tableGroup: 'block', cellContent: 'block+', cellAttributes: cellAttributes });
128
129
  tNodes.table_row.attrs = tslib_1.__assign(tslib_1.__assign({}, tNodes.table_row.attrs), defaultAttrs([constants_1.rowTypeAttr, 'style', 'class', 'id']));
129
130
  tNodes.table_row.toDOM = function (node) { return ['tr', pmAttributes(node.attrs), 0]; };
130
131
  tNodes.table_row.parseDOM = [{ tag: 'tr', getAttrs: domAttributes }];
@@ -133,7 +134,7 @@ tNodes.table.toDOM = function (node) {
133
134
  var tableAttrs = hasAttrs(node.attrs) ? pmAttributes(node.attrs, [constants_1.colgroupAttr, constants_1.resizableAttr]) : {};
134
135
  var colgroup = null;
135
136
  if (node.attrs[constants_1.colgroupAttr] && !shouldSkipColgroup(node)) {
136
- var colgroupEl = exports.parseStrColgroup(node.attrs[constants_1.colgroupAttr]);
137
+ var colgroupEl = (0, exports.parseStrColgroup)(node.attrs[constants_1.colgroupAttr]);
137
138
  if (colgroupEl) {
138
139
  var cols = Array.from(colgroupEl.children).map(function (c) { return ['col', domAttributes(c)]; });
139
140
  colgroup = [
@@ -17,7 +17,7 @@ var findAt = function (doc, searchOptions, start, end, exit) {
17
17
  }
18
18
  var flags = matchCase ? 'g' : 'gi';
19
19
  var regExp = useRegExp ? new RegExp(searchText, flags) : createRegExp(searchText, flags);
20
- doc.nodesBetween(start, end, function (node, pos, _parent) {
20
+ doc.nodesBetween(start, end, function (node, pos) {
21
21
  if (exit(result)) {
22
22
  return false;
23
23
  }
@@ -66,22 +66,22 @@ var find = function (state, searchOptions) {
66
66
  var doc = state.doc, selection = state.selection;
67
67
  var result = [];
68
68
  if (backward) {
69
- result = exports.findAt(doc, options, 0, selection.from, exit);
69
+ result = (0, exports.findAt)(doc, options, 0, selection.from, exit);
70
70
  if (!result.length && matchCyclic) {
71
- result = exports.findAt(doc, options, selection.from, doc.content.size, exit);
71
+ result = (0, exports.findAt)(doc, options, selection.from, doc.content.size, exit);
72
72
  }
73
73
  }
74
74
  else {
75
- result = exports.findAt(doc, options, selection.to, doc.content.size, exit);
75
+ result = (0, exports.findAt)(doc, options, selection.to, doc.content.size, exit);
76
76
  if (!result.length && matchCyclic) {
77
- result = exports.findAt(doc, options, 0, selection.to, exit);
77
+ result = (0, exports.findAt)(doc, options, 0, selection.to, exit);
78
78
  }
79
79
  }
80
80
  return result.length ? result[result.length - 1] : null;
81
81
  };
82
82
  exports.find = find;
83
83
  var findAll = function (doc, searchOptions) {
84
- return exports.findAt(doc, searchOptions, 0, doc.content.size, function () { return false; });
84
+ return (0, exports.findAt)(doc, searchOptions, 0, doc.content.size, function () { return false; });
85
85
  };
86
86
  exports.findAll = findAll;
87
87
  var replace = function (selection, text, transaction) {
@@ -92,7 +92,7 @@ var replace = function (selection, text, transaction) {
92
92
  };
93
93
  exports.replace = replace;
94
94
  var replaceAll = function (state, replaceText, searchOptions) {
95
- var result = exports.findAll(state.doc, searchOptions);
95
+ var result = (0, exports.findAll)(state.doc, searchOptions);
96
96
  if (result.length === 0) {
97
97
  return null;
98
98
  }
package/dist/npm/image.js CHANGED
@@ -6,6 +6,6 @@ var insertImage = function (attrs) { return function (state, dispatch) {
6
6
  var image = state.schema.nodes.image;
7
7
  var commandName = 'insertImage';
8
8
  var newImage = image.createAndFill(attrs);
9
- utils_1.insertNode(newImage)(state, function (tr) { return dispatch(tr.setMeta('commandName', commandName).setMeta('args', attrs)); });
9
+ (0, utils_1.insertNode)(newImage)(state, function (tr) { return dispatch(tr.setMeta('commandName', commandName).setMeta('args', attrs)); });
10
10
  }; };
11
11
  exports.insertImage = insertImage;
@@ -12,7 +12,7 @@ var blockquote_1 = require("./blockquote");
12
12
  * @returns {boolean} - Returns true if any indentation is applied.
13
13
  */
14
14
  var indentBlocks = function (actions, command, dir) { return function (state, dispatch) {
15
- var blocks = blockNode_1.blockNodes(state);
15
+ var blocks = (0, blockNode_1.blockNodes)(state);
16
16
  var tr = state.tr;
17
17
  tr.setMeta('commandName', command);
18
18
  blocks.forEach(function (node) {
@@ -23,21 +23,21 @@ var indentBlocks = function (actions, command, dir) { return function (state, di
23
23
  var style = dir === 'rtl' ? action.rtlStyle : action.style;
24
24
  var newStyle = {
25
25
  name: style,
26
- value: action.step > 0 ? "" + action.step + action.unit : ''
26
+ value: action.step > 0 ? "".concat(action.step).concat(action.unit) : ''
27
27
  };
28
28
  if (node.attrs.style) {
29
- var re = new RegExp(style + ":\\s?(\\d+)" + action.unit, 'i');
29
+ var re = new RegExp("".concat(style, ":\\s?(\\d+)").concat(action.unit), 'i');
30
30
  var match = node.attrs.style.match(re);
31
31
  if (match) {
32
32
  var newMargin = parseFloat(match[1]) + action.step;
33
33
  newMargin = newMargin <= 0 ? '' : newMargin;
34
- newStyle.value = "" + newMargin + (newMargin ? action.unit : '');
34
+ newStyle.value = "".concat(newMargin).concat(newMargin ? action.unit : '');
35
35
  }
36
36
  }
37
- newAttrs = blockNode_1.addStyles(node, [newStyle]);
37
+ newAttrs = (0, blockNode_1.addStyles)(node, [newStyle]);
38
38
  }
39
39
  if (newAttrs) {
40
- blockNode_1.changeTextBlock(tr, node, node.type, newAttrs);
40
+ (0, blockNode_1.changeTextBlock)(tr, node, node.type, newAttrs);
41
41
  }
42
42
  }
43
43
  });
@@ -49,14 +49,14 @@ var indentBlocks = function (actions, command, dir) { return function (state, di
49
49
  }; };
50
50
  exports.indentBlocks = indentBlocks;
51
51
  var isIndented = function (state, rules, dir) {
52
- var blocks = blockNode_1.blockNodes(state);
52
+ var blocks = (0, blockNode_1.blockNodes)(state);
53
53
  var result = false;
54
54
  blocks.forEach(function (node) {
55
55
  if (!result && node.type.isTextblock && node.attrs.style) {
56
56
  var action = rules.find(function (a) { return a.node === node.type.name; });
57
57
  if (action) {
58
58
  var style = dir === 'rtl' ? action.rtlStyle : action.style;
59
- var reIndent = new RegExp(style + ":\\s?\\d+" + action.unit, 'i');
59
+ var reIndent = new RegExp("".concat(style, ":\\s?\\d+").concat(action.unit), 'i');
60
60
  result = reIndent.test(node.attrs.style);
61
61
  }
62
62
  }
@@ -65,48 +65,48 @@ var isIndented = function (state, rules, dir) {
65
65
  };
66
66
  exports.isIndented = isIndented;
67
67
  var canIndentAsListItem = function (state, nodeType) {
68
- return prosemirror_schema_list_1.sinkListItem(nodeType)(state);
68
+ return (0, prosemirror_schema_list_1.sinkListItem)(nodeType)(state);
69
69
  };
70
70
  exports.canIndentAsListItem = canIndentAsListItem;
71
71
  var canOutdentAsListItem = function (state, rules) {
72
72
  var listItem = state.schema.nodes[rules.listsTypes.listItem];
73
73
  var orderedList = state.schema.nodes[rules.listsTypes.orderedList];
74
74
  var bulletList = state.schema.nodes[rules.listsTypes.bulletList];
75
- var isNestedInOL = !!utils_1.findNthParentNodeOfType(orderedList, 2)(state.selection);
76
- var isNestedInUL = !!utils_1.findNthParentNodeOfType(bulletList, 2)(state.selection);
77
- return (isNestedInOL || isNestedInUL) && prosemirror_schema_list_1.liftListItem(listItem)(state);
75
+ var isNestedInOL = !!(0, utils_1.findNthParentNodeOfType)(orderedList, 2)(state.selection);
76
+ var isNestedInUL = !!(0, utils_1.findNthParentNodeOfType)(bulletList, 2)(state.selection);
77
+ return (isNestedInOL || isNestedInUL) && (0, prosemirror_schema_list_1.liftListItem)(listItem)(state);
78
78
  };
79
79
  exports.canOutdentAsListItem = canOutdentAsListItem;
80
80
  var canBeIndented = function (state, rules) {
81
81
  var nodes = state.schema.nodes;
82
82
  var listItem = nodes[indent_rules_1.indentRules.listsTypes.listItem];
83
- return ((exports.isIndented(state, rules.nodes) || indent_rules_1.indentRules.nodes.some(function (rule) { return nodes[rule.node] && blockNode_1.hasNode(state, nodes[rule.node]); })) &&
84
- !blockNode_1.hasNode(state, listItem));
83
+ return (((0, exports.isIndented)(state, rules.nodes) || indent_rules_1.indentRules.nodes.some(function (rule) { return nodes[rule.node] && (0, blockNode_1.hasNode)(state, nodes[rule.node]); })) &&
84
+ !(0, blockNode_1.hasNode)(state, listItem));
85
85
  };
86
86
  exports.canBeIndented = canBeIndented;
87
87
  var indent = function (state, dispatch) {
88
88
  var listItem = state.schema.nodes[indent_rules_1.indentRules.listsTypes.listItem];
89
- var isIndentableBlock = exports.canBeIndented(state, indent_rules_1.indentRules);
90
- if (exports.canIndentAsListItem(state, listItem)) {
91
- prosemirror_schema_list_1.sinkListItem(listItem)(state, dispatch);
89
+ var isIndentableBlock = (0, exports.canBeIndented)(state, indent_rules_1.indentRules);
90
+ if ((0, exports.canIndentAsListItem)(state, listItem)) {
91
+ (0, prosemirror_schema_list_1.sinkListItem)(listItem)(state, dispatch);
92
92
  }
93
93
  else if (isIndentableBlock) {
94
- exports.indentBlocks(indent_rules_1.indentRules.nodes)(state, dispatch);
94
+ (0, exports.indentBlocks)(indent_rules_1.indentRules.nodes)(state, dispatch);
95
95
  }
96
96
  };
97
97
  exports.indent = indent;
98
98
  var outdent = function (state, dispatch) {
99
99
  var nodes = state.schema.nodes;
100
100
  var listItem = nodes[indent_rules_1.outdentRules.listsTypes.listItem];
101
- var isIndentableBlock = exports.canBeIndented(state, indent_rules_1.outdentRules);
102
- if (blockNode_1.hasNode(state, nodes.blockquote)) {
103
- blockquote_1.liftBlockquote(state, dispatch);
101
+ var isIndentableBlock = (0, exports.canBeIndented)(state, indent_rules_1.outdentRules);
102
+ if ((0, blockNode_1.hasNode)(state, nodes.blockquote)) {
103
+ (0, blockquote_1.liftBlockquote)(state, dispatch);
104
104
  }
105
- else if (exports.canOutdentAsListItem(state, indent_rules_1.outdentRules)) {
106
- prosemirror_schema_list_1.liftListItem(listItem)(state, dispatch);
105
+ else if ((0, exports.canOutdentAsListItem)(state, indent_rules_1.outdentRules)) {
106
+ (0, prosemirror_schema_list_1.liftListItem)(listItem)(state, dispatch);
107
107
  }
108
108
  else if (isIndentableBlock) {
109
- exports.indentBlocks(indent_rules_1.outdentRules.nodes)(state, dispatch);
109
+ (0, exports.indentBlocks)(indent_rules_1.outdentRules.nodes)(state, dispatch);
110
110
  }
111
111
  };
112
112
  exports.outdent = outdent;
@@ -9,7 +9,7 @@ var mark_1 = require("./mark");
9
9
  var changeStyleFromMark = function (marks, toChange) {
10
10
  var styleMark = marks.find(function (m) { return m.type.name === 'style'; });
11
11
  var elementStyle = styleMark && styleMark.attrs.style;
12
- return utils_1.changeStylesString(elementStyle, toChange);
12
+ return (0, utils_1.changeStylesString)(elementStyle, toChange);
13
13
  };
14
14
  var changeStyleMark = function (tr, from, to, attrs, markType) {
15
15
  var mark = markType.create({ style: attrs.style });
@@ -24,7 +24,7 @@ var changeStyleMark = function (tr, from, to, attrs, markType) {
24
24
  var newStyle = changeStyleFromMark(marks, attrs);
25
25
  if (newStyle.changed || attrs.newValue) {
26
26
  var style = newStyle.changed ?
27
- { style: newStyle.style || null } : { style: [attrs.style] + ": " + attrs.newValue + ";" };
27
+ { style: newStyle.style || null } : { style: "".concat([attrs.style], ": ").concat(attrs.newValue, ";") };
28
28
  var currentMark = markType.isInSet(marks) ? marks.find(function (m) { return m.type.name === 'style'; }) : null;
29
29
  var newMarkAttrs_1 = currentMark ? tslib_1.__assign(tslib_1.__assign({}, currentMark.attrs), style) : style;
30
30
  var newStyleMark = markType.create(newMarkAttrs_1);
@@ -61,15 +61,15 @@ var changeStyleMark = function (tr, from, to, attrs, markType) {
61
61
  */
62
62
  var getInlineStyles = function (state, style) {
63
63
  var styleMark = state.schema.marks.style;
64
- var marks = styleMark ? mark_1.selectionMarks(state, styleMark) : [];
65
- return marks.map(function (mark) { return mark_1.styleValue(mark, style); }).filter(function (m) { return m !== null; });
64
+ var marks = styleMark ? (0, mark_1.selectionMarks)(state, styleMark) : [];
65
+ return marks.map(function (mark) { return (0, mark_1.styleValue)(mark, style); }).filter(function (m) { return m !== null; });
66
66
  };
67
67
  exports.getInlineStyles = getInlineStyles;
68
68
  var changeStyle = function (markType, attrs) {
69
69
  return function (state, dispatch, tr) {
70
70
  var _a = state.selection, empty = _a.empty, ranges = _a.ranges;
71
71
  var $cursor = state.selection instanceof prosemirror_state_1.TextSelection && state.selection.$cursor;
72
- if ((empty && !$cursor) || !mark_1.markApplies(state.doc, ranges, markType)) {
72
+ if ((empty && !$cursor) || !(0, mark_1.markApplies)(state.doc, ranges, markType)) {
73
73
  return false;
74
74
  }
75
75
  var result = false;
@@ -81,7 +81,7 @@ var changeStyle = function (markType, attrs) {
81
81
  var newStyle = changeStyleFromMark(currentMarks, attrs);
82
82
  var styleMark = currentMarks.find(function (m) { return m.type.name === 'style'; });
83
83
  var newAttrs_1 = tslib_1.__assign(tslib_1.__assign({}, (styleMark ? styleMark.attrs : {})), { style: newStyle.style || null });
84
- if (utils_1.shallowEqual(styleMark.attrs, newAttrs_1)) {
84
+ if ((0, utils_1.shallowEqual)(styleMark.attrs, newAttrs_1)) {
85
85
  return false;
86
86
  }
87
87
  dispatch(transaction.removeStoredMark(markType));
@@ -119,14 +119,14 @@ var toggleInlineFormat = function (options, tr, markAttrs) { return function (st
119
119
  var cmd = changeStyle(marks.style, { style: altStyle.name, value: altStyle.value });
120
120
  styleRemoved = cmd(state, markDispatched, transaction);
121
121
  }
122
- var allMarks = tslib_1.__spreadArray([mark], altMarks).filter(function (m) { return marks[m]; });
123
- var toRemove = allMarks.map(function (m) { return mark_1.hasMark(state, { mark: m }) && marks[m]; }).filter(function (m) { return m; });
122
+ var allMarks = tslib_1.__spreadArray([mark], altMarks, true).filter(function (m) { return marks[m]; });
123
+ var toRemove = allMarks.map(function (m) { return (0, mark_1.hasMark)(state, { mark: m }) && marks[m]; }).filter(function (m) { return m; });
124
124
  if (toRemove.length) {
125
- mark_1.removeMarks(toRemove, state, markDispatched, transaction);
125
+ (0, mark_1.removeMarks)(toRemove, state, markDispatched, transaction);
126
126
  }
127
127
  else {
128
128
  if (!styleRemoved) {
129
- mark_1.toggleMark(marks[mark], markAttrs, transaction)(state, markDispatched);
129
+ (0, mark_1.toggleMark)(marks[mark], markAttrs, transaction)(state, markDispatched);
130
130
  }
131
131
  }
132
132
  if (dispatched) {
@@ -150,7 +150,7 @@ var applyInlineStyle = function (options, command) { return function (state, dis
150
150
  }
151
151
  tr.setMeta('args', options);
152
152
  var _a = state.selection, empty = _a.empty, $cursor = _a.$cursor, ranges = _a.ranges;
153
- if ((empty && !$cursor) || !markType || !mark_1.markApplies(state.doc, ranges, markType)) {
153
+ if ((empty && !$cursor) || !markType || !(0, mark_1.markApplies)(state.doc, ranges, markType)) {
154
154
  return false;
155
155
  }
156
156
  // Empty selection
@@ -159,13 +159,13 @@ var applyInlineStyle = function (options, command) { return function (state, dis
159
159
  var currentMark = markType.isInSet(marksFromSelection) ? marksFromSelection.find(function (m) { return m.type.name === 'style'; }) : null;
160
160
  var newStyles = { style: null };
161
161
  if (currentMark && currentMark.attrs.style) {
162
- var resultStyles = utils_1.changeStylesString(currentMark.attrs.style, attrs);
162
+ var resultStyles = (0, utils_1.changeStylesString)(currentMark.attrs.style, attrs);
163
163
  if (resultStyles.changed && resultStyles.style) {
164
164
  newStyles.style = resultStyles.style;
165
165
  }
166
166
  }
167
167
  else if (attrs.newValue) {
168
- newStyles.style = [attrs.style] + ": " + attrs.newValue + ";";
168
+ newStyles.style = "".concat([attrs.style], ": ").concat(attrs.newValue, ";");
169
169
  }
170
170
  var newMarkAttrs_2 = currentMark ? tslib_1.__assign(tslib_1.__assign({}, currentMark.attrs), newStyles) : newStyles;
171
171
  if (Object.keys(newMarkAttrs_2).some(function (attrName) { return newMarkAttrs_2[attrName] !== null; })) {
package/dist/npm/link.js CHANGED
@@ -42,7 +42,7 @@ var modifyLink = function (options, tr) { return function (state, dispatch) {
42
42
  var removeLink = function (options, tr) { return function (state, dispatch) {
43
43
  var $cursor = state.selection.$cursor;
44
44
  if (!$cursor) {
45
- inline_style_1.toggleInlineFormat(options, tr)(state, dispatch);
45
+ (0, inline_style_1.toggleInlineFormat)(options, tr)(state, dispatch);
46
46
  }
47
47
  else {
48
48
  var parentNode = $cursor.parent;
@@ -63,7 +63,7 @@ var removeLink = function (options, tr) { return function (state, dispatch) {
63
63
  linkSize += parentNode.child(index).nodeSize;
64
64
  index += 1;
65
65
  }
66
- dispatch(mark_1.removeMark(tr || state.tr, linkStart, linkStart + linkSize, mark));
66
+ dispatch((0, mark_1.removeMark)(tr || state.tr, linkStart, linkStart + linkSize, mark));
67
67
  }
68
68
  }; };
69
69
  exports.removeLink = removeLink;
@@ -71,7 +71,7 @@ exports.removeLink = removeLink;
71
71
  * Returns a mark which wraps the selection.
72
72
  */
73
73
  var getParentMark = function (state, markType) {
74
- var marks = mark_1.selectionMarks(state, markType);
74
+ var marks = (0, mark_1.selectionMarks)(state, markType);
75
75
  return marks.length === 1 && marks[0] ? marks[0] : null;
76
76
  };
77
77
  var applyLink = function (_a, commandName) {
@@ -91,15 +91,15 @@ var applyLink = function (_a, commandName) {
91
91
  }
92
92
  else {
93
93
  var nextState = state;
94
- if (mark_1.hasMark(state, { mark: mark })) {
95
- exports.removeLink({ mark: mark, attrs: attrs }, tr)(state, markDispatched);
94
+ if ((0, mark_1.hasMark)(state, { mark: mark })) {
95
+ (0, exports.removeLink)({ mark: mark, attrs: attrs }, tr)(state, markDispatched);
96
96
  nextState = prosemirror_state_1.EditorState.create({ doc: tr.doc, selection: tr.selection });
97
97
  }
98
98
  if (dispatched) {
99
- mark_1.toggleMark(marks[mark], attrs, tr)(nextState, markDispatched);
99
+ (0, mark_1.toggleMark)(marks[mark], attrs, tr)(nextState, markDispatched);
100
100
  }
101
101
  else {
102
- inline_style_1.toggleInlineFormat({ mark: mark }, tr, attrs)(nextState, markDispatched);
102
+ (0, inline_style_1.toggleInlineFormat)({ mark: mark }, tr, attrs)(nextState, markDispatched);
103
103
  }
104
104
  }
105
105
  if (dispatched) {
@@ -5,7 +5,7 @@ var source_1 = require("./source");
5
5
  var msoListRegExp = /style=['"]?[^'"]*?mso-list:\s*[a-zA-Z]+(\d+)\s[a-zA-Z]+(\d+)\s(\w+)/gi;
6
6
  var extractListLevels = function (html) {
7
7
  html = html.replace(msoListRegExp, function (match, list, level) {
8
- return "datalist=\"" + list + "\" datalevel=\"" + level + "\" " + match;
8
+ return "datalist=\"".concat(list, "\" datalevel=\"").concat(level, "\" ").concat(match);
9
9
  });
10
10
  return html;
11
11
  };
@@ -117,7 +117,7 @@ var convertToLi = function (p) {
117
117
  }
118
118
  p.parentNode.removeChild(p);
119
119
  var li = document.createElement('li');
120
- li.appendChild(source_1.htmlToFragment(content));
120
+ li.appendChild((0, source_1.htmlToFragment)(content));
121
121
  return li;
122
122
  };
123
123
  var toList = function (blockNodes) {
@@ -180,10 +180,10 @@ var toList = function (blockNodes) {
180
180
  }
181
181
  };
182
182
  var convertMsLists = function (html) {
183
- var container = source_1.htmlToFragment(extractListLevels(html));
183
+ var container = (0, source_1.htmlToFragment)(extractListLevels(html));
184
184
  var groups = new Set();
185
185
  mapListsCandidates(container.children, groups);
186
186
  groups.forEach(function (listsCandidates) { return toList(listsCandidates); });
187
- return source_1.fragmentToHtml(container);
187
+ return (0, source_1.fragmentToHtml)(container);
188
188
  };
189
189
  exports.convertMsLists = convertMsLists;
@@ -2,7 +2,7 @@ import { NodeType, Node } from 'prosemirror-model';
2
2
  import { EditorState, Transaction } from 'prosemirror-state';
3
3
  import { EditorView } from 'prosemirror-view';
4
4
  import { Command } from './types/command';
5
- declare type ListOptions = {
5
+ type ListOptions = {
6
6
  listType: string;
7
7
  orderedList: string;
8
8
  bulletList: string;
@@ -11,6 +11,7 @@ declare type ListOptions = {
11
11
  };
12
12
  /**
13
13
  * Extracts list-style-type style from node's attributes.
14
+ *
14
15
  * @param attrs - The attributes of the list node
15
16
  * @returns The extracted list-style-type.
16
17
  */
package/dist/npm/lists.js CHANGED
@@ -109,7 +109,7 @@ function liftListItem(state, selection, tr, nodeType) {
109
109
  tr.step(new prosemirror_transform_1.ReplaceAroundStep(end - 1, endOfList, end, endOfList, new prosemirror_model_1.Slice(prosemirror_model_1.Fragment.from(listItemNodeType.create(undefined, range.parent.copy())), 1, 0), 1, true));
110
110
  range = new prosemirror_model_1.NodeRange(tr.doc.resolve($from.pos), tr.doc.resolve(endOfList), range.depth);
111
111
  }
112
- return tr.lift(range, prosemirror_transform_1.liftTarget(range)).scrollIntoView();
112
+ return tr.lift(range, (0, prosemirror_transform_1.liftTarget)(range)).scrollIntoView();
113
113
  }
114
114
  function liftFollowingList(state, from, to, rootListDepthNum, tr, listItem) {
115
115
  // Function will lift list item following selection to level-1.
@@ -139,7 +139,7 @@ function isRangeOfType(doc, $from, $to, nodeType) {
139
139
  }
140
140
  function getAncestorNodesBetween(doc, $from, $to) {
141
141
  // Returns all top-level ancestor-nodes between $from and $to
142
- var nodes = Array();
142
+ var nodes = [];
143
143
  var maxDepth = findAncestorPosition(doc, $from).depth;
144
144
  var current = doc.resolve($from.start(maxDepth));
145
145
  while (current.pos <= $to.start($to.depth)) {
@@ -197,7 +197,7 @@ function liftListItems(options) {
197
197
  if (!range || sel.$from.parent.type !== state.schema.nodes[options.listItem]) {
198
198
  return false;
199
199
  }
200
- var target = range && prosemirror_transform_1.liftTarget(range);
200
+ var target = range && (0, prosemirror_transform_1.liftTarget)(range);
201
201
  if (target === undefined || target === null) {
202
202
  return false;
203
203
  }
@@ -212,11 +212,12 @@ function liftListItems(options) {
212
212
  }
213
213
  function wrapInList(nodeType, attrs) {
214
214
  if (attrs === void 0) { attrs = {}; }
215
- return prosemirror_commands_1.autoJoin(prosemirror_schema_list_1.wrapInList(nodeType, attrs), function (before, after) { return before.type === after.type && before.type === nodeType; });
215
+ return (0, prosemirror_commands_1.autoJoin)((0, prosemirror_schema_list_1.wrapInList)(nodeType, attrs), function (before, after) { return before.type === after.type && before.type === nodeType; });
216
216
  }
217
217
  var reListStyle = /list\-style\-type:\s?([\w-]+)/;
218
218
  /**
219
219
  * Extracts list-style-type style from node's attributes.
220
+ *
220
221
  * @param attrs - The attributes of the list node
221
222
  * @returns The extracted list-style-type.
222
223
  */
@@ -231,8 +232,8 @@ var toggleList = function (state, dispatch, view, options, command) {
231
232
  var selection = state.selection;
232
233
  var fromNode = selection.$from.node(selection.$from.depth - 2);
233
234
  var endNode = selection.$to.node(selection.$to.depth - 2);
234
- if (!fromNode || fromNode.type.name !== listType || exports.listStyle(fromNode.attrs) !== exports.listStyle(listAttrs) ||
235
- (!endNode || endNode.type.name !== listType || exports.listStyle(endNode.attrs) !== exports.listStyle(listAttrs))) {
235
+ if (!fromNode || fromNode.type.name !== listType || (0, exports.listStyle)(fromNode.attrs) !== (0, exports.listStyle)(listAttrs) ||
236
+ (!endNode || endNode.type.name !== listType || (0, exports.listStyle)(endNode.attrs) !== (0, exports.listStyle)(listAttrs))) {
236
237
  return toggleListCommand(options)(state, dispatch, view);
237
238
  }
238
239
  else {
@@ -252,16 +253,16 @@ var toggleList = function (state, dispatch, view, options, command) {
252
253
  };
253
254
  exports.toggleList = toggleList;
254
255
  function toggleUnorderedList(state, dispatch, view) {
255
- return exports.toggleList(state, dispatch, view, tslib_1.__assign({ listType: list_settings_1.bulletList.listType }, list_settings_1.bulletList.types));
256
+ return (0, exports.toggleList)(state, dispatch, view, tslib_1.__assign({ listType: list_settings_1.bulletList.listType }, list_settings_1.bulletList.types));
256
257
  }
257
258
  exports.toggleUnorderedList = toggleUnorderedList;
258
259
  function toggleOrderedList(state, dispatch, view) {
259
- return exports.toggleList(state, dispatch, view, tslib_1.__assign({ listType: list_settings_1.orderedList.listType }, list_settings_1.orderedList.types));
260
+ return (0, exports.toggleList)(state, dispatch, view, tslib_1.__assign({ listType: list_settings_1.orderedList.listType }, list_settings_1.orderedList.types));
260
261
  }
261
262
  exports.toggleOrderedList = toggleOrderedList;
262
263
  var splitListItemKeepMarks = function (itemType) { return function (state, dispatch) {
263
264
  // see https://github.com/ProseMirror/prosemirror-commands/blob/master/src/commands.js#L321-L327
264
- return prosemirror_schema_list_1.splitListItem(itemType)(state, function (tr) {
265
+ return (0, prosemirror_schema_list_1.splitListItem)(itemType)(state, function (tr) {
265
266
  var marks = state.storedMarks || (state.selection.$to.parentOffset && state.selection.$from.marks());
266
267
  if (marks) {
267
268
  tr.ensureMarks(marks);