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

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 +388 -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 +13 -32
  158. package/dist/npm/utils.js +133 -145
  159. package/package.json +34 -52
  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
@@ -1,49 +1,49 @@
1
- import { __assign } from "tslib";
2
1
  import { Plugin } from 'prosemirror-state';
3
2
  import { TableMap } from 'prosemirror-tables';
4
- import { Decoration, DecorationSet } from 'prosemirror-view';
5
- import { colgroupAttr } from '../../config/constants';
6
- import { TableView, TableWrapperView } from './table-view';
7
- import { parseStyle, setNodeStyle } from './../../utils';
8
- import { cellIndexes, domCellAround, otherResizeHandle, otherResizing, edgeCell, tableColumnResizeKey as key } from './utils';
9
- export function columnResizing() {
10
- var handleWidth = 5, cellMinWidth = 25;
11
- var plugin = new Plugin({
12
- key: key,
3
+ import { DecorationSet, Decoration } from 'prosemirror-view';
4
+ import { colgroupAttr } from '../../config/constants.js';
5
+ import { TableWrapperView, TableView } from './table-view.js';
6
+ import { setNodeStyle, parseStyle } from '../../utils.js';
7
+ import { tableColumnResizeKey, otherResizeHandle, otherResizing, domCellAround, cellIndexes, edgeCell } from './utils.js';
8
+
9
+ function columnResizing() {
10
+ const handleWidth = 5, cellMinWidth = 25;
11
+ const plugin = new Plugin({
12
+ key: tableColumnResizeKey,
13
13
  state: {
14
- init: function () {
14
+ init() {
15
15
  return new ResizeState(-1, null);
16
16
  },
17
- apply: function (tr, prev) {
17
+ apply(tr, prev) {
18
18
  return prev.apply(tr);
19
19
  }
20
20
  },
21
21
  props: {
22
- attributes: function (state) {
23
- if (otherResizeHandle(key, state)) {
22
+ attributes(state) {
23
+ if (otherResizeHandle(tableColumnResizeKey, state)) {
24
24
  return null;
25
25
  }
26
- var pluginState = key.getState(state);
26
+ const pluginState = tableColumnResizeKey.getState(state);
27
27
  return pluginState.activeHandle > -1 ? { class: 'resize-cursor' } : null;
28
28
  },
29
29
  handleDOMEvents: {
30
- mousemove: function (view, event) {
31
- if (!otherResizing(key, view.state)) {
30
+ mousemove(view, event) {
31
+ if (!otherResizing(tableColumnResizeKey, view.state)) {
32
32
  handleMouseMove(view, event, handleWidth);
33
33
  }
34
34
  return false;
35
35
  },
36
- mouseleave: function (view) {
36
+ mouseleave(view) {
37
37
  handleMouseLeave(view);
38
38
  return false;
39
39
  },
40
- mousedown: function (view, event) {
40
+ mousedown(view, event) {
41
41
  return handleMouseDown(view, event, cellMinWidth);
42
42
  }
43
43
  },
44
- decorations: function (state) {
45
- if (!otherResizing(key, state)) {
46
- var pluginState = key.getState(state);
44
+ decorations(state) {
45
+ if (!otherResizing(tableColumnResizeKey, state)) {
46
+ const pluginState = tableColumnResizeKey.getState(state);
47
47
  if (pluginState.activeHandle > -1) {
48
48
  return handleDecorations(state, pluginState.activeHandle);
49
49
  }
@@ -51,8 +51,8 @@ export function columnResizing() {
51
51
  return DecorationSet.empty;
52
52
  },
53
53
  nodeViews: {
54
- table_wrapper: function (node, view) { return new TableWrapperView(node, view); },
55
- table: function (node, view) { return new TableView(node, view); }
54
+ table_wrapper: (node, view) => new TableWrapperView(node, view),
55
+ table: (node, view) => new TableView(node, view)
56
56
  }
57
57
  }
58
58
  });
@@ -61,14 +61,14 @@ export function columnResizing() {
61
61
  function pointsAtCell($pos) {
62
62
  return Boolean($pos.parent.type.spec.tableRole === 'row' && $pos.nodeAfter);
63
63
  }
64
- var ResizeState = /** @class */ (function () {
65
- function ResizeState(activeHandle, dragging) {
64
+ class ResizeState {
65
+ constructor(activeHandle, dragging) {
66
66
  this.activeHandle = activeHandle;
67
67
  this.dragging = dragging;
68
68
  }
69
- ResizeState.prototype.apply = function (tr) {
70
- var state;
71
- var action = tr.getMeta(key);
69
+ apply(tr) {
70
+ let state;
71
+ const action = tr.getMeta(tableColumnResizeKey);
72
72
  if (action && action.setHandle != null) {
73
73
  return new ResizeState(action.setHandle, null);
74
74
  }
@@ -76,24 +76,23 @@ var ResizeState = /** @class */ (function () {
76
76
  return new ResizeState(this.activeHandle, action.setDragging);
77
77
  }
78
78
  if (this.activeHandle > -1 && tr.docChanged) {
79
- var handle = tr.mapping.map(this.activeHandle, -1);
79
+ let handle = tr.mapping.map(this.activeHandle, -1);
80
80
  if (!pointsAtCell(tr.doc.resolve(handle))) {
81
81
  handle = -1;
82
82
  }
83
83
  state = new ResizeState(handle, this.dragging);
84
84
  }
85
85
  return state || this;
86
- };
87
- return ResizeState;
88
- }());
86
+ }
87
+ }
89
88
  function handleMouseMove(view, event, handleWidth) {
90
- var pluginState = key.getState(view.state);
89
+ const pluginState = tableColumnResizeKey.getState(view.state);
91
90
  if (!pluginState.dragging) {
92
- var target = domCellAround(event.target);
93
- var cell = -1;
91
+ const target = domCellAround(event.target);
92
+ let cell = -1;
94
93
  if (target) {
95
- var indexes = cellIndexes(target);
96
- var _a = target.getBoundingClientRect(), left = _a.left, right = _a.right;
94
+ const indexes = cellIndexes(target);
95
+ const { left, right } = target.getBoundingClientRect();
97
96
  if (Math.abs(event.clientX - left) <= handleWidth && indexes.cellIndex > 0) {
98
97
  indexes.cellIndex -= target.colSpan;
99
98
  cell = edgeCell(view, event, indexes);
@@ -108,82 +107,84 @@ function handleMouseMove(view, event, handleWidth) {
108
107
  }
109
108
  }
110
109
  function handleMouseLeave(view) {
111
- var pluginState = key.getState(view.state);
110
+ const pluginState = tableColumnResizeKey.getState(view.state);
112
111
  if (pluginState.activeHandle > -1 && !pluginState.dragging) {
113
112
  updateHandle(view, -1);
114
113
  }
115
114
  }
116
115
  function handleMouseDown(view, event, cellMinWidth) {
117
- var _a;
118
- var pluginState = key.getState(view.state);
116
+ const pluginState = tableColumnResizeKey.getState(view.state);
119
117
  if (pluginState.activeHandle === -1 || pluginState.dragging) {
120
118
  return false;
121
119
  }
122
- var $cell = view.state.doc.resolve(pluginState.activeHandle);
123
- var row = $cell.parent;
124
- var cellIndex = $cell.index();
125
- var colSpan = 0;
126
- for (var i = 0; i <= cellIndex; i++) {
120
+ const $cell = view.state.doc.resolve(pluginState.activeHandle);
121
+ const row = $cell.parent;
122
+ const cellIndex = $cell.index();
123
+ let colSpan = 0;
124
+ for (let i = 0; i <= cellIndex; i++) {
127
125
  colSpan += row.child(i).attrs.colspan;
128
126
  }
129
- var tableNode = $cell.node($cell.depth - 1);
130
- var dom = view.domAtPos(pluginState.activeHandle);
131
- var domCell = dom.node.childNodes[dom.offset];
132
- var tableDom = domCell.closest('table');
133
- var col, tableAttrs;
127
+ const tableNode = $cell.node($cell.depth - 1);
128
+ const dom = view.domAtPos(pluginState.activeHandle);
129
+ const domCell = dom.node.childNodes[dom.offset];
130
+ const tableDom = domCell.closest('table');
131
+ let col, tableAttrs;
134
132
  if (tableNode.attrs[colgroupAttr]) {
135
- var colgroup = tableDom.firstChild;
133
+ const colgroup = tableDom.firstChild;
136
134
  col = colgroup.children[colSpan - 1];
137
135
  if (!col.style.width) {
138
136
  col.style.width = col.offsetWidth + 'px';
139
137
  }
140
138
  }
141
139
  else {
142
- var total = 0;
143
- for (var i = 0; i < row.childCount; i++) {
140
+ let total = 0;
141
+ for (let i = 0; i < row.childCount; i++) {
144
142
  total += row.child(i).attrs.colspan;
145
143
  }
146
- var colgroup = document.createElement('colgroup');
147
- var cols = new Array(total);
148
- for (var i = 0; i < total; i++) {
144
+ const colgroup = document.createElement('colgroup');
145
+ const cols = new Array(total);
146
+ for (let i = 0; i < total; i++) {
149
147
  cols[i] = document.createElement('col');
150
148
  colgroup.appendChild(cols[i]);
151
149
  }
152
150
  tableDom.insertBefore(colgroup, tableDom.firstChild);
153
151
  col = cols[cellIndex];
154
152
  col.style.width = col.offsetWidth + 'px';
155
- tableAttrs = __assign(__assign({}, tableNode.attrs), (_a = {}, _a[colgroupAttr] = '<colgroup>' + cols.reduce(function (acc, cur) { return acc + cur.outerHTML; }, '') + '</colgroup>', _a));
153
+ tableAttrs = {
154
+ ...tableNode.attrs,
155
+ [colgroupAttr]: '<colgroup>' + cols.reduce((acc, cur) => acc + cur.outerHTML, '') + '</colgroup>'
156
+ };
156
157
  }
157
- var width = parseFloat(col.style.width);
158
- var tr = view.state.tr.setMeta(key, { setDragging: { startX: event.clientX, startWidth: width } });
158
+ const width = parseFloat(col.style.width);
159
+ const tr = view.state.tr.setMeta(tableColumnResizeKey, { setDragging: { startX: event.clientX, startWidth: width } });
159
160
  if (!tableDom.style.width) {
160
- var widths = Array.from(col.parentNode.children).map(function (c) { return c.style.width; });
161
+ const widths = Array.from(col.parentNode.children).map((c) => c.style.width);
161
162
  if (widths.every(Boolean)) {
162
- var sum = widths.reduce(function (acc, cur) { return acc + parseFloat(cur); }, 0);
163
+ const sum = widths.reduce((acc, cur) => acc + parseFloat(cur), 0);
163
164
  tableAttrs = setNodeStyle(tableAttrs || tableNode.attrs, 'width', sum + 'px');
164
165
  }
165
166
  }
166
167
  if (tableAttrs) {
167
- var tablePos = $cell.posAtIndex(0, $cell.depth - 1) - 1;
168
+ const tablePos = $cell.posAtIndex(0, $cell.depth - 1) - 1;
168
169
  tr.setNodeMarkup(tablePos, null, tableAttrs);
169
170
  }
170
171
  view.dispatch(tr);
171
172
  function finish(ev) {
172
173
  ev.view.removeEventListener('mouseup', finish);
173
174
  ev.view.removeEventListener('mousemove', move);
174
- var curPluginState = key.getState(view.state);
175
+ const curPluginState = tableColumnResizeKey.getState(view.state);
175
176
  if (curPluginState.dragging) {
176
- var transaction = view.state.tr;
177
+ const transaction = view.state.tr;
177
178
  updateColumnWidth(view, transaction, curPluginState.activeHandle);
178
- view.dispatch(transaction.setMeta(key, { setDragging: null }));
179
+ view.dispatch(transaction.setMeta(tableColumnResizeKey, { setDragging: null }));
179
180
  }
180
181
  }
181
182
  function move(ev) {
182
183
  if (!ev.which) {
183
184
  return finish(ev);
184
185
  }
185
- var curPluginState = key.getState(view.state);
186
- var dragged = draggedWidth(curPluginState.dragging, ev, cellMinWidth);
186
+ const curPluginState = tableColumnResizeKey.getState(view.state);
187
+ const dragged = draggedWidth(curPluginState.dragging, ev, cellMinWidth);
187
188
  displayColumnWidth(view, curPluginState.activeHandle, dragged);
188
189
  }
189
190
  event.view.addEventListener('mouseup', finish);
@@ -192,77 +193,78 @@ function handleMouseDown(view, event, cellMinWidth) {
192
193
  return true;
193
194
  }
194
195
  function draggedWidth(dragging, event, cellMinWidth) {
195
- var offset = event.clientX - dragging.startX;
196
+ const offset = event.clientX - dragging.startX;
196
197
  return Math.max(cellMinWidth, dragging.startWidth + offset);
197
198
  }
198
199
  function updateHandle(view, value) {
199
- var tr = view.state.tr;
200
+ const tr = view.state.tr;
200
201
  tr.setMeta('addToHistory', false);
201
- tr.setMeta(key, { setHandle: value });
202
+ tr.setMeta(tableColumnResizeKey, { setHandle: value });
202
203
  view.dispatch(tr);
203
204
  }
204
205
  function updateColumnWidth(view, tr, cell) {
205
- var _a;
206
- var $cell = view.state.doc.resolve(cell);
207
- var tableNode = $cell.node(-1), start = $cell.start(-1);
208
- var tablePos = $cell.posAtIndex(0, $cell.depth - 1) - 1;
209
- var tableDom = view.nodeDOM(start).closest('table');
210
- var attrs = tableNode.attrs;
206
+ const $cell = view.state.doc.resolve(cell);
207
+ const tableNode = $cell.node(-1), start = $cell.start(-1);
208
+ const tablePos = $cell.posAtIndex(0, $cell.depth - 1) - 1;
209
+ const tableDom = view.nodeDOM(start).closest('table');
210
+ let attrs = tableNode.attrs;
211
211
  if (tableNode && attrs[colgroupAttr]) {
212
- var colgroup = tableDom.firstChild;
213
- attrs = __assign(__assign({}, attrs), (_a = {}, _a[colgroupAttr] = colgroup.outerHTML, _a));
212
+ const colgroup = tableDom.firstChild;
213
+ attrs = { ...attrs, [colgroupAttr]: colgroup.outerHTML };
214
214
  }
215
- var tableDomWidth = tableDom.style.width;
215
+ const tableDomWidth = tableDom.style.width;
216
216
  if (tableDom && tableDomWidth && parseStyle(attrs.style).width !== tableDomWidth) {
217
217
  attrs = setNodeStyle(attrs, 'width', tableDomWidth);
218
218
  }
219
219
  tr.setNodeMarkup(tablePos, null, attrs);
220
220
  }
221
221
  function displayColumnWidth(view, cell, width) {
222
- var $cell = view.state.doc.resolve(cell);
223
- var table = $cell.node(-1), start = $cell.start(-1);
224
- var col = TableMap.get(table).colCount($cell.pos - start) + $cell.nodeAfter.attrs.colspan - 1;
225
- var dom = view.domAtPos($cell.start(-1)).node;
222
+ const $cell = view.state.doc.resolve(cell);
223
+ const table = $cell.node(-1), start = $cell.start(-1);
224
+ const col = TableMap.get(table).colCount($cell.pos - start) + $cell.nodeAfter.attrs.colspan - 1;
225
+ let dom = view.domAtPos($cell.start(-1)).node;
226
226
  if (dom.nodeName !== 'TABLE') {
227
227
  dom = dom.closest('table');
228
228
  }
229
- var tableDom = dom;
230
- var colgroup = tableDom.firstChild;
231
- var cols = Array.from(colgroup.children);
229
+ const tableDom = dom;
230
+ const colgroup = tableDom.firstChild;
231
+ const cols = Array.from(colgroup.children);
232
232
  cols[col].style.width = width + 'px';
233
233
  if (tableDom.style.width) {
234
- var widths = cols.map(function (c) { return c.style.width; });
234
+ const widths = cols.map(c => c.style.width);
235
235
  if (widths.every(Boolean)) {
236
- var sum = widths.reduce(function (acc, cur) { return acc + parseFloat(cur); }, 0);
236
+ const sum = widths.reduce((acc, cur) => acc + parseFloat(cur), 0);
237
237
  tableDom.style.width = sum + 'px';
238
238
  }
239
239
  }
240
240
  }
241
241
  function handleDecorations(state, cell) {
242
- var decorations = [];
243
- var $cell = state.doc.resolve(cell);
244
- var table = $cell.node(-1), map = TableMap.get(table), start = $cell.start(-1);
245
- var cellsPositions = [];
246
- var cellPos = cell - start;
247
- var column = -1;
248
- for (var i = 0; i < map.height; i++) {
242
+ const decorations = [];
243
+ const $cell = state.doc.resolve(cell);
244
+ const table = $cell.node(-1), map = TableMap.get(table), start = $cell.start(-1);
245
+ const cellsPositions = [];
246
+ const cellPos = cell - start;
247
+ let column = -1;
248
+ for (let i = 0; i < map.height; i++) {
249
249
  cellsPositions.push(map.map.slice(i * map.width, (i * map.width) + map.width));
250
250
  if (column === -1) {
251
251
  column = cellsPositions[i].lastIndexOf(cellPos);
252
252
  }
253
253
  }
254
- var cells = [];
255
- cellsPositions.forEach(function (row) {
256
- var c = row[column];
254
+ const cells = [];
255
+ cellsPositions.forEach((row) => {
256
+ const c = row[column];
257
257
  if (row[column] !== row[column + 1]) {
258
258
  cells.push(c);
259
259
  }
260
260
  });
261
- cells.forEach((function (cPos) {
262
- var pos = start + cPos + table.nodeAt(cPos).nodeSize - 1;
263
- var dom = document.createElement('div');
261
+ cells.forEach((cPos => {
262
+ const pos = start + cPos + table.nodeAt(cPos).nodeSize - 1;
263
+ const dom = document.createElement('div');
264
264
  dom.className = 'column-resize-handle';
265
265
  decorations.push(Decoration.widget(pos, dom));
266
266
  }));
267
267
  return DecorationSet.create(state.doc, decorations);
268
268
  }
269
+
270
+ export { columnResizing };
@@ -1,9 +1,12 @@
1
- import { columnResizing } from './column-resize';
2
- import { tableResizing as tableResize } from './table-resize';
3
- import { rowResizing } from './row-resize';
4
- export var tableResizing = function () { return [
5
- tableResize(),
1
+ import { columnResizing } from './column-resize.js';
2
+ import { tableResizing as tableResizing$1 } from './table-resize.js';
3
+ import { rowResizing } from './row-resize.js';
4
+ export { tableColumnResizeKey, tableResizeKey, tableRowResizeKey } from './utils.js';
5
+
6
+ const tableResizing = () => [
7
+ tableResizing$1(),
6
8
  columnResizing(),
7
9
  rowResizing()
8
- ]; };
9
- export { tableResizeKey, tableColumnResizeKey, tableRowResizeKey } from './utils';
10
+ ];
11
+
12
+ export { tableResizing };