@atlaskit/editor-plugin-table 7.5.5 → 7.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/event-handlers.js +25 -9
- package/dist/cjs/nodeviews/OverflowShadowsObserver.js +24 -15
- package/dist/cjs/nodeviews/TableCell.js +5 -30
- package/dist/cjs/nodeviews/TableComponent.js +74 -24
- package/dist/cjs/nodeviews/TableContainer.js +19 -17
- package/dist/cjs/nodeviews/TableResizer.js +1 -1
- package/dist/cjs/plugin.js +2 -3
- package/dist/cjs/pm-plugins/main.js +3 -18
- package/dist/cjs/ui/TableFloatingColumnControls/index.js +8 -48
- package/dist/cjs/ui/TableFloatingControls/index.js +113 -223
- package/dist/cjs/utils/column-controls.js +5 -5
- package/dist/cjs/utils/dom.js +13 -15
- package/dist/es2019/event-handlers.js +25 -9
- package/dist/es2019/nodeviews/OverflowShadowsObserver.js +24 -15
- package/dist/es2019/nodeviews/TableCell.js +1 -24
- package/dist/es2019/nodeviews/TableComponent.js +63 -27
- package/dist/es2019/nodeviews/TableContainer.js +16 -18
- package/dist/es2019/nodeviews/TableResizer.js +1 -1
- package/dist/es2019/plugin.js +2 -3
- package/dist/es2019/pm-plugins/main.js +3 -18
- package/dist/es2019/ui/TableFloatingColumnControls/index.js +5 -27
- package/dist/es2019/ui/TableFloatingControls/index.js +119 -193
- package/dist/es2019/utils/column-controls.js +6 -6
- package/dist/es2019/utils/dom.js +13 -15
- package/dist/esm/event-handlers.js +25 -9
- package/dist/esm/nodeviews/OverflowShadowsObserver.js +24 -15
- package/dist/esm/nodeviews/TableCell.js +5 -30
- package/dist/esm/nodeviews/TableComponent.js +74 -24
- package/dist/esm/nodeviews/TableContainer.js +20 -18
- package/dist/esm/nodeviews/TableResizer.js +1 -1
- package/dist/esm/plugin.js +2 -3
- package/dist/esm/pm-plugins/main.js +3 -18
- package/dist/esm/ui/TableFloatingColumnControls/index.js +8 -48
- package/dist/esm/ui/TableFloatingControls/index.js +113 -224
- package/dist/esm/utils/column-controls.js +6 -6
- package/dist/esm/utils/dom.js +13 -15
- package/dist/types/event-handlers.d.ts +3 -4
- package/dist/types/nodeviews/OverflowShadowsObserver.d.ts +3 -1
- package/dist/types/nodeviews/TableCell.d.ts +1 -5
- package/dist/types/nodeviews/TableComponent.d.ts +4 -0
- package/dist/types/nodeviews/TableContainer.d.ts +4 -2
- package/dist/types/types.d.ts +0 -3
- package/dist/types/ui/TableFloatingColumnControls/index.d.ts +2 -1
- package/dist/types/ui/TableFloatingControls/index.d.ts +5 -22
- package/dist/types/utils/dom.d.ts +10 -2
- package/dist/types-ts4.5/event-handlers.d.ts +3 -4
- package/dist/types-ts4.5/nodeviews/OverflowShadowsObserver.d.ts +3 -1
- package/dist/types-ts4.5/nodeviews/TableCell.d.ts +1 -5
- package/dist/types-ts4.5/nodeviews/TableComponent.d.ts +4 -0
- package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +4 -2
- package/dist/types-ts4.5/types.d.ts +0 -3
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/index.d.ts +2 -1
- package/dist/types-ts4.5/ui/TableFloatingControls/index.d.ts +5 -22
- package/dist/types-ts4.5/utils/dom.d.ts +10 -2
- package/package.json +3 -4
- package/src/event-handlers.ts +105 -103
- package/src/nodeviews/OverflowShadowsObserver.ts +32 -21
- package/src/nodeviews/TableCell.ts +0 -26
- package/src/nodeviews/TableComponent.tsx +76 -32
- package/src/nodeviews/TableContainer.tsx +19 -25
- package/src/nodeviews/TableResizer.tsx +1 -4
- package/src/plugin.tsx +5 -4
- package/src/pm-plugins/main.ts +3 -22
- package/src/types.ts +0 -4
- package/src/ui/TableFloatingColumnControls/index.tsx +5 -29
- package/src/ui/TableFloatingControls/index.tsx +155 -241
- package/src/utils/column-controls.ts +5 -6
- package/src/utils/dom.ts +12 -19
|
@@ -1,235 +1,124 @@
|
|
|
1
|
-
import
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
9
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
|
-
import React, { Component } from 'react';
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
14
2
|
import { browser } from '@atlaskit/editor-common/utils';
|
|
15
3
|
import { hoverCell, hoverRows, selectRow, selectRows } from '../../commands';
|
|
16
4
|
import { TableCssClassName as ClassName } from '../../types';
|
|
17
|
-
import { isSelectionUpdated } from '../../utils';
|
|
18
5
|
import { CornerControls, DragCornerControls } from './CornerControls';
|
|
19
6
|
import NumberColumn from './NumberColumn';
|
|
20
7
|
import { DragControls, RowControls } from './RowControls';
|
|
21
|
-
var TableFloatingControls =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
editorView.dom.blur();
|
|
45
|
-
}
|
|
46
|
-
selectRows(rowIndexes)(state, dispatch);
|
|
47
|
-
});
|
|
48
|
-
_defineProperty(_assertThisInitialized(_this), "hoverRows", function (rows, danger) {
|
|
49
|
-
var _this$props$editorVie = _this.props.editorView,
|
|
50
|
-
state = _this$props$editorVie.state,
|
|
51
|
-
dispatch = _this$props$editorVie.dispatch;
|
|
52
|
-
hoverRows(rows, danger)(state, dispatch);
|
|
53
|
-
});
|
|
54
|
-
// re-use across numbered columns and row controls
|
|
55
|
-
_defineProperty(_assertThisInitialized(_this), "updateCellHoverLocation", function (rowIndex) {
|
|
56
|
-
var _this$props = _this.props,
|
|
57
|
-
editorView = _this$props.editorView,
|
|
58
|
-
tableActive = _this$props.tableActive;
|
|
59
|
-
var state = editorView.state,
|
|
60
|
-
dispatch = editorView.dispatch;
|
|
61
|
-
if (tableActive) {
|
|
62
|
-
// For context: Whenever we mouse over a column or row drag handle, we will ALWAYS be hovering over the 0 index
|
|
63
|
-
// of the opposite dimension. For example; here when we mouse over the row drag handle then we're technically
|
|
64
|
-
// also hovering over column 0 index. And vice-versa with columns. This means we don't need to worry about knowing the
|
|
65
|
-
// current column index. We can just force it to 0.
|
|
66
|
-
hoverCell(rowIndex, 0)(state, dispatch);
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
_this.state = {
|
|
70
|
-
tableWrapperWidth: 0,
|
|
71
|
-
/** Height needs to be tracked to re-render decorations correctly, do not remove */
|
|
72
|
-
tableWrapperHeight: 0
|
|
73
|
-
};
|
|
74
|
-
return _this;
|
|
75
|
-
}
|
|
76
|
-
_createClass(TableFloatingControls, [{
|
|
77
|
-
key: "componentDidMount",
|
|
78
|
-
value: function componentDidMount() {
|
|
79
|
-
this.tryInitResizeObserver();
|
|
8
|
+
export var TableFloatingControls = function TableFloatingControls(_ref) {
|
|
9
|
+
var editorView = _ref.editorView,
|
|
10
|
+
tableRef = _ref.tableRef,
|
|
11
|
+
tableNode = _ref.tableNode,
|
|
12
|
+
isInDanger = _ref.isInDanger,
|
|
13
|
+
isResizing = _ref.isResizing,
|
|
14
|
+
isNumberColumnEnabled = _ref.isNumberColumnEnabled,
|
|
15
|
+
isHeaderRowEnabled = _ref.isHeaderRowEnabled,
|
|
16
|
+
isHeaderColumnEnabled = _ref.isHeaderColumnEnabled,
|
|
17
|
+
tableActive = _ref.tableActive,
|
|
18
|
+
hasHeaderRow = _ref.hasHeaderRow,
|
|
19
|
+
hoveredRows = _ref.hoveredRows,
|
|
20
|
+
stickyHeader = _ref.stickyHeader,
|
|
21
|
+
isDragAndDropEnabled = _ref.isDragAndDropEnabled,
|
|
22
|
+
hoveredCell = _ref.hoveredCell,
|
|
23
|
+
isTableHovered = _ref.isTableHovered,
|
|
24
|
+
tableWrapperWidth = _ref.tableWrapperWidth;
|
|
25
|
+
var _selectRow = useCallback(function (row, expand) {
|
|
26
|
+
var state = editorView.state,
|
|
27
|
+
dispatch = editorView.dispatch;
|
|
28
|
+
// fix for issue ED-4665
|
|
29
|
+
if (browser.ie_version === 11) {
|
|
30
|
+
editorView.dom.blur();
|
|
80
31
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
32
|
+
selectRow(row, expand)(state, dispatch);
|
|
33
|
+
}, [editorView]);
|
|
34
|
+
var _selectRows = useCallback(function (rowIndexes) {
|
|
35
|
+
var state = editorView.state,
|
|
36
|
+
dispatch = editorView.dispatch;
|
|
37
|
+
// fix for issue ED-4665
|
|
38
|
+
if (browser.ie_version === 11) {
|
|
39
|
+
editorView.dom.blur();
|
|
86
40
|
}
|
|
41
|
+
selectRows(rowIndexes)(state, dispatch);
|
|
42
|
+
}, [editorView]);
|
|
43
|
+
var _hoverRows = useCallback(function (rows, danger) {
|
|
44
|
+
var state = editorView.state,
|
|
45
|
+
dispatch = editorView.dispatch;
|
|
46
|
+
hoverRows(rows, danger)(state, dispatch);
|
|
47
|
+
}, [editorView]);
|
|
87
48
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
var _iterator = _createForOfIteratorHelper(entries),
|
|
99
|
-
_step;
|
|
100
|
-
try {
|
|
101
|
-
var _loop = function _loop() {
|
|
102
|
-
var entry = _step.value;
|
|
103
|
-
_this2.setState(function (prev) {
|
|
104
|
-
return (prev === null || prev === void 0 ? void 0 : prev.tableWrapperWidth) === entry.contentRect.width && prev.tableWrapperHeight === entry.contentRect.height ? prev : {
|
|
105
|
-
tableWrapperWidth: entry.contentRect.width,
|
|
106
|
-
tableWrapperHeight: entry.contentRect.height
|
|
107
|
-
};
|
|
108
|
-
});
|
|
109
|
-
};
|
|
110
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
111
|
-
_loop();
|
|
112
|
-
}
|
|
113
|
-
} catch (err) {
|
|
114
|
-
_iterator.e(err);
|
|
115
|
-
} finally {
|
|
116
|
-
_iterator.f();
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
this.resizeObserver.observe(tableWrapper);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}, {
|
|
123
|
-
key: "shouldComponentUpdate",
|
|
124
|
-
value: function shouldComponentUpdate(nextProps, nextState) {
|
|
125
|
-
var _this$props2 = this.props,
|
|
126
|
-
tableRef = _this$props2.tableRef,
|
|
127
|
-
isInDanger = _this$props2.isInDanger,
|
|
128
|
-
isResizing = _this$props2.isResizing,
|
|
129
|
-
isHeaderRowEnabled = _this$props2.isHeaderRowEnabled,
|
|
130
|
-
isNumberColumnEnabled = _this$props2.isNumberColumnEnabled,
|
|
131
|
-
hoveredRows = _this$props2.hoveredRows,
|
|
132
|
-
selection = _this$props2.selection,
|
|
133
|
-
tableActive = _this$props2.tableActive,
|
|
134
|
-
isHeaderColumnEnabled = _this$props2.isHeaderColumnEnabled,
|
|
135
|
-
ordering = _this$props2.ordering,
|
|
136
|
-
headerRowHeight = _this$props2.headerRowHeight,
|
|
137
|
-
stickyHeader = _this$props2.stickyHeader,
|
|
138
|
-
hoveredCell = _this$props2.hoveredCell,
|
|
139
|
-
isTableHovered = _this$props2.isTableHovered;
|
|
140
|
-
return this.state.tableWrapperWidth !== nextState.tableWrapperWidth || this.state.tableWrapperHeight !== nextState.tableWrapperHeight || ordering !== nextProps.ordering || tableRef !== nextProps.tableRef || tableActive !== nextProps.tableActive || isInDanger !== nextProps.isInDanger || isResizing !== nextProps.isResizing || hoveredRows !== nextProps.hoveredRows || isHeaderRowEnabled !== nextProps.isHeaderRowEnabled || isHeaderColumnEnabled !== nextProps.isHeaderColumnEnabled || isNumberColumnEnabled !== nextProps.isNumberColumnEnabled || isSelectionUpdated(selection, nextProps.selection) || headerRowHeight !== nextProps.headerRowHeight || stickyHeader !== nextProps.stickyHeader || hoveredCell !== nextProps.hoveredCell || isTableHovered !== nextProps.isTableHovered;
|
|
49
|
+
// re-use across numbered columns and row controls
|
|
50
|
+
var updateCellHoverLocation = useCallback(function (rowIndex) {
|
|
51
|
+
var state = editorView.state,
|
|
52
|
+
dispatch = editorView.dispatch;
|
|
53
|
+
if (tableActive) {
|
|
54
|
+
// For context: Whenever we mouse over a column or row drag handle, we will ALWAYS be hovering over the 0 index
|
|
55
|
+
// of the opposite dimension. For example; here when we mouse over the row drag handle then we're technically
|
|
56
|
+
// also hovering over column 0 index. And vice-versa with columns. This means we don't need to worry about knowing the
|
|
57
|
+
// current column index. We can just force it to 0.
|
|
58
|
+
hoverCell(rowIndex, 0)(state, dispatch);
|
|
141
59
|
}
|
|
142
|
-
},
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
editorView = _this$props3.editorView,
|
|
154
|
-
tableRef = _this$props3.tableRef,
|
|
155
|
-
tableNode = _this$props3.tableNode,
|
|
156
|
-
isInDanger = _this$props3.isInDanger,
|
|
157
|
-
isResizing = _this$props3.isResizing,
|
|
158
|
-
isNumberColumnEnabled = _this$props3.isNumberColumnEnabled,
|
|
159
|
-
isHeaderRowEnabled = _this$props3.isHeaderRowEnabled,
|
|
160
|
-
isHeaderColumnEnabled = _this$props3.isHeaderColumnEnabled,
|
|
161
|
-
tableActive = _this$props3.tableActive,
|
|
162
|
-
hasHeaderRow = _this$props3.hasHeaderRow,
|
|
163
|
-
hoveredRows = _this$props3.hoveredRows,
|
|
164
|
-
stickyHeader = _this$props3.stickyHeader,
|
|
165
|
-
isDragAndDropEnabled = _this$props3.isDragAndDropEnabled,
|
|
166
|
-
hoveredCell = _this$props3.hoveredCell,
|
|
167
|
-
isTableHovered = _this$props3.isTableHovered;
|
|
168
|
-
if (!tableRef) {
|
|
169
|
-
return null;
|
|
170
|
-
}
|
|
171
|
-
var stickyTop = stickyHeader && stickyHeader.sticky && hasHeaderRow ? stickyHeader.top : undefined;
|
|
172
|
-
var wrapperClassName = isDragAndDropEnabled ? ClassName.DRAG_ROW_CONTROLS_WRAPPER : ClassName.ROW_CONTROLS_WRAPPER;
|
|
173
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
174
|
-
className: wrapperClassName
|
|
175
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
176
|
-
onMouseDown: function onMouseDown(e) {
|
|
177
|
-
return !isDragAndDropEnabled && e.preventDefault();
|
|
178
|
-
}
|
|
179
|
-
}, isNumberColumnEnabled ? /*#__PURE__*/React.createElement(NumberColumn, {
|
|
180
|
-
editorView: editorView,
|
|
181
|
-
hoverRows: this.hoverRows,
|
|
182
|
-
tableRef: tableRef,
|
|
183
|
-
tableActive: tableActive,
|
|
184
|
-
hoveredRows: hoveredRows,
|
|
185
|
-
hasHeaderRow: hasHeaderRow,
|
|
186
|
-
isInDanger: isInDanger,
|
|
187
|
-
isResizing: isResizing,
|
|
188
|
-
selectRow: this.selectRow,
|
|
189
|
-
updateCellHoverLocation: this.updateCellHoverLocation,
|
|
190
|
-
stickyTop: stickyTop,
|
|
191
|
-
isDragAndDropEnabled: isDragAndDropEnabled
|
|
192
|
-
}) : null, tableActive && /*#__PURE__*/React.createElement(React.Fragment, null, isDragAndDropEnabled ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DragCornerControls, {
|
|
193
|
-
editorView: editorView,
|
|
194
|
-
tableRef: tableRef,
|
|
195
|
-
isInDanger: isInDanger,
|
|
196
|
-
isResizing: isResizing
|
|
197
|
-
}), /*#__PURE__*/React.createElement(DragControls, {
|
|
198
|
-
tableRef: tableRef,
|
|
199
|
-
tableNode: tableNode,
|
|
200
|
-
hoveredCell: hoveredCell,
|
|
201
|
-
isTableHovered: isTableHovered,
|
|
202
|
-
editorView: editorView,
|
|
203
|
-
tableActive: tableActive,
|
|
204
|
-
isInDanger: isInDanger,
|
|
205
|
-
isResizing: isResizing,
|
|
206
|
-
tableWidth: this.state.tableWrapperWidth,
|
|
207
|
-
hoverRows: this.hoverRows,
|
|
208
|
-
selectRow: this.selectRow,
|
|
209
|
-
selectRows: this.selectRows,
|
|
210
|
-
updateCellHoverLocation: this.updateCellHoverLocation
|
|
211
|
-
})) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CornerControls, {
|
|
212
|
-
editorView: editorView,
|
|
213
|
-
tableRef: tableRef,
|
|
214
|
-
isInDanger: isInDanger,
|
|
215
|
-
isResizing: isResizing,
|
|
216
|
-
isHeaderRowEnabled: isHeaderRowEnabled,
|
|
217
|
-
isHeaderColumnEnabled: isHeaderColumnEnabled,
|
|
218
|
-
hoveredRows: hoveredRows,
|
|
219
|
-
stickyTop: tableActive ? stickyTop : undefined
|
|
220
|
-
}), /*#__PURE__*/React.createElement(RowControls, {
|
|
221
|
-
editorView: editorView,
|
|
222
|
-
tableRef: tableRef,
|
|
223
|
-
hoverRows: this.hoverRows,
|
|
224
|
-
hoveredRows: hoveredRows,
|
|
225
|
-
isInDanger: isInDanger,
|
|
226
|
-
isResizing: isResizing,
|
|
227
|
-
selectRow: this.selectRow,
|
|
228
|
-
stickyTop: tableActive ? stickyTop : undefined
|
|
229
|
-
})))));
|
|
60
|
+
}, [editorView, tableActive]);
|
|
61
|
+
if (!tableRef) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
var stickyTop = stickyHeader && stickyHeader.sticky && hasHeaderRow ? stickyHeader.top : undefined;
|
|
65
|
+
var wrapperClassName = isDragAndDropEnabled ? ClassName.DRAG_ROW_CONTROLS_WRAPPER : ClassName.ROW_CONTROLS_WRAPPER;
|
|
66
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
67
|
+
className: wrapperClassName
|
|
68
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
onMouseDown: function onMouseDown(e) {
|
|
70
|
+
return !isDragAndDropEnabled && e.preventDefault();
|
|
230
71
|
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
72
|
+
}, isNumberColumnEnabled ? /*#__PURE__*/React.createElement(NumberColumn, {
|
|
73
|
+
editorView: editorView,
|
|
74
|
+
hoverRows: _hoverRows,
|
|
75
|
+
tableRef: tableRef,
|
|
76
|
+
tableActive: tableActive,
|
|
77
|
+
hoveredRows: hoveredRows,
|
|
78
|
+
hasHeaderRow: hasHeaderRow,
|
|
79
|
+
isInDanger: isInDanger,
|
|
80
|
+
isResizing: isResizing,
|
|
81
|
+
selectRow: _selectRow,
|
|
82
|
+
updateCellHoverLocation: updateCellHoverLocation,
|
|
83
|
+
stickyTop: stickyTop,
|
|
84
|
+
isDragAndDropEnabled: isDragAndDropEnabled
|
|
85
|
+
}) : null, tableActive && /*#__PURE__*/React.createElement(React.Fragment, null, isDragAndDropEnabled ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DragCornerControls, {
|
|
86
|
+
editorView: editorView,
|
|
87
|
+
tableRef: tableRef,
|
|
88
|
+
isInDanger: isInDanger,
|
|
89
|
+
isResizing: isResizing
|
|
90
|
+
}), /*#__PURE__*/React.createElement(DragControls, {
|
|
91
|
+
tableRef: tableRef,
|
|
92
|
+
tableNode: tableNode,
|
|
93
|
+
hoveredCell: hoveredCell,
|
|
94
|
+
isTableHovered: isTableHovered,
|
|
95
|
+
editorView: editorView,
|
|
96
|
+
tableActive: tableActive,
|
|
97
|
+
isInDanger: isInDanger,
|
|
98
|
+
isResizing: isResizing,
|
|
99
|
+
tableWidth: tableWrapperWidth,
|
|
100
|
+
hoverRows: _hoverRows,
|
|
101
|
+
selectRow: _selectRow,
|
|
102
|
+
selectRows: _selectRows,
|
|
103
|
+
updateCellHoverLocation: updateCellHoverLocation
|
|
104
|
+
})) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CornerControls, {
|
|
105
|
+
editorView: editorView,
|
|
106
|
+
tableRef: tableRef,
|
|
107
|
+
isInDanger: isInDanger,
|
|
108
|
+
isResizing: isResizing,
|
|
109
|
+
isHeaderRowEnabled: isHeaderRowEnabled,
|
|
110
|
+
isHeaderColumnEnabled: isHeaderColumnEnabled,
|
|
111
|
+
hoveredRows: hoveredRows,
|
|
112
|
+
stickyTop: tableActive ? stickyTop : undefined
|
|
113
|
+
}), /*#__PURE__*/React.createElement(RowControls, {
|
|
114
|
+
editorView: editorView,
|
|
115
|
+
tableRef: tableRef,
|
|
116
|
+
hoverRows: _hoverRows,
|
|
117
|
+
hoveredRows: hoveredRows,
|
|
118
|
+
isInDanger: isInDanger,
|
|
119
|
+
isResizing: isResizing,
|
|
120
|
+
selectRow: _selectRow,
|
|
121
|
+
stickyTop: tableActive ? stickyTop : undefined
|
|
122
|
+
})))));
|
|
123
|
+
};
|
|
124
|
+
export default TableFloatingControls;
|
|
@@ -3,7 +3,7 @@ import { maphElem } from '@atlaskit/editor-common/utils';
|
|
|
3
3
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
4
4
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
5
5
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
6
|
-
import { findTable,
|
|
6
|
+
import { findTable, getSelectionRect, isColumnSelected, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
7
7
|
import { TableCssClassName as ClassName } from '../types';
|
|
8
8
|
import { tableDeleteButtonSize } from '../ui/consts';
|
|
9
9
|
export var getColumnsWidths = function getColumnsWidths(view) {
|
|
@@ -19,13 +19,13 @@ export var getColumnsWidths = function getColumnsWidths(view) {
|
|
|
19
19
|
length: map.width
|
|
20
20
|
});
|
|
21
21
|
for (var i = 0; i < map.width; i++) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var cellRef = findDomRefAtPos(
|
|
22
|
+
if (!map.isCellMergedTopLeft(0, i)) {
|
|
23
|
+
var node = table.node.nodeAt(map.map[i]);
|
|
24
|
+
var pos = map.map[i] + table.start;
|
|
25
|
+
var cellRef = findDomRefAtPos(pos, domAtPos);
|
|
26
26
|
var rect = cellRef.getBoundingClientRect();
|
|
27
27
|
widths[i] = (rect ? rect.width : cellRef.offsetWidth) + 1;
|
|
28
|
-
i +=
|
|
28
|
+
i += node.attrs.colspan - 1;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}
|
package/dist/esm/utils/dom.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { closestElement, containsClassName } from '@atlaskit/editor-common/utils';
|
|
2
2
|
import { TableCssClassName as ClassName } from '../types';
|
|
3
|
-
var SELECTOR_TABLE_LEAFS = ".".concat(ClassName.TABLE_CELL, ", .").concat(ClassName.TABLE_HEADER_CELL);
|
|
4
3
|
export var isCell = function isCell(node) {
|
|
5
4
|
return Boolean(node && (['TH', 'TD'].indexOf(node.tagName) > -1 || !!closestElement(node, ".".concat(ClassName.TABLE_HEADER_CELL)) || !!closestElement(node, ".".concat(ClassName.TABLE_CELL))));
|
|
6
5
|
};
|
|
@@ -96,22 +95,21 @@ export var isDragCornerButton = function isDragCornerButton(node) {
|
|
|
96
95
|
*
|
|
97
96
|
* the same is valid to the right side.
|
|
98
97
|
*/
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
/**
|
|
99
|
+
* This can be used with mouse events to determine the left/right side of the target the pointer is closest too.
|
|
100
|
+
*
|
|
101
|
+
* WARNING: This metod reads properties which can trigger a reflow; use this wisely.
|
|
102
|
+
*
|
|
103
|
+
* @param mouseEvent
|
|
104
|
+
* @param gapInPixels
|
|
105
|
+
* @returns
|
|
106
|
+
*/
|
|
107
|
+
export var getMousePositionHorizontalRelativeByElement = function getMousePositionHorizontalRelativeByElement(mouseEvent, offsetX, gapInPixels) {
|
|
101
108
|
var element = mouseEvent.target;
|
|
102
109
|
if (element instanceof HTMLElement) {
|
|
103
|
-
var width
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
// directly from element that will be .pm-table-drag-columns-floating-insert-dot-wrapper
|
|
107
|
-
width = element.clientWidth;
|
|
108
|
-
} else {
|
|
109
|
-
var _closestCell$id, _elementContentRects$, _elementContentRects$2;
|
|
110
|
-
var closestCell = element.closest(SELECTOR_TABLE_LEAFS);
|
|
111
|
-
var id = (_closestCell$id = closestCell === null || closestCell === void 0 ? void 0 : closestCell.id) !== null && _closestCell$id !== void 0 ? _closestCell$id : '';
|
|
112
|
-
width = (_elementContentRects$ = elementContentRects === null || elementContentRects === void 0 || (_elementContentRects$2 = elementContentRects[id]) === null || _elementContentRects$2 === void 0 ? void 0 : _elementContentRects$2.width) !== null && _elementContentRects$ !== void 0 ? _elementContentRects$ : 0;
|
|
113
|
-
}
|
|
114
|
-
x = mouseEvent.offsetX;
|
|
110
|
+
var width = element.clientWidth; // reflow
|
|
111
|
+
var x = !Number.isNaN(offsetX) ? offsetX : mouseEvent.offsetX; // reflow
|
|
112
|
+
|
|
115
113
|
if (width <= 0) {
|
|
116
114
|
return null;
|
|
117
115
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import type { ElementContentRects } from './types';
|
|
5
4
|
export declare const handleBlur: (view: EditorView, event: Event) => boolean;
|
|
6
5
|
export declare const handleFocus: (view: EditorView, event: Event) => boolean;
|
|
7
6
|
export declare const handleClick: (view: EditorView, event: Event) => boolean;
|
|
@@ -11,9 +10,9 @@ export declare const handleMouseDown: (_: EditorView, event: Event) => boolean;
|
|
|
11
10
|
export declare const handleMouseOut: (view: EditorView, mouseEvent: Event) => boolean;
|
|
12
11
|
export declare const handleMouseEnter: (view: EditorView, mouseEvent: Event) => boolean;
|
|
13
12
|
export declare const handleMouseLeave: (view: EditorView, event: Event) => boolean;
|
|
14
|
-
export declare const handleMouseMove: (view: EditorView, event: Event
|
|
13
|
+
export declare const handleMouseMove: (view: EditorView, event: Event) => boolean;
|
|
15
14
|
export declare function handleTripleClick(view: EditorView, pos: number): boolean;
|
|
16
15
|
export declare const handleCut: (oldTr: Transaction, oldState: EditorState, newState: EditorState, editorAnalyticsAPI?: EditorAnalyticsAPI, editorView?: EditorView, isTableScalingEnabled?: boolean) => Transaction;
|
|
17
16
|
export declare const isTableInFocus: (view: EditorView) => boolean;
|
|
18
|
-
export declare const whenTableInFocus: (eventHandler: (view: EditorView, mouseEvent: Event
|
|
19
|
-
export declare const withCellTracking: (eventHandler: (view: EditorView, mouseEvent: Event
|
|
17
|
+
export declare const whenTableInFocus: (eventHandler: (view: EditorView, mouseEvent: Event) => boolean) => (view: EditorView, mouseEvent: Event) => boolean;
|
|
18
|
+
export declare const withCellTracking: (eventHandler: (view: EditorView, mouseEvent: Event) => boolean) => (view: EditorView, mouseEvent: Event) => boolean;
|
|
@@ -19,6 +19,8 @@ export declare class OverflowShadowsObserver {
|
|
|
19
19
|
* e.g. bounds on an IntersectionObserverEntry, otherwise proceed with
|
|
20
20
|
* reading it from sticky cell
|
|
21
21
|
*/
|
|
22
|
-
updateStickyShadows: (stickyRowHeight?: number) => void
|
|
22
|
+
updateStickyShadows: ((stickyRowHeight?: number) => void) & {
|
|
23
|
+
cancel(): void;
|
|
24
|
+
};
|
|
23
25
|
dispose(): void;
|
|
24
26
|
}
|
|
@@ -3,11 +3,7 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
3
3
|
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import TableNodeView from './TableNodeViewBase';
|
|
5
5
|
export default class TableCell extends TableNodeView<HTMLElement> implements NodeView {
|
|
6
|
-
|
|
7
|
-
constructor(node: PMNode, view: EditorView, getPos: () => number | undefined, eventDispatcher: EventDispatcher, observer?: ResizeObserver | undefined);
|
|
8
|
-
private isStickyHeaderEnabled;
|
|
9
|
-
private isDragAndDropEnabled;
|
|
6
|
+
constructor(node: PMNode, view: EditorView, getPos: () => number | undefined, eventDispatcher: EventDispatcher);
|
|
10
7
|
update(node: PMNode): boolean;
|
|
11
|
-
destroy(): void;
|
|
12
8
|
private updateNodeView;
|
|
13
9
|
}
|
|
@@ -37,6 +37,8 @@ interface TableState {
|
|
|
37
37
|
stickyHeader?: RowStickyState;
|
|
38
38
|
[ShadowEvent.SHOW_BEFORE_SHADOW]: boolean;
|
|
39
39
|
[ShadowEvent.SHOW_AFTER_SHADOW]: boolean;
|
|
40
|
+
tableWrapperWidth?: number;
|
|
41
|
+
tableWrapperHeight?: number;
|
|
40
42
|
}
|
|
41
43
|
declare class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
42
44
|
static displayName: string;
|
|
@@ -50,6 +52,7 @@ declare class TableComponent extends React.Component<ComponentProps, TableState>
|
|
|
50
52
|
private stickyScrollbar?;
|
|
51
53
|
private isInitialOverflowSent;
|
|
52
54
|
private initialOverflowCaptureTimerId?;
|
|
55
|
+
private resizeObserver?;
|
|
53
56
|
private dragAndDropCleanupFn?;
|
|
54
57
|
constructor(props: ComponentProps);
|
|
55
58
|
componentDidMount(): void;
|
|
@@ -58,6 +61,7 @@ declare class TableComponent extends React.Component<ComponentProps, TableState>
|
|
|
58
61
|
componentDidUpdate(_: any, prevState: TableState): void;
|
|
59
62
|
private updateShadowState;
|
|
60
63
|
private createShadowSentinels;
|
|
64
|
+
private observeTable;
|
|
61
65
|
onStickyState: (state: StickyPluginState) => void;
|
|
62
66
|
prevTableState: any;
|
|
63
67
|
render(): JSX.Element;
|
|
@@ -25,8 +25,9 @@ type ResizableTableContainerProps = {
|
|
|
25
25
|
isResizing?: boolean;
|
|
26
26
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
27
27
|
isTableScalingEnabled?: boolean;
|
|
28
|
+
tableWrapperHeight?: number;
|
|
28
29
|
};
|
|
29
|
-
export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, editorView, getPos, tableRef, isResizing, pluginInjectionApi, isTableScalingEnabled, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
|
|
30
|
+
export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, editorView, getPos, tableRef, isResizing, pluginInjectionApi, isTableScalingEnabled, tableWrapperHeight, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
|
|
30
31
|
type TableContainerProps = {
|
|
31
32
|
node: PMNode;
|
|
32
33
|
className: string;
|
|
@@ -40,6 +41,7 @@ type TableContainerProps = {
|
|
|
40
41
|
isResizing?: boolean;
|
|
41
42
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
42
43
|
isTableScalingEnabled?: boolean;
|
|
44
|
+
tableWrapperHeight?: number;
|
|
43
45
|
};
|
|
44
|
-
export declare const TableContainer: ({ children, node, className, containerWidth: { lineLength, width: editorWidth }, isTableResizingEnabled, isBreakoutEnabled, editorView, getPos, tableRef, isNested, isResizing, pluginInjectionApi, isTableScalingEnabled, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
|
|
46
|
+
export declare const TableContainer: ({ children, node, className, containerWidth: { lineLength, width: editorWidth }, isTableResizingEnabled, isBreakoutEnabled, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isTableScalingEnabled, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
|
|
45
47
|
export {};
|
package/dist/types/types.d.ts
CHANGED
|
@@ -412,9 +412,6 @@ export interface ToolbarMenuState {
|
|
|
412
412
|
export interface ToolbarMenuContext {
|
|
413
413
|
formatMessage: IntlShape['formatMessage'];
|
|
414
414
|
}
|
|
415
|
-
export type ElementContentRects = {
|
|
416
|
-
[key: string]: ResizeObserverEntry['contentRect'];
|
|
417
|
-
};
|
|
418
415
|
export declare enum ShadowEvent {
|
|
419
416
|
SHOW_BEFORE_SHADOW = "showBeforeShadow",
|
|
420
417
|
SHOW_AFTER_SHADOW = "showAfterShadow"
|
|
@@ -25,6 +25,7 @@ export interface Props {
|
|
|
25
25
|
tableContainerWidth?: number;
|
|
26
26
|
isNumberColumnEnabled?: boolean;
|
|
27
27
|
getScrollOffset?: () => number;
|
|
28
|
+
tableWrapperHeight?: number;
|
|
28
29
|
}
|
|
29
|
-
export declare const TableFloatingColumnControls: ({ editorView, tableRef, getNode, tableActive, hasHeaderRow, hoveredCell, isResizing, stickyHeader, selection, isInDanger, isTableHovered, tableContainerWidth, isNumberColumnEnabled, getScrollOffset, }: Props) => JSX.Element | null;
|
|
30
|
+
export declare const TableFloatingColumnControls: ({ editorView, tableRef, getNode, tableActive, hasHeaderRow, hoveredCell, isResizing, stickyHeader, selection, isInDanger, isTableHovered, tableContainerWidth, isNumberColumnEnabled, getScrollOffset, tableWrapperHeight, }: Props) => JSX.Element | null;
|
|
30
31
|
export default TableFloatingColumnControls;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import type { TableColumnOrdering } from '@atlaskit/custom-steps';
|
|
3
3
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import type { RowStickyState } from '../../pm-plugins/sticky-headers';
|
|
7
7
|
import type { CellHoverMeta } from '../../types';
|
|
8
|
-
export interface
|
|
8
|
+
export interface TableFloatingControlsProps {
|
|
9
9
|
editorView: EditorView;
|
|
10
10
|
selection?: Selection;
|
|
11
11
|
tableRef?: HTMLTableElement;
|
|
@@ -25,24 +25,7 @@ export interface Props {
|
|
|
25
25
|
ordering?: TableColumnOrdering;
|
|
26
26
|
stickyHeader?: RowStickyState;
|
|
27
27
|
insertRowButtonIndex?: number;
|
|
28
|
+
tableWrapperWidth?: number;
|
|
28
29
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
tableWrapperHeight: number;
|
|
32
|
-
}
|
|
33
|
-
export default class TableFloatingControls extends Component<Props, State> {
|
|
34
|
-
static displayName: string;
|
|
35
|
-
private resizeObserver?;
|
|
36
|
-
constructor(props: Props);
|
|
37
|
-
componentDidMount(): void;
|
|
38
|
-
componentDidUpdate(): void;
|
|
39
|
-
private tryInitResizeObserver;
|
|
40
|
-
shouldComponentUpdate(nextProps: Props, nextState: State): boolean;
|
|
41
|
-
componentWillUnmount(): void;
|
|
42
|
-
render(): JSX.Element | null;
|
|
43
|
-
private selectRow;
|
|
44
|
-
private selectRows;
|
|
45
|
-
private hoverRows;
|
|
46
|
-
private updateCellHoverLocation;
|
|
47
|
-
}
|
|
48
|
-
export {};
|
|
30
|
+
export declare const TableFloatingControls: ({ editorView, tableRef, tableNode, isInDanger, isResizing, isNumberColumnEnabled, isHeaderRowEnabled, isHeaderColumnEnabled, tableActive, hasHeaderRow, hoveredRows, stickyHeader, isDragAndDropEnabled, hoveredCell, isTableHovered, tableWrapperWidth, }: TableFloatingControlsProps) => JSX.Element | null;
|
|
31
|
+
export default TableFloatingControls;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ElementContentRects } from '../types';
|
|
2
1
|
export declare const isCell: (node: HTMLElement | null) => boolean;
|
|
3
2
|
export declare const isCornerButton: (node: HTMLElement | null) => boolean;
|
|
4
3
|
export declare const isInsertRowButton: (node: HTMLElement | null) => boolean | HTMLElement | null;
|
|
@@ -13,7 +12,16 @@ export declare const isDragRowControlsButton: (node: HTMLElement | null) => true
|
|
|
13
12
|
export declare const isDragRowFloatingInsertDot: (node: HTMLElement | null) => boolean;
|
|
14
13
|
export declare const isDragColumnFloatingInsertDot: (node: HTMLElement | null) => boolean;
|
|
15
14
|
export declare const isDragCornerButton: (node: HTMLElement | null) => boolean;
|
|
16
|
-
|
|
15
|
+
/**
|
|
16
|
+
* This can be used with mouse events to determine the left/right side of the target the pointer is closest too.
|
|
17
|
+
*
|
|
18
|
+
* WARNING: This metod reads properties which can trigger a reflow; use this wisely.
|
|
19
|
+
*
|
|
20
|
+
* @param mouseEvent
|
|
21
|
+
* @param gapInPixels
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
export declare const getMousePositionHorizontalRelativeByElement: (mouseEvent: MouseEvent, offsetX: number, gapInPixels?: number) => 'left' | 'right' | null;
|
|
17
25
|
export declare const getMousePositionVerticalRelativeByElement: (mouseEvent: MouseEvent) => 'top' | 'bottom' | null;
|
|
18
26
|
export declare const hasResizeHandler: ({ columnEndIndexTarget, target, }: {
|
|
19
27
|
columnEndIndexTarget: number;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import type { ElementContentRects } from './types';
|
|
5
4
|
export declare const handleBlur: (view: EditorView, event: Event) => boolean;
|
|
6
5
|
export declare const handleFocus: (view: EditorView, event: Event) => boolean;
|
|
7
6
|
export declare const handleClick: (view: EditorView, event: Event) => boolean;
|
|
@@ -11,9 +10,9 @@ export declare const handleMouseDown: (_: EditorView, event: Event) => boolean;
|
|
|
11
10
|
export declare const handleMouseOut: (view: EditorView, mouseEvent: Event) => boolean;
|
|
12
11
|
export declare const handleMouseEnter: (view: EditorView, mouseEvent: Event) => boolean;
|
|
13
12
|
export declare const handleMouseLeave: (view: EditorView, event: Event) => boolean;
|
|
14
|
-
export declare const handleMouseMove: (view: EditorView, event: Event
|
|
13
|
+
export declare const handleMouseMove: (view: EditorView, event: Event) => boolean;
|
|
15
14
|
export declare function handleTripleClick(view: EditorView, pos: number): boolean;
|
|
16
15
|
export declare const handleCut: (oldTr: Transaction, oldState: EditorState, newState: EditorState, editorAnalyticsAPI?: EditorAnalyticsAPI, editorView?: EditorView, isTableScalingEnabled?: boolean) => Transaction;
|
|
17
16
|
export declare const isTableInFocus: (view: EditorView) => boolean;
|
|
18
|
-
export declare const whenTableInFocus: (eventHandler: (view: EditorView, mouseEvent: Event
|
|
19
|
-
export declare const withCellTracking: (eventHandler: (view: EditorView, mouseEvent: Event
|
|
17
|
+
export declare const whenTableInFocus: (eventHandler: (view: EditorView, mouseEvent: Event) => boolean) => (view: EditorView, mouseEvent: Event) => boolean;
|
|
18
|
+
export declare const withCellTracking: (eventHandler: (view: EditorView, mouseEvent: Event) => boolean) => (view: EditorView, mouseEvent: Event) => boolean;
|
|
@@ -19,6 +19,8 @@ export declare class OverflowShadowsObserver {
|
|
|
19
19
|
* e.g. bounds on an IntersectionObserverEntry, otherwise proceed with
|
|
20
20
|
* reading it from sticky cell
|
|
21
21
|
*/
|
|
22
|
-
updateStickyShadows: (stickyRowHeight?: number) => void
|
|
22
|
+
updateStickyShadows: ((stickyRowHeight?: number) => void) & {
|
|
23
|
+
cancel(): void;
|
|
24
|
+
};
|
|
23
25
|
dispose(): void;
|
|
24
26
|
}
|