@progress/kendo-editor-common 1.11.9-dev.202412020819 → 1.11.9-develop.2

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 (185) hide show
  1. package/dist/cdn/main.js +1 -1
  2. package/dist/es/DOMSerializer.js +71 -75
  3. package/dist/es/align.js +19 -16
  4. package/dist/es/blockNode.js +76 -78
  5. package/dist/es/blockquote.js +12 -9
  6. package/dist/es/cleanFormatting.js +16 -16
  7. package/dist/es/config/align-rules.js +8 -6
  8. package/dist/es/config/commands.js +9 -13
  9. package/dist/es/config/constants.js +9 -7
  10. package/dist/es/config/indent-rules.js +8 -6
  11. package/dist/es/config/keymap.js +20 -18
  12. package/dist/es/config/list-settings.js +7 -6
  13. package/dist/es/config/schema.js +184 -126
  14. package/dist/es/find-replace.js +34 -32
  15. package/dist/es/image.js +10 -7
  16. package/dist/es/indent.js +47 -44
  17. package/dist/es/inline-style.js +72 -70
  18. package/dist/es/link.js +51 -52
  19. package/dist/es/listConvert.js +37 -34
  20. package/dist/es/lists.js +83 -82
  21. package/dist/es/main.js +32 -33
  22. package/dist/es/mark.js +87 -92
  23. package/dist/es/paste.js +48 -46
  24. package/dist/es/plugins/caret-color.js +14 -11
  25. package/dist/es/plugins/csp-fix.js +23 -23
  26. package/dist/es/plugins/highlight.js +12 -10
  27. package/dist/es/plugins/image-resize.js +81 -81
  28. package/dist/es/plugins/list-markers-styles.js +43 -39
  29. package/dist/es/plugins/placeholder.js +12 -9
  30. package/dist/es/plugins/resize-utils.js +11 -9
  31. package/dist/es/plugins/spaces-fix.js +13 -10
  32. package/dist/es/plugins/table-resize/column-resize.js +104 -102
  33. package/dist/es/plugins/table-resize/index.js +10 -7
  34. package/dist/es/plugins/table-resize/row-resize.js +88 -89
  35. package/dist/es/plugins/table-resize/table-resize.js +129 -122
  36. package/dist/es/plugins/table-resize/table-view.js +46 -48
  37. package/dist/es/plugins/table-resize/utils.js +39 -41
  38. package/dist/es/source.js +78 -74
  39. package/dist/es/table.js +64 -66
  40. package/dist/es/text.js +4 -2
  41. package/dist/es/utils.js +107 -116
  42. package/dist/es2015/DOMSerializer.js +20 -17
  43. package/dist/es2015/align.js +6 -3
  44. package/dist/es2015/blockNode.js +15 -12
  45. package/dist/es2015/blockquote.js +5 -2
  46. package/dist/es2015/cleanFormatting.js +6 -3
  47. package/dist/es2015/config/align-rules.js +7 -5
  48. package/dist/es2015/config/commands.js +9 -13
  49. package/dist/es2015/config/constants.js +9 -7
  50. package/dist/es2015/config/indent-rules.js +6 -3
  51. package/dist/es2015/config/keymap.js +10 -7
  52. package/dist/es2015/config/list-settings.js +5 -3
  53. package/dist/es2015/config/schema.js +8 -6
  54. package/dist/es2015/find-replace.js +9 -6
  55. package/dist/es2015/image.js +5 -2
  56. package/dist/es2015/indent.js +14 -11
  57. package/dist/es2015/inline-style.js +9 -6
  58. package/dist/es2015/link.js +7 -4
  59. package/dist/es2015/listConvert.js +5 -2
  60. package/dist/es2015/lists.js +14 -11
  61. package/dist/es2015/main.js +32 -33
  62. package/dist/es2015/mark.js +15 -12
  63. package/dist/es2015/node_modules/tslib/tslib.es6.js +35 -0
  64. package/dist/es2015/paste.js +14 -11
  65. package/dist/es2015/plugins/caret-color.js +8 -5
  66. package/dist/es2015/plugins/csp-fix.js +5 -2
  67. package/dist/es2015/plugins/highlight.js +6 -3
  68. package/dist/es2015/plugins/image-resize.js +10 -7
  69. package/dist/es2015/plugins/list-markers-styles.js +6 -3
  70. package/dist/es2015/plugins/placeholder.js +5 -2
  71. package/dist/es2015/plugins/resize-utils.js +11 -9
  72. package/dist/es2015/plugins/spaces-fix.js +4 -1
  73. package/dist/es2015/plugins/table-resize/column-resize.js +24 -21
  74. package/dist/es2015/plugins/table-resize/index.js +9 -6
  75. package/dist/es2015/plugins/table-resize/row-resize.js +23 -20
  76. package/dist/es2015/plugins/table-resize/table-resize.js +20 -17
  77. package/dist/es2015/plugins/table-resize/table-view.js +9 -6
  78. package/dist/es2015/plugins/table-resize/utils.js +13 -10
  79. package/dist/es2015/source.js +24 -13
  80. package/dist/es2015/table.js +18 -15
  81. package/dist/es2015/text.js +3 -1
  82. package/dist/es2015/utils.js +22 -25
  83. package/dist/npm/DOMSerializer.js +73 -78
  84. package/dist/npm/align.d.ts +7 -4
  85. package/dist/npm/align.js +22 -21
  86. package/dist/npm/blockNode.d.ts +14 -15
  87. package/dist/npm/blockNode.js +91 -95
  88. package/dist/npm/blockquote.d.ts +5 -2
  89. package/dist/npm/blockquote.js +16 -15
  90. package/dist/npm/cleanFormatting.d.ts +6 -3
  91. package/dist/npm/cleanFormatting.js +17 -19
  92. package/dist/npm/config/align-rules.d.ts +8 -6
  93. package/dist/npm/config/align-rules.js +14 -9
  94. package/dist/npm/config/commands.d.ts +11 -19
  95. package/dist/npm/config/commands.js +17 -16
  96. package/dist/npm/config/constants.js +17 -10
  97. package/dist/npm/config/indent-rules.d.ts +6 -4
  98. package/dist/npm/config/indent-rules.js +11 -9
  99. package/dist/npm/config/keymap.d.ts +5 -2
  100. package/dist/npm/config/keymap.js +30 -30
  101. package/dist/npm/config/list-settings.js +13 -11
  102. package/dist/npm/config/schema.d.ts +4 -3
  103. package/dist/npm/config/schema.js +191 -134
  104. package/dist/npm/find-replace.d.ts +10 -7
  105. package/dist/npm/find-replace.js +47 -47
  106. package/dist/npm/image.d.ts +6 -3
  107. package/dist/npm/image.js +11 -10
  108. package/dist/npm/indent.d.ts +12 -9
  109. package/dist/npm/indent.js +68 -67
  110. package/dist/npm/inline-style.d.ts +7 -4
  111. package/dist/npm/inline-style.js +83 -83
  112. package/dist/npm/link.d.ts +4 -2
  113. package/dist/npm/link.js +58 -61
  114. package/dist/npm/listConvert.d.ts +3 -1
  115. package/dist/npm/listConvert.js +40 -39
  116. package/dist/npm/lists.d.ts +9 -9
  117. package/dist/npm/lists.js +94 -95
  118. package/dist/npm/main.d.ts +34 -33
  119. package/dist/npm/main.js +389 -198
  120. package/dist/npm/mark.d.ts +13 -18
  121. package/dist/npm/mark.js +104 -111
  122. package/dist/npm/paste.d.ts +12 -9
  123. package/dist/npm/paste.js +61 -61
  124. package/dist/npm/plugins/caret-color.d.ts +6 -3
  125. package/dist/npm/plugins/caret-color.js +21 -19
  126. package/dist/npm/plugins/csp-fix.d.ts +4 -1
  127. package/dist/npm/plugins/csp-fix.js +28 -30
  128. package/dist/npm/plugins/highlight.d.ts +7 -4
  129. package/dist/npm/plugins/highlight.js +17 -16
  130. package/dist/npm/plugins/image-resize.d.ts +7 -5
  131. package/dist/npm/plugins/image-resize.js +96 -97
  132. package/dist/npm/plugins/list-markers-styles.d.ts +5 -2
  133. package/dist/npm/plugins/list-markers-styles.js +49 -47
  134. package/dist/npm/plugins/placeholder.d.ts +4 -1
  135. package/dist/npm/plugins/placeholder.js +18 -17
  136. package/dist/npm/plugins/resize-utils.js +14 -12
  137. package/dist/npm/plugins/spaces-fix.d.ts +4 -1
  138. package/dist/npm/plugins/spaces-fix.js +19 -18
  139. package/dist/npm/plugins/table-resize/column-resize.js +117 -117
  140. package/dist/npm/plugins/table-resize/index.d.ts +5 -2
  141. package/dist/npm/plugins/table-resize/index.js +16 -15
  142. package/dist/npm/plugins/table-resize/row-resize.js +98 -101
  143. package/dist/npm/plugins/table-resize/table-resize.js +144 -139
  144. package/dist/npm/plugins/table-resize/table-view.js +59 -61
  145. package/dist/npm/plugins/table-resize/utils.d.ts +7 -17
  146. package/dist/npm/plugins/table-resize/utils.js +51 -52
  147. package/dist/npm/source.d.ts +18 -11
  148. package/dist/npm/source.js +94 -91
  149. package/dist/npm/table.d.ts +10 -9
  150. package/dist/npm/table.js +93 -82
  151. package/dist/npm/text.d.ts +6 -3
  152. package/dist/npm/text.js +5 -5
  153. package/dist/npm/types/active-marks.d.ts +4 -1
  154. package/dist/npm/types/command.d.ts +5 -2
  155. package/dist/npm/types/dispatchFn.d.ts +4 -1
  156. package/dist/npm/types/paste-cleanup-settings.d.ts +3 -1
  157. package/dist/npm/utils.d.ts +14 -29
  158. package/dist/npm/utils.js +133 -145
  159. package/package.json +35 -53
  160. package/dist/cdn/js/kendo-editor-common.js +0 -1
  161. package/dist/es/types/active-marks.js +0 -1
  162. package/dist/es/types/command.js +0 -1
  163. package/dist/es/types/dispatchFn.js +0 -1
  164. package/dist/es/types/paste-cleanup-settings.js +0 -1
  165. package/dist/es/types/predicate.js +0 -1
  166. package/dist/es2015/types/active-marks.js +0 -1
  167. package/dist/es2015/types/command.js +0 -1
  168. package/dist/es2015/types/dispatchFn.js +0 -1
  169. package/dist/es2015/types/paste-cleanup-settings.js +0 -1
  170. package/dist/es2015/types/predicate.js +0 -1
  171. package/dist/npm/DOMSerializer.d.ts +0 -35
  172. package/dist/npm/config/constants.d.ts +0 -7
  173. package/dist/npm/config/list-settings.d.ts +0 -30
  174. package/dist/npm/plugins/resize-utils.d.ts +0 -35
  175. package/dist/npm/plugins/table-resize/column-resize.d.ts +0 -2
  176. package/dist/npm/plugins/table-resize/row-resize.d.ts +0 -2
  177. package/dist/npm/plugins/table-resize/table-resize.d.ts +0 -18
  178. package/dist/npm/plugins/table-resize/table-view.d.ts +0 -28
  179. package/dist/npm/types/active-marks.js +0 -2
  180. package/dist/npm/types/command.js +0 -2
  181. package/dist/npm/types/dispatchFn.js +0 -2
  182. package/dist/npm/types/paste-cleanup-settings.js +0 -2
  183. package/dist/npm/types/predicate.d.ts +0 -1
  184. package/dist/npm/types/predicate.js +0 -2
  185. package/dist/systemjs/kendo-editor-common.js +0 -1
package/dist/npm/table.js CHANGED
@@ -1,147 +1,158 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.pmDeleteColumn = exports.pmAddColumnAfter = exports.pmAddColumnBefore = exports.pmAddRowAfter = exports.pmAddRowBefore = exports.deleteColumn = exports.addColumnAfter = exports.addColumnBefore = exports.addRowAfter = exports.addRowBefore = exports.createTable = void 0;
4
- var tslib_1 = require("tslib");
5
- var prosemirror_tables_1 = require("prosemirror-tables");
6
- Object.defineProperty(exports, "pmAddRowAfter", { enumerable: true, get: function () { return prosemirror_tables_1.addRowAfter; } });
7
- Object.defineProperty(exports, "pmAddRowBefore", { enumerable: true, get: function () { return prosemirror_tables_1.addRowBefore; } });
8
- Object.defineProperty(exports, "pmAddColumnBefore", { enumerable: true, get: function () { return prosemirror_tables_1.addColumnBefore; } });
9
- Object.defineProperty(exports, "pmAddColumnAfter", { enumerable: true, get: function () { return prosemirror_tables_1.addColumnAfter; } });
10
- Object.defineProperty(exports, "pmDeleteColumn", { enumerable: true, get: function () { return prosemirror_tables_1.deleteColumn; } });
11
- var constants_1 = require("./config/constants");
12
- var schema_1 = require("./config/schema");
1
+ 'use strict';
2
+
3
+ var prosemirrorTables = require('prosemirror-tables');
4
+ var constants = require('./config/constants.js');
5
+ var schema = require('./config/schema.js');
6
+
13
7
  /**
14
8
  * Creates a table.
15
9
  *
16
10
  * @returns Node
17
11
  */
18
- var createTable = function (nodes, rows, columns) {
19
- var table = nodes.table, table_row = nodes.table_row, table_cell = nodes.table_cell;
20
- var tableRows = [];
21
- var cells;
22
- for (var r = 0; r < rows + 1; r++) {
12
+ const createTable = (nodes, rows, columns) => {
13
+ const { table, table_row, table_cell } = nodes;
14
+ const tableRows = [];
15
+ let cells;
16
+ for (let r = 0; r < rows + 1; r++) {
23
17
  cells = [];
24
- for (var c = 0; c < columns + 1; c++) {
18
+ for (let c = 0; c < columns + 1; c++) {
25
19
  cells.push(table_cell.createAndFill());
26
20
  }
27
21
  tableRows.push(table_row.createAndFill(undefined, cells));
28
22
  }
29
23
  return table.createAndFill(undefined, tableRows);
30
24
  };
31
- exports.createTable = createTable;
32
- var reTable = /^table$/;
33
- var reRow = /^table_row$/;
34
- var reCell = /^table_cell|table_header$/;
35
- var closest = function (selection, name) {
36
- var pos = selection.$head;
37
- for (var i = pos.depth; i > 0; i--) {
38
- var node = pos.node(i);
25
+ const reTable = /^table$/;
26
+ const reRow = /^table_row$/;
27
+ const reCell = /^table_cell|table_header$/;
28
+ const closest = (selection, name) => {
29
+ const pos = selection.$head;
30
+ for (let i = pos.depth; i > 0; i--) {
31
+ const node = pos.node(i);
39
32
  if (name.test(node.type.name)) {
40
33
  return {
41
34
  pos: pos.before(i),
42
- node: node
35
+ node
43
36
  };
44
37
  }
45
38
  }
46
39
  return null;
47
40
  };
48
- var addRowBefore = function (state, dispatch) {
49
- var cmdDispatch = dispatch && (function (tr) {
50
- var _a;
51
- var row = closest(tr.selection, reRow);
52
- var table = closest(tr.selection, reTable);
53
- if (row && table && row.node.attrs[constants_1.rowTypeAttr]) {
54
- var index = 0;
55
- for (var i = 0; i < table.node.nodeSize; i++) {
41
+ const addRowBefore = (state, dispatch) => {
42
+ const cmdDispatch = dispatch && (tr => {
43
+ const row = closest(tr.selection, reRow);
44
+ const table = closest(tr.selection, reTable);
45
+ if (row && table && row.node.attrs[constants.rowTypeAttr]) {
46
+ let index = 0;
47
+ for (let i = 0; i < table.node.nodeSize; i++) {
56
48
  if (table.node.child(i).eq(row.node)) {
57
49
  index = i;
58
50
  break;
59
51
  }
60
52
  }
61
- var next = table.node.child(index - 1);
62
- var from = row.pos - next.nodeSize;
63
- tr.setNodeMarkup(from, undefined, (_a = {}, _a[constants_1.rowTypeAttr] = row.node.attrs[constants_1.rowTypeAttr], _a));
53
+ const next = table.node.child(index - 1);
54
+ const from = row.pos - next.nodeSize;
55
+ tr.setNodeMarkup(from, undefined, { [constants.rowTypeAttr]: row.node.attrs[constants.rowTypeAttr] });
64
56
  }
65
57
  return dispatch(tr);
66
58
  });
67
- return (0, prosemirror_tables_1.addRowBefore)(state, cmdDispatch);
59
+ return prosemirrorTables.addRowBefore(state, cmdDispatch);
68
60
  };
69
- exports.addRowBefore = addRowBefore;
70
- var addRowAfter = function (state, dispatch) {
71
- var cmdDispatch = dispatch && (function (tr) {
72
- var _a;
73
- var row = closest(tr.selection, reRow);
74
- if (row && row.node.attrs[constants_1.rowTypeAttr]) {
75
- var from = row.pos + row.node.nodeSize;
76
- tr.setNodeMarkup(from, undefined, (_a = {}, _a[constants_1.rowTypeAttr] = row.node.attrs[constants_1.rowTypeAttr], _a));
61
+ const addRowAfter = (state, dispatch) => {
62
+ const cmdDispatch = dispatch && (tr => {
63
+ const row = closest(tr.selection, reRow);
64
+ if (row && row.node.attrs[constants.rowTypeAttr]) {
65
+ const from = row.pos + row.node.nodeSize;
66
+ tr.setNodeMarkup(from, undefined, { [constants.rowTypeAttr]: row.node.attrs[constants.rowTypeAttr] });
77
67
  }
78
68
  return dispatch(tr);
79
69
  });
80
- return (0, prosemirror_tables_1.addRowAfter)(state, cmdDispatch);
70
+ return prosemirrorTables.addRowAfter(state, cmdDispatch);
81
71
  };
82
- exports.addRowAfter = addRowAfter;
83
- var columnIndex = function (table, selection) {
72
+ const columnIndex = (table, selection) => {
84
73
  if (!table) {
85
74
  return -1;
86
75
  }
87
- var map = prosemirror_tables_1.TableMap.get(table.node);
88
- var tableCell = closest(selection, reCell);
89
- var idx = map.map.indexOf(tableCell.pos - table.pos - 1);
90
- var colIndex = -1;
76
+ const map = prosemirrorTables.TableMap.get(table.node);
77
+ const tableCell = closest(selection, reCell);
78
+ const idx = map.map.indexOf(tableCell.pos - table.pos - 1);
79
+ let colIndex = -1;
91
80
  if (idx !== -1) {
92
81
  colIndex = idx % map.width;
93
82
  }
94
83
  return colIndex;
95
84
  };
96
- var addCol = function (tr, table, to) {
97
- var _a;
98
- var colIndex = columnIndex(table, tr.selection);
99
- var colgroup = (0, schema_1.parseStrColgroup)(table.node.attrs[constants_1.colgroupAttr]);
85
+ const addCol = (tr, table, to) => {
86
+ const colIndex = columnIndex(table, tr.selection);
87
+ const colgroup = schema.parseStrColgroup(table.node.attrs[constants.colgroupAttr]);
100
88
  colgroup.insertBefore(colgroup.ownerDocument.createElement('col'), colgroup.children[colIndex + to]);
101
- tr.setNodeMarkup(table.pos, null, tslib_1.__assign(tslib_1.__assign({}, table.node.attrs), (_a = {}, _a[constants_1.colgroupAttr] = colgroup.outerHTML, _a)));
89
+ tr.setNodeMarkup(table.pos, null, { ...table.node.attrs, [constants.colgroupAttr]: colgroup.outerHTML });
102
90
  };
103
- var deleteCol = function (tr, table, colIndex) {
104
- var _a;
105
- var colgroup = (0, schema_1.parseStrColgroup)(table.node.attrs[constants_1.colgroupAttr]);
91
+ const deleteCol = (tr, table, colIndex) => {
92
+ const colgroup = schema.parseStrColgroup(table.node.attrs[constants.colgroupAttr]);
106
93
  colgroup.removeChild(colgroup.children[colIndex]);
107
- tr.setNodeMarkup(table.pos, null, tslib_1.__assign(tslib_1.__assign({}, table.node.attrs), (_a = {}, _a[constants_1.colgroupAttr] = colgroup.outerHTML, _a)));
94
+ tr.setNodeMarkup(table.pos, null, { ...table.node.attrs, [constants.colgroupAttr]: colgroup.outerHTML });
108
95
  };
109
- var addColumnBefore = function (state, dispatch) {
110
- var cmdDispatch = dispatch && (function (tr) {
111
- var table = closest(tr.selection, reTable);
112
- if (!table.node.attrs[constants_1.colgroupAttr]) {
96
+ const addColumnBefore = (state, dispatch) => {
97
+ const cmdDispatch = dispatch && (tr => {
98
+ const table = closest(tr.selection, reTable);
99
+ if (!table.node.attrs[constants.colgroupAttr]) {
113
100
  return dispatch(tr);
114
101
  }
115
102
  addCol(tr, table, -1);
116
103
  return dispatch(tr);
117
104
  });
118
- return (0, prosemirror_tables_1.addColumnBefore)(state, cmdDispatch);
105
+ return prosemirrorTables.addColumnBefore(state, cmdDispatch);
119
106
  };
120
- exports.addColumnBefore = addColumnBefore;
121
- var addColumnAfter = function (state, dispatch) {
122
- var cmdDispatch = dispatch && (function (tr) {
123
- var table = closest(tr.selection, reTable);
124
- if (!table.node.attrs[constants_1.colgroupAttr]) {
107
+ const addColumnAfter = (state, dispatch) => {
108
+ const cmdDispatch = dispatch && (tr => {
109
+ const table = closest(tr.selection, reTable);
110
+ if (!table.node.attrs[constants.colgroupAttr]) {
125
111
  return dispatch(tr);
126
112
  }
127
113
  addCol(tr, table, 1);
128
114
  return dispatch(tr);
129
115
  });
130
- return (0, prosemirror_tables_1.addColumnAfter)(state, cmdDispatch);
116
+ return prosemirrorTables.addColumnAfter(state, cmdDispatch);
131
117
  };
132
- exports.addColumnAfter = addColumnAfter;
133
- var deleteColumn = function (state, dispatch) {
134
- var parentTable = closest(state.selection, reTable);
135
- var colgroup = parentTable && parentTable.node.attrs[constants_1.colgroupAttr];
136
- var colIndex = columnIndex(parentTable, state.selection);
137
- var cmdDispatch = dispatch && (function (tr) {
118
+ const deleteColumn = (state, dispatch) => {
119
+ const parentTable = closest(state.selection, reTable);
120
+ const colgroup = parentTable && parentTable.node.attrs[constants.colgroupAttr];
121
+ const colIndex = columnIndex(parentTable, state.selection);
122
+ const cmdDispatch = dispatch && ((tr) => {
138
123
  if (!colgroup) {
139
124
  return dispatch(tr);
140
125
  }
141
- var table = tr.doc.nodeAt(parentTable.pos);
126
+ const table = tr.doc.nodeAt(parentTable.pos);
142
127
  deleteCol(tr, { node: table, pos: parentTable.pos }, colIndex);
143
128
  return dispatch(tr);
144
129
  });
145
- return (0, prosemirror_tables_1.deleteColumn)(state, cmdDispatch);
130
+ return prosemirrorTables.deleteColumn(state, cmdDispatch);
146
131
  };
132
+
133
+ Object.defineProperty(exports, "pmAddColumnAfter", {
134
+ enumerable: true,
135
+ get: function () { return prosemirrorTables.addColumnAfter; }
136
+ });
137
+ Object.defineProperty(exports, "pmAddColumnBefore", {
138
+ enumerable: true,
139
+ get: function () { return prosemirrorTables.addColumnBefore; }
140
+ });
141
+ Object.defineProperty(exports, "pmAddRowAfter", {
142
+ enumerable: true,
143
+ get: function () { return prosemirrorTables.addRowAfter; }
144
+ });
145
+ Object.defineProperty(exports, "pmAddRowBefore", {
146
+ enumerable: true,
147
+ get: function () { return prosemirrorTables.addRowBefore; }
148
+ });
149
+ Object.defineProperty(exports, "pmDeleteColumn", {
150
+ enumerable: true,
151
+ get: function () { return prosemirrorTables.deleteColumn; }
152
+ });
153
+ exports.addColumnAfter = addColumnAfter;
154
+ exports.addColumnBefore = addColumnBefore;
155
+ exports.addRowAfter = addRowAfter;
156
+ exports.addRowBefore = addRowBefore;
157
+ exports.createTable = createTable;
147
158
  exports.deleteColumn = deleteColumn;
@@ -1,7 +1,10 @@
1
- import { Command } from './types/command';
2
- export interface TextData {
1
+ import { Command } from './types/command.js';
2
+
3
+ interface TextData {
3
4
  text: string;
4
5
  from?: number;
5
6
  to?: number;
6
7
  }
7
- export declare const insertText: (attrs: TextData) => Command;
8
+ declare const insertText: (attrs: TextData) => Command;
9
+
10
+ export { type TextData, insertText };
package/dist/npm/text.js CHANGED
@@ -1,7 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.insertText = void 0;
4
- var insertText = function (attrs) { return function (state, dispatch) {
1
+ 'use strict';
2
+
3
+ const insertText = (attrs) => (state, dispatch) => {
5
4
  dispatch(state.tr.insertText(attrs.text, attrs.from, attrs.to));
6
- }; };
5
+ };
6
+
7
7
  exports.insertText = insertText;
@@ -1,5 +1,8 @@
1
1
  import { Mark } from 'prosemirror-model';
2
- export interface ActiveMarks {
2
+
3
+ interface ActiveMarks {
3
4
  marks: Mark[];
4
5
  hasNodesWithoutMarks: boolean;
5
6
  }
7
+
8
+ export type { ActiveMarks };
@@ -1,4 +1,7 @@
1
1
  import { EditorState } from 'prosemirror-state';
2
2
  import { EditorView } from 'prosemirror-view';
3
- import { DispatchFn } from './dispatchFn';
4
- export declare type Command = (state: EditorState, dispatch: DispatchFn, view?: EditorView) => boolean | void;
3
+ import { DispatchFn } from './dispatchFn.js';
4
+
5
+ type Command = (state: EditorState, dispatch: DispatchFn, view?: EditorView) => boolean | void;
6
+
7
+ export type { Command };
@@ -1,2 +1,5 @@
1
1
  import { Transaction } from 'prosemirror-state';
2
- export declare type DispatchFn = (tr: Transaction) => void;
2
+
3
+ type DispatchFn = (tr: Transaction) => void;
4
+
5
+ export type { DispatchFn };
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * The settings passed to the `pasteCleanup` function.
3
3
  */
4
- export interface PasteCleanupSettings {
4
+ interface PasteCleanupSettings {
5
5
  /**
6
6
  * If set to `true`, converts the MS Word lists into HTML lists.
7
7
  */
@@ -18,3 +18,5 @@ export interface PasteCleanupSettings {
18
18
  [attributeName: string]: (attr: Attr) => void;
19
19
  };
20
20
  }
21
+
22
+ export type { PasteCleanupSettings };
@@ -1,31 +1,21 @@
1
- import { Node, NodeType, ParseOptions, Schema, ResolvedPos } from 'prosemirror-model';
1
+ import { NodeType, ResolvedPos, Node } from 'prosemirror-model';
2
2
  import { EditorState } from 'prosemirror-state';
3
- import { Command } from './types/command';
4
- export declare const changeStylesString: (styleText: string, newStyle: {
5
- style: string;
6
- value: RegExp;
7
- newValue?: string;
8
- }) => {
9
- changed: boolean;
10
- style: string | null;
11
- };
12
- export declare function setNodeStyle(nodeAttrs: any, styleType: string, value: string): any;
3
+ import { Command } from './types/command.js';
4
+
13
5
  /**
14
6
  * Determines if a given node type can be inserted at the current cursor position.
15
7
  */
16
- export declare const canInsert: (state: EditorState, nodeType: NodeType) => boolean;
17
- export declare const findNthParentNodeOfType: (nodeType: NodeType, depth?: number) => Function;
18
- export declare function parentNode(pos: ResolvedPos, predicate: (node: Node) => boolean): {
8
+ declare const canInsert: (state: EditorState, nodeType: NodeType) => boolean;
9
+ declare function parentNode(pos: ResolvedPos, predicate: (node: Node) => boolean): {
19
10
  node: Node;
20
11
  depth: number;
21
12
  } | null;
22
13
  /**
23
14
  * Inserts the given node at the place of current selection.
24
15
  */
25
- export declare const insertNode: (node: Node, scrollIntoView?: boolean) => Command;
26
- export declare const hasSameMarkup: (dom1: string, dom2: string, schema: Schema, parseOptions?: ParseOptions) => boolean;
27
- export declare const getSelectionText: (state: EditorState) => string;
28
- export declare const getNodeFromSelection: (state: EditorState) => Node;
16
+ declare const insertNode: (node: Node, scrollIntoView?: boolean) => Command;
17
+ declare const getSelectionText: (state: EditorState) => string;
18
+ declare const getNodeFromSelection: (state: EditorState) => Node;
29
19
  /**
30
20
  * Returns the text from the selection if only text is selected on a single line.
31
21
  * If selection contains leaf nodes (br, image) between text elements or
@@ -34,17 +24,16 @@ export declare const getNodeFromSelection: (state: EditorState) => Node;
34
24
  * Useful for values of the inputs of Link and Find&Replace dialogs where the inputs value has been retrieved from the selection and
35
25
  * should be single line text only.
36
26
  */
37
- export declare const selectedLineTextOnly: (state: EditorState) => string;
27
+ declare const selectedLineTextOnly: (state: EditorState) => string;
38
28
  /**
39
29
  * Used by ViewHtml/ViewSource dialogs for making the HTML more readable.
40
30
  */
41
- export declare const indentHtml: (content: string) => string;
42
- export declare const shallowEqual: (object1: any, object2: any) => boolean;
31
+ declare const indentHtml: (content: string) => string;
43
32
  /**
44
33
  * if options.applyToWord is set, expands the selection to the word where the cursor is and
45
34
  * returns modified state and dispatch.
46
35
  */
47
- export declare const expandSelection: (state: any, dispatch: any, options: any) => {
36
+ declare const expandSelection: (state: any, dispatch: any, options: any) => {
48
37
  state: any;
49
38
  dispatch: any;
50
39
  };
@@ -60,10 +49,6 @@ export declare const expandSelection: (state: any, dispatch: any, options: any)
60
49
  * const command = expandToWordWrap(toggleInlineFormat, {...bold, applyToWord );
61
50
  * command(view.state, view.dispatch);
62
51
  */
63
- export declare const expandToWordWrap: (command: any, options: any) => (state: any, dispatch: any) => any;
64
- export declare const parseStyle: (styleText: string | null) => {
65
- [key: string]: string;
66
- };
67
- export declare const applyStyle: (styleText: string | null, styleType: string, styleValue: string) => string;
68
- export declare const setStyleAttr: (element: HTMLElement, styleString: string) => void;
69
- export declare const setAttribute: (node: HTMLElement, attrName: string, value?: string) => void;
52
+ declare const expandToWordWrap: (command: any, options: any) => (state: any, dispatch: any) => any;
53
+
54
+ export { canInsert, expandSelection, expandToWordWrap, getNodeFromSelection, getSelectionText, indentHtml, insertNode, parentNode, selectedLineTextOnly };