@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
@@ -1,60 +1,57 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.rowResizing = void 0;
4
- var prosemirror_state_1 = require("prosemirror-state");
5
- var prosemirror_tables_1 = require("prosemirror-tables");
6
- var prosemirror_view_1 = require("prosemirror-view");
7
- var utils_1 = require("./utils");
8
- var utils_2 = require("./../../utils");
9
- var TableRowView = /** @class */ (function () {
10
- function TableRowView() {
11
- }
12
- TableRowView.prototype.ignoreMutation = function (record) {
1
+ 'use strict';
2
+
3
+ var prosemirrorState = require('prosemirror-state');
4
+ var prosemirrorTables = require('prosemirror-tables');
5
+ var prosemirrorView = require('prosemirror-view');
6
+ var utils = require('./utils.js');
7
+ var utils$1 = require('../../utils.js');
8
+
9
+ class TableRowView {
10
+ ignoreMutation(record) {
13
11
  return record.type === 'attributes' && record.attributeName === 'style' && record.target.nodeName === 'TR';
14
- };
15
- return TableRowView;
16
- }());
12
+ }
13
+ }
17
14
  function rowResizing() {
18
- var handleWidth = 5;
19
- var plugin = new prosemirror_state_1.Plugin({
20
- key: utils_1.tableRowResizeKey,
15
+ const handleWidth = 5;
16
+ const plugin = new prosemirrorState.Plugin({
17
+ key: utils.tableRowResizeKey,
21
18
  state: {
22
- init: function (_, state) {
23
- this.spec.props.nodeViews[(0, prosemirror_tables_1.tableNodeTypes)(state.schema).row.name] = function () { return new TableRowView(); };
19
+ init(_, state) {
20
+ this.spec.props.nodeViews[prosemirrorTables.tableNodeTypes(state.schema).row.name] = () => new TableRowView();
24
21
  return new ResizeState(-1, null);
25
22
  },
26
- apply: function (tr, prev) {
23
+ apply(tr, prev) {
27
24
  return prev.apply(tr);
28
25
  }
29
26
  },
30
27
  props: {
31
- attributes: function (state) {
32
- if ((0, utils_1.otherResizeHandle)(utils_1.tableRowResizeKey, state)) {
28
+ attributes(state) {
29
+ if (utils.otherResizeHandle(utils.tableRowResizeKey, state)) {
33
30
  return null;
34
31
  }
35
- var pluginState = utils_1.tableRowResizeKey.getState(state);
32
+ const pluginState = utils.tableRowResizeKey.getState(state);
36
33
  return pluginState.activeHandle > -1 ? { class: 'resize-cursor-vertical' } : null;
37
34
  },
38
35
  handleDOMEvents: {
39
- mousemove: function (view, event) {
40
- if (!(0, utils_1.otherResizing)(utils_1.tableRowResizeKey, view.state)) {
36
+ mousemove(view, event) {
37
+ if (!utils.otherResizing(utils.tableRowResizeKey, view.state)) {
41
38
  handleMouseMove(view, event, handleWidth);
42
39
  }
43
40
  return false;
44
41
  },
45
- mouseleave: function (view) {
42
+ mouseleave(view) {
46
43
  handleMouseLeave(view);
47
44
  return false;
48
45
  },
49
- mousedown: function (view, event) {
46
+ mousedown(view, event) {
50
47
  return handleMouseDown(view, event);
51
48
  }
52
49
  },
53
- decorations: function (state) {
54
- if ((0, utils_1.otherResizing)(utils_1.tableRowResizeKey, state)) {
55
- return prosemirror_view_1.DecorationSet.empty;
50
+ decorations(state) {
51
+ if (utils.otherResizing(utils.tableRowResizeKey, state)) {
52
+ return prosemirrorView.DecorationSet.empty;
56
53
  }
57
- var pluginState = utils_1.tableRowResizeKey.getState(state);
54
+ const pluginState = utils.tableRowResizeKey.getState(state);
58
55
  if (pluginState.activeHandle > -1) {
59
56
  return handleDecorations(state, pluginState.activeHandle);
60
57
  }
@@ -64,17 +61,16 @@ function rowResizing() {
64
61
  });
65
62
  return plugin;
66
63
  }
67
- exports.rowResizing = rowResizing;
68
64
  function pointsAtCell($pos) {
69
65
  return $pos.parent.type.spec.tableRole === 'row' && $pos.nodeAfter;
70
66
  }
71
- var ResizeState = /** @class */ (function () {
72
- function ResizeState(activeHandle, dragging) {
67
+ class ResizeState {
68
+ constructor(activeHandle, dragging) {
73
69
  this.activeHandle = activeHandle;
74
70
  this.dragging = dragging;
75
71
  }
76
- ResizeState.prototype.apply = function (tr) {
77
- var state, action = tr.getMeta(utils_1.tableRowResizeKey);
72
+ apply(tr) {
73
+ let state, action = tr.getMeta(utils.tableRowResizeKey);
78
74
  if (action && action.setHandle != null) {
79
75
  return new ResizeState(action.setHandle, null);
80
76
  }
@@ -82,29 +78,28 @@ var ResizeState = /** @class */ (function () {
82
78
  return new ResizeState(this.activeHandle, action.setDragging);
83
79
  }
84
80
  if (this.activeHandle > -1) {
85
- var handle = tr.mapping.map(this.activeHandle, -1);
81
+ let handle = tr.mapping.map(this.activeHandle, -1);
86
82
  if (!pointsAtCell(tr.doc.resolve(handle))) {
87
83
  handle = null;
88
84
  }
89
85
  state = new ResizeState(handle, this.dragging);
90
86
  }
91
87
  return state || this;
92
- };
93
- return ResizeState;
94
- }());
88
+ }
89
+ }
95
90
  function handleMouseMove(view, event, handleWidth) {
96
- var pluginState = utils_1.tableRowResizeKey.getState(view.state);
91
+ const pluginState = utils.tableRowResizeKey.getState(view.state);
97
92
  if (!pluginState.dragging) {
98
- var target = (0, utils_1.domCellAround)(event.target), cell = -1;
93
+ let target = utils.domCellAround(event.target), cell = -1;
99
94
  if (target) {
100
- var indexes = (0, utils_1.cellIndexes)(target);
101
- var _a = target.getBoundingClientRect(), top_1 = _a.top, bottom = _a.bottom;
102
- if (Math.abs(event.clientY - top_1) <= handleWidth && indexes.rowIndex > 0) {
95
+ const indexes = utils.cellIndexes(target);
96
+ const { top, bottom } = target.getBoundingClientRect();
97
+ if (Math.abs(event.clientY - top) <= handleWidth && indexes.rowIndex > 0) {
103
98
  indexes.rowIndex -= target.rowSpan;
104
- cell = (0, utils_1.edgeCell)(view, event, indexes);
99
+ cell = utils.edgeCell(view, event, indexes);
105
100
  }
106
101
  else if (bottom - event.clientY > 0 && bottom - event.clientY <= handleWidth) {
107
- cell = (0, utils_1.edgeCell)(view, event, indexes);
102
+ cell = utils.edgeCell(view, event, indexes);
108
103
  }
109
104
  }
110
105
  if (cell !== pluginState.activeHandle) {
@@ -113,39 +108,39 @@ function handleMouseMove(view, event, handleWidth) {
113
108
  }
114
109
  }
115
110
  function handleMouseLeave(view) {
116
- var pluginState = utils_1.tableRowResizeKey.getState(view.state);
111
+ const pluginState = utils.tableRowResizeKey.getState(view.state);
117
112
  if (pluginState.activeHandle > -1 && !pluginState.dragging) {
118
113
  updateHandle(view, -1);
119
114
  }
120
115
  }
121
116
  function handleMouseDown(view, event) {
122
- var pluginState = utils_1.tableRowResizeKey.getState(view.state);
117
+ const pluginState = utils.tableRowResizeKey.getState(view.state);
123
118
  if (pluginState.activeHandle === -1 || pluginState.dragging) {
124
119
  return false;
125
120
  }
126
- var doc = view.state.doc;
127
- var $cell = doc.resolve(pluginState.activeHandle);
128
- var row = $cell.parent;
129
- var table = $cell.node(-1);
130
- var rowHeightStr = (0, utils_2.parseStyle)(row.attrs.style).height;
131
- var tableHeight = (0, utils_2.parseStyle)(table.attrs.style).height;
132
- var rowHeight = rowHeightStr ? parseFloat(rowHeightStr) : 0;
121
+ const doc = view.state.doc;
122
+ const $cell = doc.resolve(pluginState.activeHandle);
123
+ const row = $cell.parent;
124
+ const table = $cell.node(-1);
125
+ const rowHeightStr = utils$1.parseStyle(row.attrs.style).height;
126
+ const tableHeight = utils$1.parseStyle(table.attrs.style).height;
127
+ let rowHeight = rowHeightStr ? parseFloat(rowHeightStr) : 0;
133
128
  if (!rowHeightStr) {
134
- var tr = view.nodeDOM(pluginState.activeHandle);
129
+ const tr = view.nodeDOM(pluginState.activeHandle);
135
130
  rowHeight = tr.offsetHeight;
136
131
  }
137
- view.dispatch(view.state.tr.setMeta(utils_1.tableRowResizeKey, {
132
+ view.dispatch(view.state.tr.setMeta(utils.tableRowResizeKey, {
138
133
  setDragging: {
139
134
  startY: event.clientY,
140
- startHeight: { rowHeight: rowHeight, tableHeight: tableHeight }
135
+ startHeight: { rowHeight, tableHeight }
141
136
  }
142
137
  }));
143
138
  function finish(ev) {
144
139
  ev.view.removeEventListener('mouseup', finish);
145
140
  ev.view.removeEventListener('mousemove', move);
146
- var curPluginState = utils_1.tableRowResizeKey.getState(view.state);
141
+ const curPluginState = utils.tableRowResizeKey.getState(view.state);
147
142
  if (curPluginState.dragging) {
148
- var tr = view.state.tr.setMeta(utils_1.tableRowResizeKey, { setDragging: null });
143
+ const tr = view.state.tr.setMeta(utils.tableRowResizeKey, { setDragging: null });
149
144
  updateRowHeight(view, tr, curPluginState.activeHandle);
150
145
  view.dispatch(tr);
151
146
  }
@@ -154,9 +149,9 @@ function handleMouseDown(view, event) {
154
149
  if (!ev.which) {
155
150
  return finish(ev);
156
151
  }
157
- var curPluginState = utils_1.tableRowResizeKey.getState(view.state);
158
- var dragged = draggedHeight(curPluginState.dragging, ev);
159
- var offset = ev.clientY - curPluginState.dragging.startY;
152
+ const curPluginState = utils.tableRowResizeKey.getState(view.state);
153
+ const dragged = draggedHeight(curPluginState.dragging, ev);
154
+ const offset = ev.clientY - curPluginState.dragging.startY;
160
155
  displayRowHeight(view, curPluginState.activeHandle, dragged, offset, tableHeight);
161
156
  }
162
157
  event.view.addEventListener('mouseup', finish);
@@ -165,42 +160,42 @@ function handleMouseDown(view, event) {
165
160
  return true;
166
161
  }
167
162
  function draggedHeight(dragging, event) {
168
- var offset = event.clientY - dragging.startY;
163
+ const offset = event.clientY - dragging.startY;
169
164
  return dragging.startHeight.rowHeight + offset;
170
165
  }
171
166
  function updateHandle(view, value) {
172
- var tr = view.state.tr;
167
+ const tr = view.state.tr;
173
168
  tr.setMeta('addToHistory', false);
174
- tr.setMeta(utils_1.tableRowResizeKey, { setHandle: value });
169
+ tr.setMeta(utils.tableRowResizeKey, { setHandle: value });
175
170
  view.dispatch(tr);
176
171
  }
177
172
  function updateRowHeight(view, tr, cellPos) {
178
- var doc = view.state.doc;
179
- var $cell = doc.resolve(cellPos);
180
- var row = $cell.parent;
181
- var rowPos = $cell.posAtIndex(0) - 1;
182
- var dom = view.nodeDOM(rowPos);
183
- var win = (dom.ownerDocument && dom.ownerDocument.defaultView) || window;
173
+ const doc = view.state.doc;
174
+ const $cell = doc.resolve(cellPos);
175
+ const row = $cell.parent;
176
+ const rowPos = $cell.posAtIndex(0) - 1;
177
+ const dom = view.nodeDOM(rowPos);
178
+ const win = (dom.ownerDocument && dom.ownerDocument.defaultView) || window;
184
179
  dom.style.height = win.getComputedStyle(dom).height;
185
- tr.setNodeMarkup(rowPos, null, (0, utils_2.setNodeStyle)(row.attrs, 'height', dom.style.height));
186
- var table = dom && dom.closest('table');
187
- var tableHeight = table && table.style.height;
180
+ tr.setNodeMarkup(rowPos, null, utils$1.setNodeStyle(row.attrs, 'height', dom.style.height));
181
+ const table = dom && dom.closest('table');
182
+ const tableHeight = table && table.style.height;
188
183
  if (tableHeight) {
189
- var $pos = doc.resolve(rowPos);
190
- var tablePos = $pos.start($pos.depth) - 1;
191
- tr.setNodeMarkup(tablePos, null, (0, utils_2.setNodeStyle)($pos.parent.attrs, 'height', tableHeight));
184
+ const $pos = doc.resolve(rowPos);
185
+ const tablePos = $pos.start($pos.depth) - 1;
186
+ tr.setNodeMarkup(tablePos, null, utils$1.setNodeStyle($pos.parent.attrs, 'height', tableHeight));
192
187
  }
193
188
  }
194
189
  function displayRowHeight(view, cellPos, height, offset, tableHeight) {
195
- var cell = view.nodeDOM(cellPos);
196
- var row = cell && cell.parentNode;
190
+ const cell = view.nodeDOM(cellPos);
191
+ const row = cell && cell.parentNode;
197
192
  if (row) {
198
193
  row.style.height = height + 'px';
199
- var win = (row.ownerDocument && row.ownerDocument.defaultView) || window;
194
+ const win = (row.ownerDocument && row.ownerDocument.defaultView) || window;
200
195
  row.style.height = win.getComputedStyle(row).height;
201
- var table = row.closest('table');
202
- var newHeight = (parseFloat(tableHeight) + offset) + 'px';
203
- var current = table && table.style.height;
196
+ const table = row.closest('table');
197
+ const newHeight = (parseFloat(tableHeight) + offset) + 'px';
198
+ const current = table && table.style.height;
204
199
  if (current && current !== newHeight) {
205
200
  table.style.height = (parseFloat(tableHeight) + offset) + 'px';
206
201
  table.style.height = win.getComputedStyle(table).height;
@@ -208,32 +203,34 @@ function displayRowHeight(view, cellPos, height, offset, tableHeight) {
208
203
  }
209
204
  }
210
205
  function handleDecorations(state, cell) {
211
- var decorations = [];
206
+ const decorations = [];
212
207
  if (typeof cell !== 'number') {
213
- return prosemirror_view_1.DecorationSet.empty;
208
+ return prosemirrorView.DecorationSet.empty;
214
209
  }
215
- var $cell = state.doc.resolve(cell), table = $cell.node(-1), map = prosemirror_tables_1.TableMap.get(table), start = $cell.start(-1);
216
- var cellsPositions = [];
217
- var cellPos = cell - start;
218
- var rowIndex = -1;
219
- for (var i = 0; i < map.height; i++) {
210
+ const $cell = state.doc.resolve(cell), table = $cell.node(-1), map = prosemirrorTables.TableMap.get(table), start = $cell.start(-1);
211
+ const cellsPositions = [];
212
+ const cellPos = cell - start;
213
+ let rowIndex = -1;
214
+ for (let i = 0; i < map.height; i++) {
220
215
  cellsPositions.push(map.map.slice(i * map.width, (i * map.width) + map.width));
221
216
  if (cellsPositions[i].indexOf(cellPos) !== -1) {
222
217
  rowIndex = i;
223
218
  }
224
219
  }
225
- var cells = [];
226
- cellsPositions[rowIndex].forEach(function (c, i) {
220
+ const cells = [];
221
+ cellsPositions[rowIndex].forEach((c, i) => {
227
222
  if (!cellsPositions[rowIndex + 1] || c !== cellsPositions[rowIndex + 1][i]) {
228
223
  cells.push(c);
229
224
  }
230
225
  });
231
- cells.forEach(function (cPos) {
232
- var cellNode = table.nodeAt(cPos);
233
- var widgetPos = start + cPos + (cellNode ? cellNode.nodeSize : 0) - 1;
234
- var dom = document.createElement('div');
226
+ cells.forEach((cPos) => {
227
+ const cellNode = table.nodeAt(cPos);
228
+ const widgetPos = start + cPos + (cellNode ? cellNode.nodeSize : 0) - 1;
229
+ const dom = document.createElement('div');
235
230
  dom.className = 'row-resize-handle';
236
- decorations.push(prosemirror_view_1.Decoration.widget(widgetPos, dom));
231
+ decorations.push(prosemirrorView.Decoration.widget(widgetPos, dom));
237
232
  });
238
- return prosemirror_view_1.DecorationSet.create(state.doc, decorations);
233
+ return prosemirrorView.DecorationSet.create(state.doc, decorations);
239
234
  }
235
+
236
+ exports.rowResizing = rowResizing;