@atlaskit/editor-plugin-table 5.1.0 → 5.2.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.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/plugins/table/index.js +3 -2
- package/dist/cjs/plugins/table/nodeviews/TableCell.js +111 -0
- package/dist/cjs/plugins/table/nodeviews/TableNodeViewBase.js +30 -0
- package/dist/cjs/plugins/table/{pm-plugins/sticky-headers/nodeviews/tableRow.js → nodeviews/TableRow.js} +363 -303
- package/dist/cjs/plugins/table/pm-plugins/main.js +16 -13
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/index.js +1 -8
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/plugin.js +1 -9
- package/dist/cjs/plugins/table/types.js +4 -1
- package/dist/cjs/plugins/table/utils/dom.js +31 -1
- package/dist/cjs/plugins/table/utils/index.js +12 -0
- package/dist/cjs/plugins/table/utils/nodes.js +31 -7
- package/dist/es2019/plugins/table/index.js +3 -2
- package/dist/es2019/plugins/table/nodeviews/{tableCell.js → TableCell.js} +28 -24
- package/dist/es2019/plugins/table/nodeviews/TableNodeViewBase.js +22 -0
- package/dist/es2019/plugins/table/{pm-plugins/sticky-headers/nodeviews/tableRow.js → nodeviews/TableRow.js} +324 -280
- package/dist/es2019/plugins/table/pm-plugins/main.js +8 -8
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/index.js +1 -2
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/plugin.js +1 -9
- package/dist/es2019/plugins/table/types.js +5 -1
- package/dist/es2019/plugins/table/utils/dom.js +30 -0
- package/dist/es2019/plugins/table/utils/index.js +1 -1
- package/dist/es2019/plugins/table/utils/nodes.js +16 -0
- package/dist/esm/plugins/table/index.js +3 -2
- package/dist/esm/plugins/table/nodeviews/TableCell.js +105 -0
- package/dist/esm/plugins/table/nodeviews/TableNodeViewBase.js +24 -0
- package/dist/esm/plugins/table/{pm-plugins/sticky-headers/nodeviews/tableRow.js → nodeviews/TableRow.js} +364 -303
- package/dist/esm/plugins/table/pm-plugins/main.js +16 -13
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/index.js +1 -2
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/plugin.js +1 -9
- package/dist/esm/plugins/table/types.js +5 -1
- package/dist/esm/plugins/table/utils/dom.js +30 -0
- package/dist/esm/plugins/table/utils/index.js +1 -1
- package/dist/esm/plugins/table/utils/nodes.js +24 -0
- package/dist/types/plugins/table/nodeviews/TableCell.d.ts +13 -0
- package/dist/types/plugins/table/nodeviews/TableNodeViewBase.d.ts +18 -0
- package/dist/types/plugins/table/nodeviews/TableRow.d.ts +62 -0
- package/dist/types/plugins/table/pm-plugins/main.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/sticky-headers/index.d.ts +0 -1
- package/dist/types/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +1 -1
- package/dist/types/plugins/table/types.d.ts +15 -0
- package/dist/types/plugins/table/utils/dom.d.ts +6 -0
- package/dist/types/plugins/table/utils/index.d.ts +1 -1
- package/dist/types/plugins/table/utils/nodes.d.ts +12 -2
- package/dist/types-ts4.5/plugins/table/nodeviews/TableCell.d.ts +13 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/TableNodeViewBase.d.ts +18 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/TableRow.d.ts +62 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/main.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/types.d.ts +15 -0
- package/dist/types-ts4.5/plugins/table/utils/dom.d.ts +6 -0
- package/dist/types-ts4.5/plugins/table/utils/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/utils/nodes.d.ts +12 -2
- package/package.json +4 -2
- package/src/__tests__/unit/nodeviews/cell.ts +2 -2
- package/src/__tests__/unit/pm-plugins/sticky-headers/tableRow.tsx +25 -148
- package/src/plugins/table/index.tsx +2 -0
- package/src/plugins/table/nodeviews/{tableCell.tsx → TableCell.ts} +41 -46
- package/src/plugins/table/nodeviews/TableNodeViewBase.ts +32 -0
- package/src/plugins/table/{pm-plugins/sticky-headers/nodeviews/tableRow.ts → nodeviews/TableRow.ts} +246 -246
- package/src/plugins/table/pm-plugins/main.ts +10 -19
- package/src/plugins/table/pm-plugins/sticky-headers/index.ts +0 -1
- package/src/plugins/table/pm-plugins/sticky-headers/plugin.ts +1 -9
- package/src/plugins/table/types.ts +18 -0
- package/src/plugins/table/utils/dom.ts +38 -0
- package/src/plugins/table/utils/index.ts +2 -0
- package/src/plugins/table/utils/nodes.ts +30 -2
- package/tsconfig.app.json +6 -0
- package/dist/cjs/plugins/table/nodeviews/tableCell.js +0 -99
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.js +0 -35
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.js +0 -29
- package/dist/esm/plugins/table/nodeviews/tableCell.js +0 -93
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.js +0 -29
- package/dist/types/plugins/table/nodeviews/tableCell.d.ts +0 -17
- package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.d.ts +0 -6
- package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +0 -73
- package/dist/types-ts4.5/plugins/table/nodeviews/tableCell.d.ts +0 -17
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.d.ts +0 -6
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +0 -73
- package/src/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.ts +0 -37
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
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";
|
|
3
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
+
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); }; }
|
|
9
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
4
10
|
import debounce from 'lodash/debounce';
|
|
5
11
|
import throttle from 'lodash/throttle';
|
|
6
12
|
import { findOverflowScrollParent } from '@atlaskit/editor-common/ui';
|
|
7
|
-
import { browser
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { updateStickyState } from '../commands';
|
|
13
|
-
import {
|
|
13
|
+
import { browser } from '@atlaskit/editor-common/utils';
|
|
14
|
+
import { attachClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge';
|
|
15
|
+
import { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/adapter/element';
|
|
16
|
+
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
17
|
+
import { pluginKey as tablePluginKey } from '../pm-plugins/plugin-key';
|
|
18
|
+
import { updateStickyState } from '../pm-plugins/sticky-headers/commands';
|
|
19
|
+
import { syncStickyRowToTable, updateStickyMargins as updateTableMargin } from '../pm-plugins/table-resizing/utils/dom';
|
|
20
|
+
import { TableCssClassName as ClassName, TableCssClassName } from '../types';
|
|
21
|
+
import { STICKY_HEADER_TOGGLE_TOLERANCE_MS, stickyHeaderBorderBottomWidth, stickyRowOffsetTop, tableControlsSpacing, tableScrollbarOffset } from '../ui/consts';
|
|
22
|
+
import { getTop, getTree } from '../utils/dom';
|
|
23
|
+
import { supportedHeaderRow } from '../utils/nodes';
|
|
24
|
+
import TableNodeView from './TableNodeViewBase';
|
|
14
25
|
|
|
15
26
|
// limit scroll event calls
|
|
16
27
|
var HEADER_ROW_SCROLL_THROTTLE_TIMEOUT = 200;
|
|
@@ -18,268 +29,179 @@ var HEADER_ROW_SCROLL_THROTTLE_TIMEOUT = 200;
|
|
|
18
29
|
// timeout for resetting the scroll class - if it’s too long then users won’t be able to click on the header cells,
|
|
19
30
|
// if too short it would trigger too many dom updates.
|
|
20
31
|
var HEADER_ROW_SCROLL_RESET_DEBOUNCE_TIMEOUT = 400;
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
*/
|
|
37
|
-
export var supportedHeaderRow = function supportedHeaderRow(node) {
|
|
38
|
-
var allHeaders = mapChildren(node, function (child) {
|
|
39
|
-
return child.type.name === 'tableHeader';
|
|
40
|
-
}).every(Boolean);
|
|
41
|
-
var someMerged = anyChildCellMergedAcrossRow(node);
|
|
42
|
-
return allHeaders && !someMerged;
|
|
43
|
-
};
|
|
44
|
-
export var TableRowNodeView = /*#__PURE__*/function () {
|
|
45
|
-
function TableRowNodeView(node, view, getPos, eventDispatcher) {
|
|
46
|
-
var _this = this;
|
|
47
|
-
_classCallCheck(this, TableRowNodeView);
|
|
48
|
-
// this is the sticky header table row
|
|
49
|
-
_defineProperty(this, "colControlsOffset", 0);
|
|
50
|
-
_defineProperty(this, "focused", false);
|
|
51
|
-
_defineProperty(this, "topPosEditorElement", 0);
|
|
52
|
-
_defineProperty(this, "sentinels", {});
|
|
53
|
-
/* external events */
|
|
54
|
-
_defineProperty(this, "listening", false);
|
|
55
|
-
_defineProperty(this, "headerRowMouseScrollEnd", debounce(function () {
|
|
32
|
+
var TableRow = /*#__PURE__*/function (_ref) {
|
|
33
|
+
_inherits(TableRow, _ref);
|
|
34
|
+
var _super = _createSuper(TableRow);
|
|
35
|
+
function TableRow(node, view, getPos, eventDispatcher) {
|
|
36
|
+
var _this;
|
|
37
|
+
_classCallCheck(this, TableRow);
|
|
38
|
+
_this = _super.call(this, node, view, getPos, eventDispatcher);
|
|
39
|
+
_defineProperty(_assertThisInitialized(_this), "colControlsOffset", 0);
|
|
40
|
+
_defineProperty(_assertThisInitialized(_this), "focused", false);
|
|
41
|
+
_defineProperty(_assertThisInitialized(_this), "topPosEditorElement", 0);
|
|
42
|
+
_defineProperty(_assertThisInitialized(_this), "sentinels", {});
|
|
43
|
+
_defineProperty(_assertThisInitialized(_this), "listening", false);
|
|
44
|
+
_defineProperty(_assertThisInitialized(_this), "padding", 0);
|
|
45
|
+
_defineProperty(_assertThisInitialized(_this), "top", 0);
|
|
46
|
+
_defineProperty(_assertThisInitialized(_this), "headerRowMouseScrollEnd", debounce(function () {
|
|
56
47
|
_this.dom.classList.remove('no-pointer-events');
|
|
57
48
|
}, HEADER_ROW_SCROLL_RESET_DEBOUNCE_TIMEOUT));
|
|
58
49
|
// When the header is sticky, the header row is set to position: fixed
|
|
59
50
|
// This prevents mouse wheel scrolling on the scroll-parent div when user's mouse is hovering the header row.
|
|
60
51
|
// This fix sets pointer-events: none on the header row briefly to avoid this behaviour
|
|
61
|
-
_defineProperty(
|
|
52
|
+
_defineProperty(_assertThisInitialized(_this), "headerRowMouseScroll", throttle(function () {
|
|
62
53
|
if (_this.isSticky) {
|
|
63
54
|
_this.dom.classList.add('no-pointer-events');
|
|
64
55
|
_this.headerRowMouseScrollEnd();
|
|
65
56
|
}
|
|
66
57
|
}, HEADER_ROW_SCROLL_THROTTLE_TIMEOUT));
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
58
|
+
_this.isHeaderRow = supportedHeaderRow(node);
|
|
59
|
+
_this.isSticky = false;
|
|
60
|
+
var _getPluginState = getPluginState(view.state),
|
|
61
|
+
pluginConfig = _getPluginState.pluginConfig,
|
|
62
|
+
isDragAndDropEnabled = _getPluginState.isDragAndDropEnabled;
|
|
63
|
+
_this.isStickyHeaderEnabled = !!pluginConfig.stickyHeaders;
|
|
64
|
+
_this.isDragAndDropEnabled = !!isDragAndDropEnabled;
|
|
65
|
+
if (_this.isHeaderRow) {
|
|
66
|
+
_this.dom.setAttribute('data-header-row', 'true');
|
|
67
|
+
if (_this.isStickyHeaderEnabled) {
|
|
68
|
+
_this.subscribe();
|
|
73
69
|
}
|
|
70
|
+
}
|
|
71
|
+
if (_this.isDragAndDropEnabled) {
|
|
72
|
+
_this.addDropTarget(_this.contentDOM);
|
|
73
|
+
}
|
|
74
|
+
return _this;
|
|
75
|
+
}
|
|
74
76
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if (el) {
|
|
79
|
-
delete el.dataset.isObserved;
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
var isCurrentTableSelected = tableRef === tree.table;
|
|
77
|
+
/**
|
|
78
|
+
* Variables
|
|
79
|
+
*/
|
|
84
80
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
if (
|
|
95
|
-
|
|
96
|
-
if (layoutContainer && layoutContainer.getAttribute('data-layout-content')) {
|
|
97
|
-
// move table a little out of the way
|
|
98
|
-
// to provide spacing for table controls
|
|
99
|
-
tableContentWrapper.style.paddingLeft = '11px';
|
|
100
|
-
}
|
|
101
|
-
} else {
|
|
102
|
-
_this.colControlsOffset = 0;
|
|
103
|
-
if (layoutContainer && layoutContainer.getAttribute('data-layout-content')) {
|
|
104
|
-
tableContentWrapper.style.removeProperty('padding-left');
|
|
105
|
-
}
|
|
81
|
+
// @ts-ignore
|
|
82
|
+
_createClass(TableRow, [{
|
|
83
|
+
key: "update",
|
|
84
|
+
value:
|
|
85
|
+
/**
|
|
86
|
+
* Methods: Nodeview Lifecycle
|
|
87
|
+
*/
|
|
88
|
+
function update(node) {
|
|
89
|
+
// do nothing if nodes were identical
|
|
90
|
+
if (node === this.node) {
|
|
91
|
+
return true;
|
|
106
92
|
}
|
|
107
93
|
|
|
108
|
-
//
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
_defineProperty(this, "updateStickyHeaderWidth", function () {
|
|
114
|
-
// table width might have changed, sync that back to sticky row
|
|
115
|
-
var tree = _this.tree;
|
|
116
|
-
if (!tree) {
|
|
117
|
-
return;
|
|
94
|
+
// see if we're changing into a header row or
|
|
95
|
+
// changing away from one
|
|
96
|
+
var newNodeIsHeaderRow = supportedHeaderRow(node);
|
|
97
|
+
if (this.isHeaderRow !== newNodeIsHeaderRow) {
|
|
98
|
+
return false; // re-create nodeview
|
|
118
99
|
}
|
|
119
|
-
syncStickyRowToTable(tree.table);
|
|
120
|
-
});
|
|
121
|
-
_defineProperty(this, "shouldHeaderStick", function (tree) {
|
|
122
|
-
var wrapper = tree.wrapper;
|
|
123
|
-
var tableWrapperRect = wrapper.getBoundingClientRect();
|
|
124
|
-
var editorAreaRect = _this.editorScrollableElement.getBoundingClientRect();
|
|
125
|
-
var stickyHeaderRect = _this.contentDOM.getBoundingClientRect();
|
|
126
|
-
var firstHeaderRow = !_this.dom.previousElementSibling;
|
|
127
|
-
var subsequentRows = !!_this.dom.nextElementSibling;
|
|
128
|
-
var isHeaderValid = firstHeaderRow && subsequentRows;
|
|
129
100
|
|
|
130
|
-
//
|
|
131
|
-
|
|
132
|
-
// but bottom is still in the viewport.
|
|
133
|
-
if (tableWrapperRect.top < editorAreaRect.top && tableWrapperRect.bottom > editorAreaRect.top && isHeaderValid) {
|
|
134
|
-
return true;
|
|
135
|
-
}
|
|
101
|
+
// node is different but no need to re-create nodeview
|
|
102
|
+
this.node = node;
|
|
136
103
|
|
|
137
|
-
//
|
|
138
|
-
if (
|
|
139
|
-
return
|
|
104
|
+
// don't do anything if we're just a regular tr
|
|
105
|
+
if (!this.isHeaderRow) {
|
|
106
|
+
return true;
|
|
140
107
|
}
|
|
141
108
|
|
|
142
|
-
//
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
* Useful when the header may have detached from the table.
|
|
148
|
-
*/
|
|
149
|
-
_defineProperty(this, "refireIntersectionObservers", function () {
|
|
150
|
-
if (_this.isSticky) {
|
|
151
|
-
[_this.sentinels.top, _this.sentinels.bottom].forEach(function (el) {
|
|
152
|
-
if (el && _this.intersectionObserver) {
|
|
153
|
-
_this.intersectionObserver.unobserve(el);
|
|
154
|
-
_this.intersectionObserver.observe(el);
|
|
155
|
-
}
|
|
156
|
-
});
|
|
109
|
+
// something changed, sync widths
|
|
110
|
+
if (this.isStickyHeaderEnabled) {
|
|
111
|
+
var tbody = this.dom.parentElement;
|
|
112
|
+
var table = tbody && tbody.parentElement;
|
|
113
|
+
syncStickyRowToTable(table);
|
|
157
114
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
}, {
|
|
118
|
+
key: "destroy",
|
|
119
|
+
value: function destroy() {
|
|
120
|
+
var _this$dropTargetClean;
|
|
121
|
+
if (this.isStickyHeaderEnabled) {
|
|
122
|
+
this.unsubscribe();
|
|
123
|
+
var tree = getTree(this.dom);
|
|
124
|
+
if (tree) {
|
|
125
|
+
this.makeRowHeaderNotSticky(tree.table, true);
|
|
126
|
+
}
|
|
127
|
+
this.emitOff(true);
|
|
164
128
|
}
|
|
165
|
-
var table = tree.table,
|
|
166
|
-
wrapper = tree.wrapper;
|
|
167
129
|
|
|
168
|
-
//
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
130
|
+
// If a drop target cleanup method has been set then we should call it.
|
|
131
|
+
(_this$dropTargetClean = this.dropTargetCleanup) === null || _this$dropTargetClean === void 0 || _this$dropTargetClean.call(this);
|
|
132
|
+
}
|
|
133
|
+
}, {
|
|
134
|
+
key: "ignoreMutation",
|
|
135
|
+
value: function ignoreMutation(mutationRecord) {
|
|
136
|
+
/* tableRows are not directly editable by the user
|
|
137
|
+
* so it should be safe to ignore mutations that we cause
|
|
138
|
+
* by updating styles and classnames on this DOM element
|
|
139
|
+
*
|
|
140
|
+
* Update: should not ignore mutations for row selection to avoid known issue with table selection highlight in firefox
|
|
141
|
+
* Related bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1289673
|
|
142
|
+
* */
|
|
143
|
+
var isTableSelection = mutationRecord.type === 'selection' && mutationRecord.target.nodeName === 'TR';
|
|
144
|
+
/**
|
|
145
|
+
* Update: should not ignore mutations when an node is added, as this interferes with
|
|
146
|
+
* prosemirrors handling of some language inputs in Safari (ie. Pinyin, Hiragana).
|
|
147
|
+
*
|
|
148
|
+
* In paticular, when a composition occurs at the start of the first node inside a table cell, if the resulting mutation
|
|
149
|
+
* from the composition end is ignored than prosemirror will end up with; invalid table markup nesting and a misplaced
|
|
150
|
+
* selection and insertion.
|
|
151
|
+
*/
|
|
152
|
+
var isNodeInsertion = mutationRecord.type === 'childList' && mutationRecord.target.nodeName === 'TR' && mutationRecord.addedNodes.length;
|
|
153
|
+
if (isTableSelection || isNodeInsertion) {
|
|
154
|
+
return false;
|
|
177
155
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
var _this$editorScrollabl;
|
|
181
|
-
syncStickyRowToTable(table);
|
|
182
|
-
_this.dom.classList.add('sticky');
|
|
183
|
-
table.classList.add(ClassName.TABLE_STICKY);
|
|
184
|
-
_this.isSticky = true;
|
|
156
|
+
return true;
|
|
157
|
+
}
|
|
185
158
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
});
|
|
195
|
-
var fastScrollThresholdMs = 500;
|
|
196
|
-
setTimeout(function () {
|
|
197
|
-
_this.refireIntersectionObservers();
|
|
198
|
-
}, fastScrollThresholdMs);
|
|
199
|
-
}
|
|
200
|
-
_this.dom.style.top = "".concat(domTop, "px");
|
|
201
|
-
updateTableMargin(table);
|
|
202
|
-
_this.dom.scrollLeft = wrapper.scrollLeft;
|
|
203
|
-
_this.emitOn(domTop, _this.colControlsOffset);
|
|
204
|
-
});
|
|
205
|
-
_defineProperty(this, "makeRowHeaderNotSticky", function (table) {
|
|
206
|
-
var isEditorDestroyed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
207
|
-
if (!_this.isSticky || !table || !_this.dom) {
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
_this.dom.style.removeProperty('width');
|
|
211
|
-
_this.dom.classList.remove('sticky');
|
|
212
|
-
table.classList.remove(ClassName.TABLE_STICKY);
|
|
213
|
-
_this.isSticky = false;
|
|
214
|
-
_this.dom.style.top = '';
|
|
215
|
-
table.style.removeProperty('margin-top');
|
|
216
|
-
_this.emitOff(isEditorDestroyed);
|
|
217
|
-
});
|
|
218
|
-
_defineProperty(this, "getWrapperoffset", function () {
|
|
219
|
-
var inverse = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
220
|
-
var focusValue = inverse ? !_this.focused : _this.focused;
|
|
221
|
-
return focusValue ? 0 : tableControlsSpacing;
|
|
222
|
-
});
|
|
223
|
-
_defineProperty(this, "getWrapperRefTop", function (wrapper) {
|
|
224
|
-
return Math.round(getTop(wrapper)) + _this.getWrapperoffset();
|
|
225
|
-
});
|
|
226
|
-
// TODO: rename!
|
|
227
|
-
_defineProperty(this, "getScrolledTableTop", function (wrapper) {
|
|
228
|
-
return _this.getWrapperRefTop(wrapper) - _this.topPosEditorElement;
|
|
229
|
-
});
|
|
230
|
-
_defineProperty(this, "getCurrentTableTop", function (tree) {
|
|
231
|
-
return _this.getScrolledTableTop(tree.wrapper) + tree.table.clientHeight;
|
|
232
|
-
});
|
|
233
|
-
/* emit external events */
|
|
234
|
-
_defineProperty(this, "padding", 0);
|
|
235
|
-
_defineProperty(this, "top", 0);
|
|
236
|
-
_defineProperty(this, "emitOn", function (top, padding) {
|
|
237
|
-
if (top === _this.top && padding === _this.padding) {
|
|
159
|
+
/**
|
|
160
|
+
* Methods
|
|
161
|
+
*/
|
|
162
|
+
}, {
|
|
163
|
+
key: "addDropTarget",
|
|
164
|
+
value: function addDropTarget(element) {
|
|
165
|
+
var pos = this.getPos();
|
|
166
|
+
if (!Number.isFinite(pos)) {
|
|
238
167
|
return;
|
|
239
168
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
updateStickyState({
|
|
243
|
-
pos: _this.getPos(),
|
|
244
|
-
top: top,
|
|
245
|
-
sticky: true,
|
|
246
|
-
padding: padding
|
|
247
|
-
})(_this.view.state, _this.view.dispatch, _this.view);
|
|
248
|
-
});
|
|
249
|
-
_defineProperty(this, "emitOff", function (isEditorDestroyed) {
|
|
250
|
-
if (_this.top === 0 && _this.padding === 0) {
|
|
251
|
-
return;
|
|
169
|
+
if (this.dropTargetCleanup) {
|
|
170
|
+
this.dropTargetCleanup();
|
|
252
171
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
172
|
+
var resolvedPos = this.view.state.doc.resolve(pos);
|
|
173
|
+
var targetIndex = resolvedPos.index();
|
|
174
|
+
var localId = resolvedPos.parent.attrs.localId;
|
|
175
|
+
this.dropTargetCleanup = dropTargetForElements({
|
|
176
|
+
element: element,
|
|
177
|
+
canDrop: function canDrop(_ref2) {
|
|
178
|
+
var _data$indexes, _data$indexes2;
|
|
179
|
+
var source = _ref2.source;
|
|
180
|
+
var data = source.data;
|
|
181
|
+
return (
|
|
182
|
+
// Only draggables of row type can be dropped on this target
|
|
183
|
+
data.type === 'table-row' &&
|
|
184
|
+
// Only draggables which came from the same table can be dropped on this target
|
|
185
|
+
data.localId === localId &&
|
|
186
|
+
// Only draggables which DO NOT include this drop targets index can be dropped
|
|
187
|
+
!!((_data$indexes = data.indexes) !== null && _data$indexes !== void 0 && _data$indexes.length) && ((_data$indexes2 = data.indexes) === null || _data$indexes2 === void 0 ? void 0 : _data$indexes2.indexOf(targetIndex)) === -1
|
|
188
|
+
);
|
|
189
|
+
},
|
|
190
|
+
getData: function getData(_ref3) {
|
|
191
|
+
var input = _ref3.input,
|
|
192
|
+
element = _ref3.element;
|
|
193
|
+
var data = {
|
|
194
|
+
localId: localId,
|
|
195
|
+
type: 'table-row',
|
|
196
|
+
targetIndex: targetIndex
|
|
197
|
+
};
|
|
198
|
+
return attachClosestEdge(data, {
|
|
199
|
+
input: input,
|
|
200
|
+
element: element,
|
|
201
|
+
allowedEdges: ['top', 'bottom']
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
});
|
|
283
205
|
}
|
|
284
206
|
}, {
|
|
285
207
|
key: "subscribe",
|
|
@@ -289,8 +211,8 @@ export var TableRowNodeView = /*#__PURE__*/function () {
|
|
|
289
211
|
this.initObservers();
|
|
290
212
|
this.topPosEditorElement = getTop(this.editorScrollableElement);
|
|
291
213
|
}
|
|
292
|
-
this.eventDispatcher.on('widthPlugin', this.updateStickyHeaderWidth);
|
|
293
|
-
this.eventDispatcher.on(tablePluginKey.key, this.onTablePluginState);
|
|
214
|
+
this.eventDispatcher.on('widthPlugin', this.updateStickyHeaderWidth.bind(this));
|
|
215
|
+
this.eventDispatcher.on(tablePluginKey.key, this.onTablePluginState.bind(this));
|
|
294
216
|
this.listening = true;
|
|
295
217
|
this.dom.addEventListener('wheel', this.headerRowMouseScroll.bind(this), {
|
|
296
218
|
passive: true
|
|
@@ -344,9 +266,9 @@ export var TableRowNodeView = /*#__PURE__*/function () {
|
|
|
344
266
|
this.resizeObserver.observe(this.editorScrollableElement);
|
|
345
267
|
}
|
|
346
268
|
window.requestAnimationFrame(function () {
|
|
347
|
-
var
|
|
269
|
+
var _getTree;
|
|
348
270
|
// we expect tree to be defined after animation frame
|
|
349
|
-
var tableContainer = (
|
|
271
|
+
var tableContainer = (_getTree = getTree(_this2.dom)) === null || _getTree === void 0 ? void 0 : _getTree.wrapper.closest(".".concat(TableCssClassName.NODEVIEW_WRAPPER));
|
|
350
272
|
if (tableContainer) {
|
|
351
273
|
_this2.sentinels.top = tableContainer.getElementsByClassName(ClassName.TABLE_STICKY_SENTINEL_TOP).item(0);
|
|
352
274
|
_this2.sentinels.bottom = tableContainer.getElementsByClassName(ClassName.TABLE_STICKY_SENTINEL_BOTTOM).item(0);
|
|
@@ -368,10 +290,11 @@ export var TableRowNodeView = /*#__PURE__*/function () {
|
|
|
368
290
|
value: function createResizeObserver() {
|
|
369
291
|
var _this3 = this;
|
|
370
292
|
this.resizeObserver = new ResizeObserver(function (entries) {
|
|
371
|
-
|
|
293
|
+
var tree = getTree(_this3.dom);
|
|
294
|
+
if (!tree) {
|
|
372
295
|
return;
|
|
373
296
|
}
|
|
374
|
-
var table =
|
|
297
|
+
var table = tree.table;
|
|
375
298
|
entries.forEach(function (entry) {
|
|
376
299
|
var _this3$editorScrollab;
|
|
377
300
|
// On resize of the parent scroll element we need to adjust the width
|
|
@@ -397,10 +320,11 @@ export var TableRowNodeView = /*#__PURE__*/function () {
|
|
|
397
320
|
value: function createIntersectionObserver() {
|
|
398
321
|
var _this4 = this;
|
|
399
322
|
this.intersectionObserver = new IntersectionObserver(function (entries, _) {
|
|
400
|
-
|
|
323
|
+
var tree = getTree(_this4.dom);
|
|
324
|
+
if (!tree) {
|
|
401
325
|
return;
|
|
402
326
|
}
|
|
403
|
-
var table =
|
|
327
|
+
var table = tree.table;
|
|
404
328
|
if (table.rows.length < 2) {
|
|
405
329
|
// ED-19307 - When there's only one row in a table the top & bottom sentinels become inverted. This creates some nasty visiblity
|
|
406
330
|
// toggling side-effects because the intersection observers gets confused.
|
|
@@ -419,7 +343,7 @@ export var TableRowNodeView = /*#__PURE__*/function () {
|
|
|
419
343
|
var sentinelIsBelowScrollArea = (((_entry$rootBounds2 = entry.rootBounds) === null || _entry$rootBounds2 === void 0 ? void 0 : _entry$rootBounds2.bottom) || 0) < entry.boundingClientRect.bottom;
|
|
420
344
|
if (!entry.isIntersecting && !sentinelIsBelowScrollArea) {
|
|
421
345
|
var _entry$rootBounds3;
|
|
422
|
-
|
|
346
|
+
tree && _this4.makeHeaderRowSticky(tree, (_entry$rootBounds3 = entry.rootBounds) === null || _entry$rootBounds3 === void 0 ? void 0 : _entry$rootBounds3.top);
|
|
423
347
|
_this4.lastStickyTimestamp = Date.now();
|
|
424
348
|
} else {
|
|
425
349
|
table && _this4.makeRowHeaderNotSticky(table);
|
|
@@ -439,7 +363,7 @@ export var TableRowNodeView = /*#__PURE__*/function () {
|
|
|
439
363
|
}
|
|
440
364
|
} else if (entry.isIntersecting && sentinelIsAboveScrollArea) {
|
|
441
365
|
var _entry$rootBounds5;
|
|
442
|
-
|
|
366
|
+
tree && _this4.makeHeaderRowSticky(tree, entry === null || entry === void 0 || (_entry$rootBounds5 = entry.rootBounds) === null || _entry$rootBounds5 === void 0 ? void 0 : _entry$rootBounds5.top);
|
|
443
367
|
_this4.lastStickyTimestamp = Date.now();
|
|
444
368
|
}
|
|
445
369
|
}
|
|
@@ -449,72 +373,209 @@ export var TableRowNodeView = /*#__PURE__*/function () {
|
|
|
449
373
|
root: this.editorScrollableElement
|
|
450
374
|
});
|
|
451
375
|
}
|
|
452
|
-
|
|
453
|
-
/* paint/update loop */
|
|
376
|
+
/* receive external events */
|
|
454
377
|
}, {
|
|
455
|
-
key: "
|
|
456
|
-
value:
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
if (
|
|
460
|
-
return
|
|
378
|
+
key: "onTablePluginState",
|
|
379
|
+
value: function onTablePluginState(state) {
|
|
380
|
+
var tableRef = state.tableRef;
|
|
381
|
+
var tree = getTree(this.dom);
|
|
382
|
+
if (!tree) {
|
|
383
|
+
return;
|
|
461
384
|
}
|
|
462
385
|
|
|
463
|
-
//
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
386
|
+
// when header rows are toggled off - mark sentinels as unobserved
|
|
387
|
+
if (!state.isHeaderRowEnabled) {
|
|
388
|
+
[this.sentinels.top, this.sentinels.bottom].forEach(function (el) {
|
|
389
|
+
if (el) {
|
|
390
|
+
delete el.dataset.isObserved;
|
|
391
|
+
}
|
|
392
|
+
});
|
|
468
393
|
}
|
|
394
|
+
var isCurrentTableSelected = tableRef === tree.table;
|
|
469
395
|
|
|
470
|
-
//
|
|
471
|
-
|
|
396
|
+
// If current table selected and header row is toggled off, turn off sticky header
|
|
397
|
+
if (isCurrentTableSelected && !state.isHeaderRowEnabled && tree) {
|
|
398
|
+
this.makeRowHeaderNotSticky(tree.table);
|
|
399
|
+
}
|
|
400
|
+
this.focused = isCurrentTableSelected;
|
|
401
|
+
var wrapper = tree.wrapper;
|
|
402
|
+
var tableContainer = wrapper.parentElement;
|
|
403
|
+
var tableContentWrapper = tableContainer.parentElement;
|
|
404
|
+
var layoutContainer = tableContentWrapper && tableContentWrapper.parentElement;
|
|
405
|
+
if (isCurrentTableSelected) {
|
|
406
|
+
this.colControlsOffset = tableControlsSpacing;
|
|
407
|
+
if (layoutContainer && layoutContainer.getAttribute('data-layout-content')) {
|
|
408
|
+
// move table a little out of the way
|
|
409
|
+
// to provide spacing for table controls
|
|
410
|
+
tableContentWrapper.style.paddingLeft = '11px';
|
|
411
|
+
}
|
|
412
|
+
} else {
|
|
413
|
+
this.colControlsOffset = 0;
|
|
414
|
+
if (layoutContainer && layoutContainer.getAttribute('data-layout-content')) {
|
|
415
|
+
tableContentWrapper.style.removeProperty('padding-left');
|
|
416
|
+
}
|
|
417
|
+
}
|
|
472
418
|
|
|
473
|
-
//
|
|
474
|
-
|
|
475
|
-
|
|
419
|
+
// run after table style changes have been committed
|
|
420
|
+
setTimeout(function () {
|
|
421
|
+
syncStickyRowToTable(tree.table);
|
|
422
|
+
}, 0);
|
|
423
|
+
}
|
|
424
|
+
}, {
|
|
425
|
+
key: "updateStickyHeaderWidth",
|
|
426
|
+
value: function updateStickyHeaderWidth() {
|
|
427
|
+
// table width might have changed, sync that back to sticky row
|
|
428
|
+
var tree = getTree(this.dom);
|
|
429
|
+
if (!tree) {
|
|
430
|
+
return;
|
|
476
431
|
}
|
|
432
|
+
syncStickyRowToTable(tree.table);
|
|
433
|
+
}
|
|
477
434
|
|
|
478
|
-
|
|
435
|
+
/**
|
|
436
|
+
* Manually refire the intersection observers.
|
|
437
|
+
* Useful when the header may have detached from the table.
|
|
438
|
+
*/
|
|
439
|
+
}, {
|
|
440
|
+
key: "refireIntersectionObservers",
|
|
441
|
+
value: function refireIntersectionObservers() {
|
|
442
|
+
var _this5 = this;
|
|
443
|
+
if (this.isSticky) {
|
|
444
|
+
[this.sentinels.top, this.sentinels.bottom].forEach(function (el) {
|
|
445
|
+
if (el && _this5.intersectionObserver) {
|
|
446
|
+
_this5.intersectionObserver.unobserve(el);
|
|
447
|
+
_this5.intersectionObserver.observe(el);
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}, {
|
|
453
|
+
key: "makeHeaderRowSticky",
|
|
454
|
+
value: function makeHeaderRowSticky(tree, scrollTop) {
|
|
455
|
+
var _tbody$firstChild,
|
|
456
|
+
_this6 = this;
|
|
457
|
+
// If header row height is more than 50% of viewport height don't do this
|
|
458
|
+
if (this.isSticky || this.stickyRowHeight && this.stickyRowHeight > window.innerHeight / 2) {
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
var table = tree.table,
|
|
462
|
+
wrapper = tree.wrapper;
|
|
463
|
+
|
|
464
|
+
// ED-16035 Make sure sticky header is only applied to first row
|
|
479
465
|
var tbody = this.dom.parentElement;
|
|
480
|
-
var
|
|
481
|
-
|
|
482
|
-
|
|
466
|
+
var isFirstHeader = tbody === null || tbody === void 0 || (_tbody$firstChild = tbody.firstChild) === null || _tbody$firstChild === void 0 ? void 0 : _tbody$firstChild.isEqualNode(this.dom);
|
|
467
|
+
if (!isFirstHeader) {
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
var currentTableTop = this.getCurrentTableTop(tree);
|
|
471
|
+
if (!scrollTop) {
|
|
472
|
+
scrollTop = getTop(this.editorScrollableElement);
|
|
473
|
+
}
|
|
474
|
+
var domTop = currentTableTop > 0 ? scrollTop : scrollTop + currentTableTop;
|
|
475
|
+
if (!this.isSticky) {
|
|
476
|
+
var _this$editorScrollabl;
|
|
477
|
+
syncStickyRowToTable(table);
|
|
478
|
+
this.dom.classList.add('sticky');
|
|
479
|
+
table.classList.add(ClassName.TABLE_STICKY);
|
|
480
|
+
this.isSticky = true;
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* The logic below is not desirable, but acts as a fail safe for scenarios where the sticky header
|
|
484
|
+
* detaches from the table. This typically happens during a fast scroll by the user which causes
|
|
485
|
+
* the intersection observer logic to not fire as expected.
|
|
486
|
+
*/
|
|
487
|
+
(_this$editorScrollabl = this.editorScrollableElement) === null || _this$editorScrollabl === void 0 || _this$editorScrollabl.addEventListener('scrollend', this.refireIntersectionObservers, {
|
|
488
|
+
passive: true,
|
|
489
|
+
once: true
|
|
490
|
+
});
|
|
491
|
+
var fastScrollThresholdMs = 500;
|
|
492
|
+
setTimeout(function () {
|
|
493
|
+
_this6.refireIntersectionObservers();
|
|
494
|
+
}, fastScrollThresholdMs);
|
|
495
|
+
}
|
|
496
|
+
this.dom.style.top = "".concat(domTop, "px");
|
|
497
|
+
updateTableMargin(table);
|
|
498
|
+
this.dom.scrollLeft = wrapper.scrollLeft;
|
|
499
|
+
this.emitOn(domTop, this.colControlsOffset);
|
|
483
500
|
}
|
|
484
501
|
}, {
|
|
485
|
-
key: "
|
|
486
|
-
value: function
|
|
487
|
-
|
|
488
|
-
if (this.
|
|
489
|
-
|
|
502
|
+
key: "makeRowHeaderNotSticky",
|
|
503
|
+
value: function makeRowHeaderNotSticky(table) {
|
|
504
|
+
var isEditorDestroyed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
505
|
+
if (!this.isSticky || !table || !this.dom) {
|
|
506
|
+
return;
|
|
490
507
|
}
|
|
491
|
-
this.
|
|
508
|
+
this.dom.style.removeProperty('width');
|
|
509
|
+
this.dom.classList.remove('sticky');
|
|
510
|
+
table.classList.remove(ClassName.TABLE_STICKY);
|
|
511
|
+
this.isSticky = false;
|
|
512
|
+
this.dom.style.top = '';
|
|
513
|
+
table.style.removeProperty('margin-top');
|
|
514
|
+
this.emitOff(isEditorDestroyed);
|
|
492
515
|
}
|
|
493
516
|
}, {
|
|
494
|
-
key: "
|
|
495
|
-
value: function
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
517
|
+
key: "getWrapperoffset",
|
|
518
|
+
value: function getWrapperoffset() {
|
|
519
|
+
var inverse = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
520
|
+
var focusValue = inverse ? !this.focused : this.focused;
|
|
521
|
+
return focusValue ? 0 : tableControlsSpacing;
|
|
522
|
+
}
|
|
523
|
+
}, {
|
|
524
|
+
key: "getWrapperRefTop",
|
|
525
|
+
value: function getWrapperRefTop(wrapper) {
|
|
526
|
+
return Math.round(getTop(wrapper)) + this.getWrapperoffset();
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
// TODO: rename!
|
|
530
|
+
}, {
|
|
531
|
+
key: "getScrolledTableTop",
|
|
532
|
+
value: function getScrolledTableTop(wrapper) {
|
|
533
|
+
return this.getWrapperRefTop(wrapper) - this.topPosEditorElement;
|
|
534
|
+
}
|
|
535
|
+
}, {
|
|
536
|
+
key: "getCurrentTableTop",
|
|
537
|
+
value: function getCurrentTableTop(tree) {
|
|
538
|
+
return this.getScrolledTableTop(tree.wrapper) + tree.table.clientHeight;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
/* emit external events */
|
|
542
|
+
}, {
|
|
543
|
+
key: "emitOn",
|
|
544
|
+
value: function emitOn(top, padding) {
|
|
545
|
+
if (top === this.top && padding === this.padding) {
|
|
546
|
+
return;
|
|
547
|
+
}
|
|
548
|
+
this.top = top;
|
|
549
|
+
this.padding = padding;
|
|
550
|
+
var pos = this.getPos();
|
|
551
|
+
if (Number.isFinite(pos)) {
|
|
552
|
+
updateStickyState({
|
|
553
|
+
pos: pos,
|
|
554
|
+
top: top,
|
|
555
|
+
sticky: true,
|
|
556
|
+
padding: padding
|
|
557
|
+
})(this.view.state, this.view.dispatch, this.view);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
}, {
|
|
561
|
+
key: "emitOff",
|
|
562
|
+
value: function emitOff(isEditorDestroyed) {
|
|
563
|
+
if (this.top === 0 && this.padding === 0) {
|
|
564
|
+
return;
|
|
565
|
+
}
|
|
566
|
+
this.top = 0;
|
|
567
|
+
this.padding = 0;
|
|
568
|
+
var pos = this.getPos();
|
|
569
|
+
if (!isEditorDestroyed && Number.isFinite(pos)) {
|
|
570
|
+
updateStickyState({
|
|
571
|
+
pos: pos,
|
|
572
|
+
sticky: false,
|
|
573
|
+
top: this.top,
|
|
574
|
+
padding: this.padding
|
|
575
|
+
})(this.view.state, this.view.dispatch, this.view);
|
|
515
576
|
}
|
|
516
|
-
return true;
|
|
517
577
|
}
|
|
518
578
|
}]);
|
|
519
|
-
return
|
|
520
|
-
}();
|
|
579
|
+
return TableRow;
|
|
580
|
+
}(TableNodeView);
|
|
581
|
+
export { TableRow as default };
|