@atlaskit/editor-plugin-table 5.3.29 → 5.3.30
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/plugins/table/nodeviews/ExternalDropTargets.js +75 -0
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +75 -4
- package/dist/cjs/plugins/table/nodeviews/TableRow.js +36 -112
- package/dist/cjs/plugins/table/nodeviews/TableStickyScrollbar.js +9 -9
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/plugin.js +0 -8
- package/dist/cjs/plugins/table/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +2 -1
- package/dist/cjs/plugins/table/ui/TableFloatingColumnControls/index.js +2 -4
- package/dist/cjs/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +62 -10
- package/dist/cjs/plugins/table/ui/TableFloatingControls/RowDropTarget/index.js +61 -0
- package/dist/cjs/plugins/table/ui/TableFloatingControls/index.js +21 -15
- package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
- package/dist/cjs/plugins/table/ui/consts.js +4 -2
- package/dist/es2019/plugins/table/nodeviews/ExternalDropTargets.js +64 -0
- package/dist/es2019/plugins/table/nodeviews/TableComponent.js +80 -5
- package/dist/es2019/plugins/table/nodeviews/TableRow.js +4 -78
- package/dist/es2019/plugins/table/nodeviews/TableStickyScrollbar.js +6 -6
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/plugin.js +0 -8
- package/dist/es2019/plugins/table/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +2 -1
- package/dist/es2019/plugins/table/ui/TableFloatingColumnControls/index.js +2 -4
- package/dist/es2019/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +58 -8
- package/dist/es2019/plugins/table/ui/TableFloatingControls/RowDropTarget/index.js +55 -0
- package/dist/es2019/plugins/table/ui/TableFloatingControls/index.js +17 -11
- package/dist/es2019/plugins/table/ui/common-styles.js +2 -2
- package/dist/es2019/plugins/table/ui/consts.js +3 -1
- package/dist/esm/plugins/table/nodeviews/ExternalDropTargets.js +65 -0
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +76 -5
- package/dist/esm/plugins/table/nodeviews/TableRow.js +36 -112
- package/dist/esm/plugins/table/nodeviews/TableStickyScrollbar.js +9 -9
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/plugin.js +0 -8
- package/dist/esm/plugins/table/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +2 -1
- package/dist/esm/plugins/table/ui/TableFloatingColumnControls/index.js +2 -4
- package/dist/esm/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +62 -11
- package/dist/esm/plugins/table/ui/TableFloatingControls/RowDropTarget/index.js +52 -0
- package/dist/esm/plugins/table/ui/TableFloatingControls/index.js +21 -15
- package/dist/esm/plugins/table/ui/common-styles.js +2 -2
- package/dist/esm/plugins/table/ui/consts.js +3 -1
- package/dist/types/plugins/table/nodeviews/ExternalDropTargets.d.ts +9 -0
- package/dist/types/plugins/table/nodeviews/TableComponent.d.ts +1 -0
- package/dist/types/plugins/table/nodeviews/TableRow.d.ts +0 -4
- package/dist/types/plugins/table/nodeviews/TableStickyScrollbar.d.ts +3 -3
- package/dist/types/plugins/table/ui/TableFloatingControls/RowControls/DragControls.d.ts +1 -1
- package/dist/types/plugins/table/ui/TableFloatingControls/RowDropTarget/index.d.ts +8 -0
- package/dist/types/plugins/table/ui/TableFloatingControls/index.d.ts +3 -1
- package/dist/types/plugins/table/ui/consts.d.ts +2 -0
- package/dist/types/plugins/table/utils/column-controls.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/nodeviews/ExternalDropTargets.d.ts +9 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/TableComponent.d.ts +1 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/TableRow.d.ts +0 -4
- package/dist/types-ts4.5/plugins/table/nodeviews/TableStickyScrollbar.d.ts +3 -3
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/RowControls/DragControls.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/RowDropTarget/index.d.ts +8 -0
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/table/ui/consts.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/utils/column-controls.d.ts +2 -2
- package/package.json +2 -2
- package/src/__tests__/unit/ui/RowDragControls.tsx +2 -0
- package/src/plugins/table/nodeviews/ExternalDropTargets.tsx +86 -0
- package/src/plugins/table/nodeviews/TableComponent.tsx +92 -7
- package/src/plugins/table/nodeviews/TableRow.ts +2 -65
- package/src/plugins/table/nodeviews/TableStickyScrollbar.ts +6 -6
- package/src/plugins/table/pm-plugins/drag-and-drop/plugin.ts +0 -7
- package/src/plugins/table/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.tsx +1 -0
- package/src/plugins/table/ui/TableFloatingColumnControls/index.tsx +2 -7
- package/src/plugins/table/ui/TableFloatingControls/RowControls/DragControls.tsx +80 -21
- package/src/plugins/table/ui/TableFloatingControls/RowDropTarget/index.tsx +62 -0
- package/src/plugins/table/ui/TableFloatingControls/index.tsx +29 -8
- package/src/plugins/table/ui/common-styles.ts +2 -1
- package/src/plugins/table/ui/consts.ts +3 -0
- package/src/plugins/table/utils/column-controls.ts +2 -2
- package/tsconfig.app.json +2 -2
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import React, { Fragment, useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
3
|
import { injectIntl } from 'react-intl-next';
|
|
3
4
|
import { CellSelection } from '@atlaskit/editor-tables';
|
|
4
5
|
import { getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
6
|
+
import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/adapter/element';
|
|
5
7
|
import { clearHoverSelection } from '../../../commands';
|
|
6
8
|
import { toggleDragMenu } from '../../../pm-plugins/drag-and-drop/commands';
|
|
9
|
+
import { getPluginState as getTablePluginState } from '../../../pm-plugins/plugin-factory';
|
|
7
10
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
8
11
|
import { getRowHeights, getRowsParams, getSelectedRowIndexes } from '../../../utils';
|
|
12
|
+
import { dropTargetExtendedWidth } from '../../consts';
|
|
9
13
|
import { DragHandle } from '../../DragHandle';
|
|
14
|
+
import RowDropTarget from '../RowDropTarget';
|
|
10
15
|
var getSelectedRows = function getSelectedRows(selection) {
|
|
11
16
|
if (selection instanceof CellSelection && selection.isRowSelection()) {
|
|
12
17
|
var rect = getSelectionRect(selection);
|
|
@@ -21,22 +26,51 @@ var DragControlsComponent = function DragControlsComponent(_ref) {
|
|
|
21
26
|
var _tableNode$attrs$loca, _tableNode$attrs;
|
|
22
27
|
var tableRef = _ref.tableRef,
|
|
23
28
|
tableNode = _ref.tableNode,
|
|
29
|
+
tableWidth = _ref.tableWidth,
|
|
24
30
|
hoveredCell = _ref.hoveredCell,
|
|
25
31
|
tableActive = _ref.tableActive,
|
|
26
32
|
editorView = _ref.editorView,
|
|
27
33
|
isInDanger = _ref.isInDanger,
|
|
28
34
|
isResizing = _ref.isResizing,
|
|
29
|
-
hasHeaderRow = _ref.hasHeaderRow,
|
|
30
35
|
hoverRows = _ref.hoverRows,
|
|
31
36
|
selectRow = _ref.selectRow,
|
|
32
37
|
updateCellHoverLocation = _ref.updateCellHoverLocation;
|
|
38
|
+
var _useState = useState(false),
|
|
39
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
40
|
+
isDragging = _useState2[0],
|
|
41
|
+
setIsDragging = _useState2[1];
|
|
33
42
|
var rowHeights = getRowHeights(tableRef);
|
|
34
43
|
var rowsParams = getRowsParams(rowHeights);
|
|
35
44
|
var heights = rowHeights.map(function (height) {
|
|
36
45
|
return "".concat(height - 1, "px");
|
|
37
46
|
}).join(' ');
|
|
38
47
|
var selectedRowIndexes = getSelectedRows(editorView.state.selection);
|
|
39
|
-
var
|
|
48
|
+
var currentNodeLocalId = (_tableNode$attrs$loca = tableNode === null || tableNode === void 0 || (_tableNode$attrs = tableNode.attrs) === null || _tableNode$attrs === void 0 ? void 0 : _tableNode$attrs.localId) !== null && _tableNode$attrs$loca !== void 0 ? _tableNode$attrs$loca : '';
|
|
49
|
+
useEffect(function () {
|
|
50
|
+
return monitorForElements({
|
|
51
|
+
canMonitor: function canMonitor(_ref2) {
|
|
52
|
+
var source = _ref2.source;
|
|
53
|
+
var _ref3 = source.data,
|
|
54
|
+
type = _ref3.type,
|
|
55
|
+
localId = _ref3.localId,
|
|
56
|
+
indexes = _ref3.indexes;
|
|
57
|
+
if (!indexes || !localId || type !== 'table-row') {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
var _getTablePluginState = getTablePluginState(editorView.state),
|
|
61
|
+
tableNode = _getTablePluginState.tableNode;
|
|
62
|
+
// If the draggable localId is the same as the current selected table localId then we will allow the monitor
|
|
63
|
+
// watch for changes
|
|
64
|
+
return localId === (tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.localId);
|
|
65
|
+
},
|
|
66
|
+
onDragStart: function onDragStart() {
|
|
67
|
+
setIsDragging(true);
|
|
68
|
+
},
|
|
69
|
+
onDrop: function onDrop() {
|
|
70
|
+
setIsDragging(false);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}, [editorView]);
|
|
40
74
|
var onMouseUp = useCallback(function () {
|
|
41
75
|
toggleDragMenu(undefined, 'row', hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.rowIndex)(editorView.state, editorView.dispatch);
|
|
42
76
|
}, [editorView, hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.rowIndex]);
|
|
@@ -74,15 +108,19 @@ var DragControlsComponent = function DragControlsComponent(_ref) {
|
|
|
74
108
|
return /*#__PURE__*/React.createElement("div", {
|
|
75
109
|
className: ClassName.DRAG_ROW_CONTROLS,
|
|
76
110
|
style: {
|
|
77
|
-
gridTemplateRows: heights
|
|
111
|
+
gridTemplateRows: heights,
|
|
112
|
+
gridTemplateColumns: isDragging ? "".concat(dropTargetExtendedWidth, "px 24px ").concat(tableWidth, "px") : "".concat(dropTargetExtendedWidth, "px 24px")
|
|
78
113
|
},
|
|
79
114
|
onMouseMove: handleMouseMove
|
|
80
|
-
}, !isResizing && rowsParams.map(function (
|
|
81
|
-
var startIndex =
|
|
82
|
-
endIndex =
|
|
83
|
-
return /*#__PURE__*/React.createElement(
|
|
115
|
+
}, !isResizing && rowsParams.map(function (_ref4, index) {
|
|
116
|
+
var startIndex = _ref4.startIndex,
|
|
117
|
+
endIndex = _ref4.endIndex;
|
|
118
|
+
return /*#__PURE__*/React.createElement(Fragment, {
|
|
119
|
+
key: index
|
|
120
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
84
121
|
style: {
|
|
85
|
-
gridRow: "".concat(index + 1, " / span 1")
|
|
122
|
+
gridRow: "".concat(index + 1, " / span 1"),
|
|
123
|
+
gridColumn: '2'
|
|
86
124
|
},
|
|
87
125
|
"data-start-index": startIndex,
|
|
88
126
|
"data-end-index": endIndex,
|
|
@@ -91,10 +129,23 @@ var DragControlsComponent = function DragControlsComponent(_ref) {
|
|
|
91
129
|
key: index
|
|
92
130
|
}, /*#__PURE__*/React.createElement("div", {
|
|
93
131
|
className: ClassName.DRAG_ROW_FLOATING_INSERT_DOT
|
|
132
|
+
})), isDragging && /*#__PURE__*/React.createElement(RowDropTarget, {
|
|
133
|
+
key: index,
|
|
134
|
+
index: index,
|
|
135
|
+
localId: currentNodeLocalId,
|
|
136
|
+
style: {
|
|
137
|
+
gridColumn: '1 / span 3',
|
|
138
|
+
gridRow: "".concat(index + 1, " / span 1"),
|
|
139
|
+
height: '100%',
|
|
140
|
+
pointerEvents: 'auto',
|
|
141
|
+
position: 'relative',
|
|
142
|
+
left: "var(--ds-space-negative-100, -8px)"
|
|
143
|
+
}
|
|
94
144
|
}));
|
|
95
145
|
}), !isResizing && Number.isFinite(rowIndex) && /*#__PURE__*/React.createElement("div", {
|
|
96
146
|
style: {
|
|
97
147
|
gridRow: gridRowPosition,
|
|
148
|
+
gridColumn: '2',
|
|
98
149
|
display: 'flex',
|
|
99
150
|
height: '100%',
|
|
100
151
|
alignItems: 'center',
|
|
@@ -102,9 +153,9 @@ var DragControlsComponent = function DragControlsComponent(_ref) {
|
|
|
102
153
|
},
|
|
103
154
|
"data-testid": "table-floating-row-drag-handle"
|
|
104
155
|
}, /*#__PURE__*/React.createElement(DragHandle, {
|
|
105
|
-
tableLocalId:
|
|
156
|
+
tableLocalId: currentNodeLocalId,
|
|
106
157
|
indexes: [rowIndex],
|
|
107
|
-
previewWidth:
|
|
158
|
+
previewWidth: tableWidth,
|
|
108
159
|
previewHeight: rowHeights[rowIndex],
|
|
109
160
|
appearance: selectedRowIndexes.includes(rowIndex) ? isInDanger ? 'danger' : 'selected' : 'default',
|
|
110
161
|
onClick: handleClick,
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/adapter/element';
|
|
3
|
+
import { attachClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge';
|
|
4
|
+
var RowDropTarget = function RowDropTarget(_ref) {
|
|
5
|
+
var index = _ref.index,
|
|
6
|
+
localId = _ref.localId,
|
|
7
|
+
style = _ref.style;
|
|
8
|
+
var dropTargetRef = useRef(null);
|
|
9
|
+
useEffect(function () {
|
|
10
|
+
if (!dropTargetRef.current) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
return dropTargetForElements({
|
|
14
|
+
element: dropTargetRef.current,
|
|
15
|
+
canDrop: function canDrop(_ref2) {
|
|
16
|
+
var _data$indexes, _data$indexes2;
|
|
17
|
+
var source = _ref2.source;
|
|
18
|
+
var data = source.data;
|
|
19
|
+
return (
|
|
20
|
+
// Only draggables of row type can be dropped on this target
|
|
21
|
+
data.type === 'table-row' &&
|
|
22
|
+
// Only draggables which came from the same table can be dropped on this target
|
|
23
|
+
data.localId === localId &&
|
|
24
|
+
// Only draggables which DO NOT include this drop targets index can be dropped
|
|
25
|
+
!!((_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(index)) === -1
|
|
26
|
+
);
|
|
27
|
+
},
|
|
28
|
+
getData: function getData(_ref3) {
|
|
29
|
+
var input = _ref3.input,
|
|
30
|
+
element = _ref3.element;
|
|
31
|
+
var data = {
|
|
32
|
+
localId: localId,
|
|
33
|
+
type: 'table-row',
|
|
34
|
+
targetIndex: index
|
|
35
|
+
};
|
|
36
|
+
return attachClosestEdge(data, {
|
|
37
|
+
input: input,
|
|
38
|
+
element: element,
|
|
39
|
+
allowedEdges: ['top', 'bottom']
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}, [index, localId]);
|
|
44
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
45
|
+
ref: dropTargetRef,
|
|
46
|
+
style: style,
|
|
47
|
+
"data-drop-target-index": index,
|
|
48
|
+
"data-drop-target-localid": localId,
|
|
49
|
+
"data-testid": "table-floating-row-controls-drop-target"
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
export default RowDropTarget;
|
|
@@ -14,6 +14,7 @@ import React, { Component } from 'react';
|
|
|
14
14
|
import { browser } from '@atlaskit/editor-common/utils';
|
|
15
15
|
import { hoverCell, hoverRows, selectRow } from '../../commands';
|
|
16
16
|
import { getPluginState } from '../../pm-plugins/plugin-factory';
|
|
17
|
+
import { TableCssClassName as ClassName } from '../../types';
|
|
17
18
|
import { isSelectionUpdated } from '../../utils';
|
|
18
19
|
import { CornerControls, DragCornerControls } from './CornerControls';
|
|
19
20
|
import NumberColumn from './NumberColumn';
|
|
@@ -21,13 +22,10 @@ import { DragControls, RowControls } from './RowControls';
|
|
|
21
22
|
var TableFloatingControls = /*#__PURE__*/function (_Component) {
|
|
22
23
|
_inherits(TableFloatingControls, _Component);
|
|
23
24
|
var _super = _createSuper(TableFloatingControls);
|
|
24
|
-
function TableFloatingControls() {
|
|
25
|
+
function TableFloatingControls(props) {
|
|
25
26
|
var _this;
|
|
26
27
|
_classCallCheck(this, TableFloatingControls);
|
|
27
|
-
|
|
28
|
-
args[_key] = arguments[_key];
|
|
29
|
-
}
|
|
30
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
28
|
+
_this = _super.call(this, props);
|
|
31
29
|
_defineProperty(_assertThisInitialized(_this), "selectRow", function (row, expand) {
|
|
32
30
|
var editorView = _this.props.editorView;
|
|
33
31
|
var state = editorView.state,
|
|
@@ -57,6 +55,11 @@ var TableFloatingControls = /*#__PURE__*/function (_Component) {
|
|
|
57
55
|
hoverCell(rowIndex, hoveredCell.colIndex)(state, dispatch);
|
|
58
56
|
}
|
|
59
57
|
});
|
|
58
|
+
_this.state = {
|
|
59
|
+
tableWrapperWidth: 0,
|
|
60
|
+
/** Height needs to be tracked to re-render decorations correctly, do not remove */
|
|
61
|
+
tableWrapperHeight: 0
|
|
62
|
+
};
|
|
60
63
|
return _this;
|
|
61
64
|
}
|
|
62
65
|
_createClass(TableFloatingControls, [{
|
|
@@ -79,16 +82,22 @@ var TableFloatingControls = /*#__PURE__*/function (_Component) {
|
|
|
79
82
|
_this2 = this;
|
|
80
83
|
var tableRef = this.props.tableRef;
|
|
81
84
|
if (tableRef && !this.resizeObserver && (_window = window) !== null && _window !== void 0 && _window.ResizeObserver) {
|
|
85
|
+
var tableWrapper = tableRef.closest(".".concat(ClassName.TABLE_NODE_WRAPPER));
|
|
82
86
|
this.resizeObserver = new ResizeObserver(function (entries) {
|
|
83
87
|
var _iterator = _createForOfIteratorHelper(entries),
|
|
84
88
|
_step;
|
|
85
89
|
try {
|
|
86
|
-
|
|
90
|
+
var _loop = function _loop() {
|
|
87
91
|
var entry = _step.value;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
92
|
+
_this2.setState(function (prev) {
|
|
93
|
+
return (prev === null || prev === void 0 ? void 0 : prev.tableWrapperWidth) === entry.contentRect.width && prev.tableWrapperHeight === entry.contentRect.height ? prev : {
|
|
94
|
+
tableWrapperWidth: entry.contentRect.width,
|
|
95
|
+
tableWrapperHeight: entry.contentRect.height
|
|
96
|
+
};
|
|
91
97
|
});
|
|
98
|
+
};
|
|
99
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
100
|
+
_loop();
|
|
92
101
|
}
|
|
93
102
|
} catch (err) {
|
|
94
103
|
_iterator.e(err);
|
|
@@ -96,13 +105,12 @@ var TableFloatingControls = /*#__PURE__*/function (_Component) {
|
|
|
96
105
|
_iterator.f();
|
|
97
106
|
}
|
|
98
107
|
});
|
|
99
|
-
this.resizeObserver.observe(
|
|
108
|
+
this.resizeObserver.observe(tableWrapper);
|
|
100
109
|
}
|
|
101
110
|
}
|
|
102
111
|
}, {
|
|
103
112
|
key: "shouldComponentUpdate",
|
|
104
113
|
value: function shouldComponentUpdate(nextProps, nextState) {
|
|
105
|
-
var _this$state;
|
|
106
114
|
var _this$props2 = this.props,
|
|
107
115
|
tableRef = _this$props2.tableRef,
|
|
108
116
|
isInDanger = _this$props2.isInDanger,
|
|
@@ -117,9 +125,7 @@ var TableFloatingControls = /*#__PURE__*/function (_Component) {
|
|
|
117
125
|
headerRowHeight = _this$props2.headerRowHeight,
|
|
118
126
|
stickyHeader = _this$props2.stickyHeader,
|
|
119
127
|
hoveredCell = _this$props2.hoveredCell;
|
|
120
|
-
|
|
121
|
-
var nextTableHeight = nextState === null || nextState === void 0 ? void 0 : nextState.tableHeight;
|
|
122
|
-
return ordering !== nextProps.ordering || tableRef !== nextProps.tableRef || tableHeight !== nextTableHeight || 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;
|
|
128
|
+
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;
|
|
123
129
|
}
|
|
124
130
|
}, {
|
|
125
131
|
key: "componentWillUnmount",
|
|
@@ -180,7 +186,7 @@ var TableFloatingControls = /*#__PURE__*/function (_Component) {
|
|
|
180
186
|
tableActive: tableActive,
|
|
181
187
|
isInDanger: isInDanger,
|
|
182
188
|
isResizing: isResizing,
|
|
183
|
-
|
|
189
|
+
tableWidth: this.state.tableWrapperWidth,
|
|
184
190
|
hoverRows: this.hoverRows,
|
|
185
191
|
selectRow: this.selectRow,
|
|
186
192
|
updateCellHoverLocation: this.updateCellHoverLocation
|
|
@@ -8,7 +8,7 @@ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
|
8
8
|
import { B300, N0, N20A, N300, N40A, R500 } from '@atlaskit/theme/colors';
|
|
9
9
|
import { fontSize } from '@atlaskit/theme/constants';
|
|
10
10
|
import { TableCssClassName as ClassName } from '../types';
|
|
11
|
-
import { columnControlsDecorationHeight, resizeHandlerAreaWidth, resizeLineWidth, rowControlsZIndex, stickyHeaderBorderBottomWidth, stickyRowOffsetTop, tableBorderColor, tableBorderDeleteColor, tableBorderRadiusSize, tableBorderSelectedColor, tableCellBackgroundColor, tableCellDeleteColor, tableCellSelectedColor, tableControlsSpacing, tableHeaderCellBackgroundColor, tableInsertColumnButtonSize, tableOverflowShadowWidth, tablePadding, tableScrollbarOffset, tableTextColor, tableToolbarDeleteColor, tableToolbarSelectedColor, tableToolbarSize } from './consts';
|
|
11
|
+
import { columnControlsDecorationHeight, dropTargetExtendedWidth, resizeHandlerAreaWidth, resizeLineWidth, rowControlsZIndex, stickyHeaderBorderBottomWidth, stickyRowOffsetTop, tableBorderColor, tableBorderDeleteColor, tableBorderRadiusSize, tableBorderSelectedColor, tableCellBackgroundColor, tableCellDeleteColor, tableCellSelectedColor, tableControlsSpacing, tableHeaderCellBackgroundColor, tableInsertColumnButtonSize, tableOverflowShadowWidth, tablePadding, tableScrollbarOffset, tableTextColor, tableToolbarDeleteColor, tableToolbarSelectedColor, tableToolbarSize } from './consts';
|
|
12
12
|
import { columnControlsDecoration, columnControlsLineMarker, DeleteButton, disabledCell, dragCornerControlButton, dragInsertButtonWrapper, floatingColumnControls, HeaderButton, HeaderButtonDanger, HeaderButtonHover, hoveredCell, hoveredDeleteButton, hoveredWarningCell, insertColumnButtonWrapper, insertLine, InsertMarker, insertRowButtonWrapper, OverflowShadow, resizeHandle, rowControlsWrapperDotStyle } from './ui-styles';
|
|
13
13
|
var cornerControlHeight = tableToolbarSize + 1;
|
|
14
14
|
|
|
@@ -61,7 +61,7 @@ var tableWrapperStyles = function tableWrapperStyles() {
|
|
|
61
61
|
// TODO: https://product-fabric.atlassian.net/browse/DSP-4139
|
|
62
62
|
export var tableStyles = function tableStyles(props) {
|
|
63
63
|
var _props$featureFlags;
|
|
64
|
-
return css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n .", " button {\n background: ", ";\n color: ", ";\n cursor: none;\n }\n\n .", ":not(.", ") button:hover {\n background: ", ";\n color: ", " !important;\n cursor: pointer;\n }\n\n .ProseMirror {\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n\n .", " {\n margin-bottom: 0;\n }\n\n .", " {\n td.", ", th.", " {\n position: relative;\n overflow: visible;\n }\n\n td.", " {\n background-color: ", ";\n\n // ED-15246: Trello card is visible through a border of a table border\n // This fixes a border issue caused by relative positioned table cells\n &::after {\n height: 100%;\n content: '';\n border-left: 1px solid ", ";\n border-bottom: 1px solid ", ";\n position: absolute;\n right: 0px;\n top: 0px;\n bottom: 0;\n width: 100%;\n display: inline-block;\n pointer-events: none;\n }\n }\n }\n\n .", " {\n ", "\n }\n\n .", " {\n ", "\n }\n\n ", "\n\n ", "\n\n /* Delete button */\n ", "\n /* Ends Delete button */\n\n /* sticky styles */\n .", " .", " .", ":first-of-type {\n margin-top: ", "px;\n width: ", "px;\n\n position: fixed !important;\n z-index: ", " !important;\n box-shadow: 0px -", "px ", ";\n border-right: 0 none;\n /* top set by NumberColumn component */\n }\n\n .", " .", ".sticky {\n position: fixed !important;\n /* needs to be above row controls */\n z-index: ", " !important;\n background: ", ";\n\n width: ", "px;\n height: ", "px;\n }\n\n .", ".sticky .", " {\n border-bottom: 0px none;\n border-right: 0px none;\n\n height: ", "px;\n width: ", "px;\n }\n\n ", "\n\n .", "\n .", "\n .", ".sticky {\n position: fixed !important;\n z-index: ", " !important;\n display: flex;\n border-left: ", "px solid\n ", ";\n margin-left: -", "px;\n }\n\n .", " col:first-of-type {\n /* moving rows out of a table layout does weird things in Chrome */\n border-right: 1px solid ", ";\n }\n\n tr.sticky {\n padding-top: ", "px;\n position: fixed;\n display: grid;\n\n /* to keep it above cell selection but below date and other nodes popups that are inside sticky header */\n z-index: ", ";\n\n overflow-y: visible;\n overflow-x: hidden;\n\n grid-auto-flow: column;\n\n /* background for where controls apply */\n background: ", ";\n box-sizing: content-box;\n\n margin-top: 2px;\n\n box-shadow: 0 6px 4px -4px ", ";\n margin-left: -1px;\n\n &.no-pointer-events {\n pointer-events: none;\n }\n }\n\n .", " .", " {\n left: unset;\n position: fixed;\n /* needs to be above sticky header row and below date and other nodes popups that are inside sticky header */\n z-index: ", ";\n }\n\n .", ".", "\n .", " {\n padding-bottom: ", "px;\n }\n\n tr.sticky th {\n border-bottom: ", "px solid\n ", ";\n margin-right: -1px;\n }\n\n .", " tr.sticky > th:last-child {\n border-right-width: 1px;\n }\n\n /* add left edge for first cell */\n .", " tr.sticky > th:first-of-type {\n margin-left: 0px;\n }\n\n /* add a little bit so the scroll lines up with the table */\n .", " tr.sticky::after {\n content: ' ';\n width: ", "px;\n }\n\n /* To fix jumpiness caused in Chrome Browsers for sticky headers */\n .", " .sticky + tr {\n min-height: 0px;\n }\n\n /* move resize line a little in sticky bar */\n .", ".", " {\n tr.sticky\n td.", ",\n tr.sticky\n th.", " {\n .", "::after {\n right: ", "px;\n }\n }\n\n /* when selected put it back to normal -- :not selector would be nicer */\n tr.sticky\n td.", ".", ",\n tr.sticky\n th.", ".", " {\n .", "::after {\n right: ", "px;\n }\n }\n }\n\n tr.sticky\n .", ",\n tr.sticky\n .", " {\n z-index: 1;\n }\n\n .", " tr.sticky {\n padding-top: ", "px;\n }\n\n .", ".", "\n .", "\n .", ":first-of-type {\n margin-top: ", "px;\n }\n\n .", ".sticky {\n border-top: ", "px solid\n ", ";\n }\n\n ", "\n ", "\n ", "\n\n .", " .", " {\n height: 0; // stop overflow flash & set correct height in update-overflow-shadows.ts\n }\n\n .less-padding {\n padding: 0 ", "px;\n\n .", " {\n padding: 0 ", "px;\n\n // https://product-fabric.atlassian.net/browse/ED-16386\n // Fixes issue where the extra padding that is added here throws off the position\n // of the rows control dot\n &::after {\n right: 6px !important;\n }\n }\n\n .", " {\n padding: 0 ", "px;\n }\n\n &.", "[data-number-column='true'] {\n padding-left: ", "px;\n }\n .", ", .", " {\n width: ", "px;\n }\n\n .", " {\n left: 6px;\n }\n\n .", " {\n left: calc(100% - 6px);\n }\n }\n\n > .", " {\n /**\n * Prevent margins collapsing, aids with placing the gap-cursor correctly\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing\n *\n * TODO: Enable this, many tests will fail!\n * border-top: 1px solid transparent;\n */\n }\n\n /* Breakout only works on top level unless wrapped in fragment mark */\n ", "\n\n ", ";\n ", ";\n\n /* Corner controls */\n .", " {\n width: ", "px;\n height: ", "px;\n display: none;\n\n .", " {\n position: relative;\n\n ", ";\n }\n }\n\n .", ".sticky {\n .", " {\n /* sticky row insert dot overlaps other row insert and messes things up */\n display: none !important;\n }\n }\n\n .", " {\n position: absolute;\n top: 0;\n width: ", "px;\n height: ", "px;\n border: 1px solid ", ";\n border-radius: 0;\n border-top-left-radius: ", "px;\n background: ", ";\n box-sizing: border-box;\n padding: 0;\n :focus {\n outline: none;\n }\n }\n .active .", " {\n border-color: ", ";\n background: ", ";\n }\n\n .", "[data-number-column='true'] {\n .", ", .", " {\n width: ", "px;\n }\n .", " .", " {\n border-right-width: 0;\n }\n }\n\n :not(.", ") .", ":hover {\n border-color: ", ";\n background: ", ";\n cursor: pointer;\n }\n\n :not(.", ")\n .", ".", " {\n border-color: ", ";\n background: ", ";\n }\n\n /* Row controls */\n .", " {\n width: ", "px;\n box-sizing: border-box;\n display: none;\n position: relative;\n\n ", ";\n\n .", " {\n display: flex;\n flex-direction: column;\n }\n .", ":last-child > button {\n border-bottom-left-radius: ", "px;\n }\n .", " {\n position: relative;\n margin-top: -1px;\n }\n .", ":hover,\n .", ".active,\n .", ":hover {\n z-index: ", ";\n }\n\n ", "\n }\n\n .", " {\n display: grid;\n align-items: center;\n position: absolute;\n left: -4px;\n z-index: ", ";\n\n .", " {\n align-self: end;\n position: absolute;\n height: 100%;\n width: 24px;\n }\n\n .", " {\n position: absolute;\n bottom: -3px;\n left: 6px;\n background-color: ", ";\n height: 4px;\n width: 4px;\n border-radius: 50%;\n }\n }\n\n .", " {\n .", " {\n height: 24px;\n position: absolute;\n top: ", ";\n z-index: ", ";\n }\n\n .", " {\n position: absolute;\n height: 24px;\n width: 100%;\n }\n\n .", " {\n background-color: ", ";\n height: 4px;\n width: 4px;\n border-radius: 50%;\n position: absolute;\n right: -2px;\n }\n }\n\n .", "\n .", " {\n bottom: -1px;\n }\n\n .", " {\n cursor: grab;\n padding: 0;\n\n border-radius: 6px;\n width: max-content;\n height: max-content;\n border: 2px solid ", ";\n display: flex;\n justify-content: center;\n align-items: center;\n outline: none !important;\n\n &:not(.", ") {\n & > svg {\n rect {\n fill: ", ";\n }\n g {\n fill: ", ";\n }\n }\n\n &:hover {\n svg {\n rect {\n fill: ", ";\n }\n g {\n fill: ", ";\n }\n }\n }\n\n &.selected {\n svg {\n rect {\n fill: ", ";\n }\n g {\n fill: ", ";\n }\n }\n }\n\n &.danger {\n svg {\n rect {\n fill: ", ";\n }\n g {\n fill: ", ";\n }\n }\n }\n }\n }\n\n ", "\n\n :not(.", ") .", " {\n ", "\n ", "\n }\n\n /* Numbered column */\n .", " {\n position: relative;\n float: right;\n margin-left: ", "px;\n top: ", "px;\n width: ", "px;\n box-sizing: border-box;\n }\n\n .", " {\n border: 1px solid ", ";\n box-sizing: border-box;\n margin-top: -1px;\n padding-bottom: 2px;\n padding: 10px 2px;\n text-align: center;\n font-size: ", ";\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n\n :first-child:not(style),\n style:first-child + * {\n margin-top: 0;\n }\n :last-child {\n border-bottom: 1px solid ", ";\n }\n }\n\n // add a background above the first numbered column cell when sticky header is engaged\n // which hides the table when scrolling\n .", ":first-of-type::after {\n content: '';\n display: block;\n height: 33px;\n width: 100%;\n background-color: ", ";\n position: absolute;\n\n // the extra pixel is accounting for borders\n top: -34px;\n left: -1px;\n }\n\n .", " {\n .", ", .", " {\n display: block;\n }\n .", " {\n padding-left: ", "px;\n\n .", " {\n border-left: 0 none;\n }\n\n .", ".active {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n }\n }\n :not(.", ") .", " {\n .", ":not(.", ") {\n cursor: pointer;\n }\n .", ":not(.", "):hover {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n .", ".", " {\n background-color: ", ";\n border: 1px solid ", ";\n border-left: 0;\n color: ", ";\n position: relative;\n z-index: ", ";\n }\n }\n\n /* Table */\n .", " > table {\n table-layout: fixed;\n white-space: normal;\n border-top: none;\n // 1px border width offset added here to prevent unwanted overflow and scolling - ED-16212\n margin-right: -1px;\n // Allows better positioning for the shadow sentinels - ED-16668\n position: relative;\n\n > tbody > tr {\n white-space: pre-wrap;\n }\n\n .", " + * {\n margin-top: 0;\n }\n\n /*\n * Headings have a top margin by default, but we don't want this on the\n * first heading within table header cells.\n *\n * This specifically sets margin-top for the first heading within a header\n * cell when center/right aligned.\n */\n th.", " > .fabric-editor-block-mark {\n > h1:first-of-type,\n > h2:first-of-type,\n > h3:first-of-type,\n > h4:first-of-type,\n > h5:first-of-type,\n > h6:first-of-type {\n margin-top: 0;\n }\n }\n\n .", ", .", " {\n position: relative;\n }\n /* Give selected cells a blue overlay */\n .", "::after,\n .", "::after {\n z-index: ", ";\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n width: 100%;\n pointer-events: none;\n }\n .", " {\n border: 1px solid ", ";\n }\n .", "::after {\n background: ", ";\n z-index: ", ";\n }\n th.", "::after,\n td.", "::after {\n background: ", ";\n z-index: ", ";\n }\n // ED-15246: Trello card is visible through a border of a table border\n /* ED-19064: To fix when enable header column in the table,\n and selection the header column, the right border is not tableBorderSelectedColor\n when deleting the header column, the right border is not tableToolbarDeleteColor */\n td.", ",\n td.", ",\n th.", ".", ",\n th.", ".", " {\n &::after {\n height: 100%;\n width: 100%;\n border: 1px solid ", ";\n content: '';\n position: absolute;\n left: -1px;\n top: -1px;\n bottom: 0;\n z-index: ", ";\n display: inline-block;\n pointer-events: none;\n }\n &.", "::after {\n ", ";\n z-index: ", ";\n }\n }\n }\n ", "\n .", ".", " {\n z-index: ", ";\n }\n\n .", " {\n position: absolute;\n top: ", "px;\n }\n\n ", "\n }\n\n .ProseMirror.", " {\n .", " {\n overflow-x: auto;\n ", ";\n }\n }\n\n .ProseMirror.", " {\n cursor: col-resize;\n }\n\n /*\n ED-15882: When custom start numbers is enabled for lists, we have\n styles that handle this generally (in editor-common) so we can\n throw away the older table-specific styles here.\n */\n ", "\n\n ", "\n"])), ClassName.LAYOUT_BUTTON, "var(--ds-background-neutral, ".concat(N20A, ")"), "var(--ds-icon, ".concat(N300, ")"), ClassName.LAYOUT_BUTTON, ClassName.IS_RESIZING, "var(--ds-background-neutral-hovered, ".concat(B300, ")"), "var(--ds-icon, white)", tableSharedStyle(props), columnControlsLineMarker(), hoveredDeleteButton(props), hoveredCell(props), disabledCell(props), hoveredWarningCell, getBooleanFF('platform.editor.table.drag-and-drop') && insertLine(props), resizeHandle(props), rangeSelectionStyles, ClassName.LAST_ITEM_IN_CELL, ClassName.TABLE_NODE_WRAPPER, ClassName.TABLE_CELL, ClassName.TABLE_HEADER_CELL, ClassName.TABLE_CELL, tableCellBackgroundColor(props), tableBorderColor(props), tableBorderColor(props), ClassName.CONTROLS_FLOATING_BUTTON_COLUMN, insertColumnButtonWrapper(props), ClassName.CONTROLS_FLOATING_BUTTON_ROW, insertRowButtonWrapper(props), dragInsertButtonWrapper(props), dragCornerControlButton(props), DeleteButton(props), ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, stickyRowOffsetTop + 2, akEditorTableNumberColumnWidth, akEditorStickyHeaderZIndex, stickyRowOffsetTop, "var(--ds-surface, white)", ClassName.TABLE_STICKY, ClassName.CORNER_CONTROLS, akEditorSmallZIndex, "var(--ds-surface, white)", tableToolbarSize, tableToolbarSize, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize, tableToolbarSize, tableStickyHeaderColumnControlsDecorationsStyle(props), ClassName.TABLE_STICKY, ClassName.ROW_CONTROLS, ClassName.ROW_CONTROLS_BUTTON_WRAP, akEditorStickyHeaderZIndex, tableToolbarSize, "var(--ds-surface, white)", tableToolbarSize, ClassName.TABLE_STICKY, "var(--ds-surface, green)", stickyRowOffsetTop, akEditorTableCellOnStickyHeaderZIndex - 5, "var(--ds-surface, white)", "var(--ds-shadow-overflow-perimeter, ".concat(N40A, ")"), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, akEditorTableCellOnStickyHeaderZIndex, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tableToolbarSize, stickyHeaderBorderBottomWidth, tableBorderColor(props), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, insertColumnButtonOffset + 1, ClassName.TABLE_STICKY, ClassName.TABLE_CONTAINER, ClassName.TABLE_STICKY, ClassName.WITH_RESIZE_LINE, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2 + 1, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, ClassName.WITH_CONTROLS, tableControlsSpacing, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, tableControlsSpacing + 2, ClassName.CORNER_CONTROLS, tableControlsSpacing - tableToolbarSize + 2, "var(--ds-surface, white)", sentinelStyles, OverflowShadow(props), stickyScrollbarStyles(), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tablePadding, ClassName.ROW_CONTROLS_WRAPPER, tablePadding, ClassName.DRAG_COLUMN_CONTROLS_WRAPPER, tablePadding, ClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth + tablePadding - 1, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, tableOverflowShadowWidth, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, ClassName.NODEVIEW_WRAPPER, breakoutWidthStyling(), columnControlsDecoration(props), rowControlsWrapperDotStyle(props), ClassName.CORNER_CONTROLS, tableToolbarSize + 1, cornerControlHeight, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, InsertMarker(props, "\n left: -11px;\n top: 9px;\n "), ClassName.CORNER_CONTROLS, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize + 1, tableToolbarSize + 1, tableBorderColor(props), tableBorderRadiusSize, tableHeaderCellBackgroundColor(props), ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor(props), tableToolbarSelectedColor(props), ClassName.TABLE_CONTAINER, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, getBooleanFF('platform.editor.custom-table-width') ? akEditorTableToolbarSize + akEditorTableNumberColumnWidth + 1 : akEditorTableToolbarSize + akEditorTableNumberColumnWidth, ClassName.ROW_CONTROLS, ClassName.CONTROLS_BUTTON, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor(props), tableToolbarSelectedColor(props), ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableBorderDeleteColor(props), tableToolbarDeleteColor(props), ClassName.ROW_CONTROLS, tableToolbarSize, InsertMarker(props, "\n bottom: -1px;\n left: -11px;\n "), ClassName.ROW_CONTROLS_INNER, ClassName.ROW_CONTROLS_BUTTON_WRAP, tableBorderRadiusSize, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.CONTROLS_BUTTON, akEditorUnitZIndex, HeaderButton(props, "\n border-bottom: 1px solid ".concat(tableBorderColor(props), ";\n border-right: 0px;\n border-radius: 0;\n height: 100%;\n width: ").concat(tableToolbarSize, "px;\n\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, " {\n position: absolute;\n width: 30px;\n height: 50%;\n right: 0;\n bottom: 0;\n }\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, ":first-of-type {\n top: 0;\n }\n ")), ClassName.DRAG_ROW_CONTROLS, akEditorUnitZIndex, ClassName.DRAG_ROW_FLOATING_INSERT_DOT_WRAPPER, ClassName.DRAG_ROW_FLOATING_INSERT_DOT, "var(--ds-background-accent-gray-subtler, #C1C7D0)", ClassName.DRAG_COLUMN_CONTROLS, ClassName.DRAG_COLUMN_CONTROLS_INNER, "var(--ds-space-negative-150, -12px)", akEditorUnitZIndex * 13, ClassName.DRAG_COLUMN_FLOATING_INSERT_DOT_WRAPPER, ClassName.DRAG_COLUMN_FLOATING_INSERT_DOT, "var(--ds-background-accent-gray-subtler, #C1C7D0)", ClassName.CONTROLS_FLOATING_BUTTON_ROW, ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER, ClassName.DRAG_HANDLE_BUTTON_CONTAINER, "var(--ds-surface, ".concat(N0, ")"), ClassName.DRAG_HANDLE_DISABLED, "var(--ds-background-accent-gray-subtlest, #F1F2F4)", "var(--ds-icon-subtle, #626F86)", "var(--ds-background-accent-blue-subtle, #579DFF)", "var(--ds-icon-inverse, #FFF)", "var(--ds-background-accent-blue-subtle, #579dff)", "var(--ds-icon-inverse, #fff)", "var(--ds-background-accent-red-subtler-pressed, #F87462)", "var(--ds-border-inverse, #FFF)", floatingColumnControls(props), ClassName.IS_RESIZING, ClassName.ROW_CONTROLS, HeaderButtonHover(props), HeaderButtonDanger(props), ClassName.NUMBERED_COLUMN, getBooleanFF('platform.editor.custom-table-width') ? akEditorTableToolbarSize : akEditorTableToolbarSize - 1, getBooleanFF('platform.editor.table.drag-and-drop') ? 0 : akEditorTableToolbarSize, akEditorTableNumberColumnWidth + 1, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderColor(props), relativeFontSizeToBase16(fontSize()), tableHeaderCellBackgroundColor(props), tableTextColor(props), tableBorderColor(props), tableBorderColor(props), ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, "var(--ds-surface, white)", ClassName.WITH_CONTROLS, ClassName.CORNER_CONTROLS, ClassName.ROW_CONTROLS, ClassName.NUMBERED_COLUMN, getBooleanFF('platform.editor.custom-table-width') ? 0 : 1, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor(props), tableBorderSelectedColor(props), tableToolbarSelectedColor(props), akEditorUnitZIndex, "var(--ds-text-selected, ".concat(N0, ")"), ClassName.IS_RESIZING, ClassName.WITH_CONTROLS, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, tableBorderSelectedColor(props), tableBorderSelectedColor(props), tableToolbarSelectedColor(props), akEditorUnitZIndex, "var(--ds-text-selected, ".concat(N0, ")"), ClassName.NUMBERED_COLUMN_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableToolbarDeleteColor(props), tableBorderDeleteColor(props), "var(--ds-text-danger, ".concat(R500, ")"), akEditorUnitZIndex, ClassName.TABLE_NODE_WRAPPER, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_HEADER_CELL, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, akEditorSmallZIndex, ClassName.SELECTED_CELL, tableBorderSelectedColor(props), ClassName.SELECTED_CELL, tableCellSelectedColor(props), akEditorSmallZIndex, ClassName.HOVERED_CELL_IN_DANGER, ClassName.HOVERED_CELL_IN_DANGER, tableCellDeleteColor(props), akEditorUnitZIndex * 100, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, ClassName.TABLE_HEADER_CELL, ClassName.SELECTED_CELL, ClassName.TABLE_HEADER_CELL, ClassName.HOVERED_CELL, tableBorderSelectedColor(props), akEditorSmallZIndex, ClassName.HOVERED_CELL_IN_DANGER, tableBorderStyles(props), akEditorUnitZIndex * 100, tableRowControlStyles(), ClassName.ROW_CONTROLS_WRAPPER, ClassName.TABLE_LEFT_SHADOW, akEditorUnitZIndex, ClassName.DRAG_COLUMN_CONTROLS_WRAPPER, tableMarginTop, tableWrapperStyles(), ClassName.IS_RESIZING, ClassName.TABLE_NODE_WRAPPER, scrollbarStyles, ClassName.RESIZE_CURSOR, props !== null && props !== void 0 && (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.restartNumberedLists ? "" : listLargeNumericMarkersOldStyles, shadowSentinelStyles);
|
|
64
|
+
return css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n .", " button {\n background: ", ";\n color: ", ";\n cursor: none;\n }\n\n .", ":not(.", ") button:hover {\n background: ", ";\n color: ", " !important;\n cursor: pointer;\n }\n\n .ProseMirror {\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n\n .", " {\n margin-bottom: 0;\n }\n\n .", " {\n td.", ", th.", " {\n position: relative;\n overflow: visible;\n }\n\n td.", " {\n background-color: ", ";\n\n // ED-15246: Trello card is visible through a border of a table border\n // This fixes a border issue caused by relative positioned table cells\n &::after {\n height: 100%;\n content: '';\n border-left: 1px solid ", ";\n border-bottom: 1px solid ", ";\n position: absolute;\n right: 0px;\n top: 0px;\n bottom: 0;\n width: 100%;\n display: inline-block;\n pointer-events: none;\n }\n }\n }\n\n .", " {\n ", "\n }\n\n .", " {\n ", "\n }\n\n ", "\n\n ", "\n\n /* Delete button */\n ", "\n /* Ends Delete button */\n\n /* sticky styles */\n .", " .", " .", ":first-of-type {\n margin-top: ", "px;\n width: ", "px;\n\n position: fixed !important;\n z-index: ", " !important;\n box-shadow: 0px -", "px ", ";\n border-right: 0 none;\n /* top set by NumberColumn component */\n }\n\n .", " .", ".sticky {\n position: fixed !important;\n /* needs to be above row controls */\n z-index: ", " !important;\n background: ", ";\n\n width: ", "px;\n height: ", "px;\n }\n\n .", ".sticky .", " {\n border-bottom: 0px none;\n border-right: 0px none;\n\n height: ", "px;\n width: ", "px;\n }\n\n ", "\n\n .", "\n .", "\n .", ".sticky {\n position: fixed !important;\n z-index: ", " !important;\n display: flex;\n border-left: ", "px solid\n ", ";\n margin-left: -", "px;\n }\n\n .", " col:first-of-type {\n /* moving rows out of a table layout does weird things in Chrome */\n border-right: 1px solid ", ";\n }\n\n tr.sticky {\n padding-top: ", "px;\n position: fixed;\n display: grid;\n\n /* to keep it above cell selection but below date and other nodes popups that are inside sticky header */\n z-index: ", ";\n\n overflow-y: visible;\n overflow-x: hidden;\n\n grid-auto-flow: column;\n\n /* background for where controls apply */\n background: ", ";\n box-sizing: content-box;\n\n margin-top: 2px;\n\n box-shadow: 0 6px 4px -4px ", ";\n margin-left: -1px;\n\n &.no-pointer-events {\n pointer-events: none;\n }\n }\n\n .", " .", " {\n left: unset;\n position: fixed;\n /* needs to be above sticky header row and below date and other nodes popups that are inside sticky header */\n z-index: ", ";\n }\n\n .", ".", "\n .", " {\n padding-bottom: ", "px;\n }\n\n tr.sticky th {\n border-bottom: ", "px solid\n ", ";\n margin-right: -1px;\n }\n\n .", " tr.sticky > th:last-child {\n border-right-width: 1px;\n }\n\n /* add left edge for first cell */\n .", " tr.sticky > th:first-of-type {\n margin-left: 0px;\n }\n\n /* add a little bit so the scroll lines up with the table */\n .", " tr.sticky::after {\n content: ' ';\n width: ", "px;\n }\n\n /* To fix jumpiness caused in Chrome Browsers for sticky headers */\n .", " .sticky + tr {\n min-height: 0px;\n }\n\n /* move resize line a little in sticky bar */\n .", ".", " {\n tr.sticky\n td.", ",\n tr.sticky\n th.", " {\n .", "::after {\n right: ", "px;\n }\n }\n\n /* when selected put it back to normal -- :not selector would be nicer */\n tr.sticky\n td.", ".", ",\n tr.sticky\n th.", ".", " {\n .", "::after {\n right: ", "px;\n }\n }\n }\n\n tr.sticky\n .", ",\n tr.sticky\n .", " {\n z-index: 1;\n }\n\n .", " tr.sticky {\n padding-top: ", "px;\n }\n\n .", ".", "\n .", "\n .", ":first-of-type {\n margin-top: ", "px;\n }\n\n .", ".sticky {\n border-top: ", "px solid\n ", ";\n }\n\n ", "\n ", "\n ", "\n\n .", " .", " {\n height: 0; // stop overflow flash & set correct height in update-overflow-shadows.ts\n }\n\n .less-padding {\n padding: 0 ", "px;\n\n .", " {\n padding: 0 ", "px;\n\n // https://product-fabric.atlassian.net/browse/ED-16386\n // Fixes issue where the extra padding that is added here throws off the position\n // of the rows control dot\n &::after {\n right: 6px !important;\n }\n }\n\n .", " {\n padding: 0 ", "px;\n }\n\n &.", "[data-number-column='true'] {\n padding-left: ", "px;\n }\n .", ", .", " {\n width: ", "px;\n }\n\n .", " {\n left: 6px;\n }\n\n .", " {\n left: calc(100% - 6px);\n }\n }\n\n > .", " {\n /**\n * Prevent margins collapsing, aids with placing the gap-cursor correctly\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing\n *\n * TODO: Enable this, many tests will fail!\n * border-top: 1px solid transparent;\n */\n }\n\n /* Breakout only works on top level unless wrapped in fragment mark */\n ", "\n\n ", ";\n ", ";\n\n /* Corner controls */\n .", " {\n width: ", "px;\n height: ", "px;\n display: none;\n\n .", " {\n position: relative;\n\n ", ";\n }\n }\n\n .", ".sticky {\n .", " {\n /* sticky row insert dot overlaps other row insert and messes things up */\n display: none !important;\n }\n }\n\n .", " {\n position: absolute;\n top: 0;\n width: ", "px;\n height: ", "px;\n border: 1px solid ", ";\n border-radius: 0;\n border-top-left-radius: ", "px;\n background: ", ";\n box-sizing: border-box;\n padding: 0;\n :focus {\n outline: none;\n }\n }\n .active .", " {\n border-color: ", ";\n background: ", ";\n }\n\n .", "[data-number-column='true'] {\n .", ", .", " {\n width: ", "px;\n }\n .", " .", " {\n border-right-width: 0;\n }\n }\n\n :not(.", ") .", ":hover {\n border-color: ", ";\n background: ", ";\n cursor: pointer;\n }\n\n :not(.", ")\n .", ".", " {\n border-color: ", ";\n background: ", ";\n }\n\n /* Row controls */\n .", " {\n width: ", "px;\n box-sizing: border-box;\n display: none;\n position: relative;\n\n ", ";\n\n .", " {\n display: flex;\n flex-direction: column;\n }\n .", ":last-child > button {\n border-bottom-left-radius: ", "px;\n }\n .", " {\n position: relative;\n margin-top: -1px;\n }\n .", ":hover,\n .", ".active,\n .", ":hover {\n z-index: ", ";\n }\n\n ", "\n }\n\n .", " {\n display: grid;\n align-items: center;\n position: absolute;\n left: -", "px;\n z-index: ", ";\n\n .", " {\n align-self: end;\n position: absolute;\n height: 100%;\n width: 24px;\n }\n\n .", " {\n position: absolute;\n bottom: -3px;\n left: 6px;\n background-color: ", ";\n height: 4px;\n width: 4px;\n border-radius: 50%;\n }\n }\n\n .", " {\n .", " {\n height: 24px;\n position: absolute;\n top: ", ";\n z-index: ", ";\n }\n\n .", " {\n position: absolute;\n height: 24px;\n width: 100%;\n }\n\n .", " {\n background-color: ", ";\n height: 4px;\n width: 4px;\n border-radius: 50%;\n position: absolute;\n right: -2px;\n }\n }\n\n .", "\n .", " {\n bottom: -1px;\n }\n\n .", " {\n cursor: grab;\n padding: 0;\n\n border-radius: 6px;\n width: max-content;\n height: max-content;\n border: 2px solid ", ";\n display: flex;\n justify-content: center;\n align-items: center;\n outline: none !important;\n\n &:not(.", ") {\n & > svg {\n rect {\n fill: ", ";\n }\n g {\n fill: ", ";\n }\n }\n\n &:hover {\n svg {\n rect {\n fill: ", ";\n }\n g {\n fill: ", ";\n }\n }\n }\n\n &.selected {\n svg {\n rect {\n fill: ", ";\n }\n g {\n fill: ", ";\n }\n }\n }\n\n &.danger {\n svg {\n rect {\n fill: ", ";\n }\n g {\n fill: ", ";\n }\n }\n }\n }\n }\n\n ", "\n\n :not(.", ") .", " {\n ", "\n ", "\n }\n\n /* Numbered column */\n .", " {\n position: relative;\n float: right;\n margin-left: ", "px;\n top: ", "px;\n width: ", "px;\n box-sizing: border-box;\n }\n\n .", " {\n border: 1px solid ", ";\n box-sizing: border-box;\n margin-top: -1px;\n padding-bottom: 2px;\n padding: 10px 2px;\n text-align: center;\n font-size: ", ";\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n\n :first-child:not(style),\n style:first-child + * {\n margin-top: 0;\n }\n :last-child {\n border-bottom: 1px solid ", ";\n }\n }\n\n // add a background above the first numbered column cell when sticky header is engaged\n // which hides the table when scrolling\n .", ":first-of-type::after {\n content: '';\n display: block;\n height: 33px;\n width: 100%;\n background-color: ", ";\n position: absolute;\n\n // the extra pixel is accounting for borders\n top: -34px;\n left: -1px;\n }\n\n .", " {\n .", ", .", " {\n display: block;\n }\n .", " {\n padding-left: ", "px;\n\n .", " {\n border-left: 0 none;\n }\n\n .", ".active {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n }\n }\n :not(.", ") .", " {\n .", ":not(.", ") {\n cursor: pointer;\n }\n .", ":not(.", "):hover {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n .", ".", " {\n background-color: ", ";\n border: 1px solid ", ";\n border-left: 0;\n color: ", ";\n position: relative;\n z-index: ", ";\n }\n }\n\n /* Table */\n .", " > table {\n table-layout: fixed;\n white-space: normal;\n border-top: none;\n // 1px border width offset added here to prevent unwanted overflow and scolling - ED-16212\n margin-right: -1px;\n // Allows better positioning for the shadow sentinels - ED-16668\n position: relative;\n\n > tbody > tr {\n white-space: pre-wrap;\n }\n\n .", " + * {\n margin-top: 0;\n }\n\n /*\n * Headings have a top margin by default, but we don't want this on the\n * first heading within table header cells.\n *\n * This specifically sets margin-top for the first heading within a header\n * cell when center/right aligned.\n */\n th.", " > .fabric-editor-block-mark {\n > h1:first-of-type,\n > h2:first-of-type,\n > h3:first-of-type,\n > h4:first-of-type,\n > h5:first-of-type,\n > h6:first-of-type {\n margin-top: 0;\n }\n }\n\n .", ", .", " {\n position: relative;\n }\n /* Give selected cells a blue overlay */\n .", "::after,\n .", "::after {\n z-index: ", ";\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n width: 100%;\n pointer-events: none;\n }\n .", " {\n border: 1px solid ", ";\n }\n .", "::after {\n background: ", ";\n z-index: ", ";\n }\n th.", "::after,\n td.", "::after {\n background: ", ";\n z-index: ", ";\n }\n // ED-15246: Trello card is visible through a border of a table border\n /* ED-19064: To fix when enable header column in the table,\n and selection the header column, the right border is not tableBorderSelectedColor\n when deleting the header column, the right border is not tableToolbarDeleteColor */\n td.", ",\n td.", ",\n th.", ".", ",\n th.", ".", " {\n &::after {\n height: 100%;\n width: 100%;\n border: 1px solid ", ";\n content: '';\n position: absolute;\n left: -1px;\n top: -1px;\n bottom: 0;\n z-index: ", ";\n display: inline-block;\n pointer-events: none;\n }\n &.", "::after {\n ", ";\n z-index: ", ";\n }\n }\n }\n ", "\n .", ".", " {\n z-index: ", ";\n }\n\n .", " {\n position: absolute;\n top: ", "px;\n }\n\n ", "\n }\n\n .ProseMirror.", " {\n .", " {\n overflow-x: auto;\n ", ";\n }\n }\n\n .ProseMirror.", " {\n cursor: col-resize;\n }\n\n /*\n ED-15882: When custom start numbers is enabled for lists, we have\n styles that handle this generally (in editor-common) so we can\n throw away the older table-specific styles here.\n */\n ", "\n\n ", "\n"])), ClassName.LAYOUT_BUTTON, "var(--ds-background-neutral, ".concat(N20A, ")"), "var(--ds-icon, ".concat(N300, ")"), ClassName.LAYOUT_BUTTON, ClassName.IS_RESIZING, "var(--ds-background-neutral-hovered, ".concat(B300, ")"), "var(--ds-icon, white)", tableSharedStyle(props), columnControlsLineMarker(), hoveredDeleteButton(props), hoveredCell(props), disabledCell(props), hoveredWarningCell, getBooleanFF('platform.editor.table.drag-and-drop') && insertLine(props), resizeHandle(props), rangeSelectionStyles, ClassName.LAST_ITEM_IN_CELL, ClassName.TABLE_NODE_WRAPPER, ClassName.TABLE_CELL, ClassName.TABLE_HEADER_CELL, ClassName.TABLE_CELL, tableCellBackgroundColor(props), tableBorderColor(props), tableBorderColor(props), ClassName.CONTROLS_FLOATING_BUTTON_COLUMN, insertColumnButtonWrapper(props), ClassName.CONTROLS_FLOATING_BUTTON_ROW, insertRowButtonWrapper(props), dragInsertButtonWrapper(props), dragCornerControlButton(props), DeleteButton(props), ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, stickyRowOffsetTop + 2, akEditorTableNumberColumnWidth, akEditorStickyHeaderZIndex, stickyRowOffsetTop, "var(--ds-surface, white)", ClassName.TABLE_STICKY, ClassName.CORNER_CONTROLS, akEditorSmallZIndex, "var(--ds-surface, white)", tableToolbarSize, tableToolbarSize, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize, tableToolbarSize, tableStickyHeaderColumnControlsDecorationsStyle(props), ClassName.TABLE_STICKY, ClassName.ROW_CONTROLS, ClassName.ROW_CONTROLS_BUTTON_WRAP, akEditorStickyHeaderZIndex, tableToolbarSize, "var(--ds-surface, white)", tableToolbarSize, ClassName.TABLE_STICKY, "var(--ds-surface, green)", stickyRowOffsetTop, akEditorTableCellOnStickyHeaderZIndex - 5, "var(--ds-surface, white)", "var(--ds-shadow-overflow-perimeter, ".concat(N40A, ")"), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, akEditorTableCellOnStickyHeaderZIndex, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tableToolbarSize, stickyHeaderBorderBottomWidth, tableBorderColor(props), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, insertColumnButtonOffset + 1, ClassName.TABLE_STICKY, ClassName.TABLE_CONTAINER, ClassName.TABLE_STICKY, ClassName.WITH_RESIZE_LINE, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2 + 1, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, ClassName.WITH_CONTROLS, tableControlsSpacing, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, tableControlsSpacing + 2, ClassName.CORNER_CONTROLS, tableControlsSpacing - tableToolbarSize + 2, "var(--ds-surface, white)", sentinelStyles, OverflowShadow(props), stickyScrollbarStyles(), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tablePadding, ClassName.ROW_CONTROLS_WRAPPER, tablePadding, ClassName.DRAG_COLUMN_CONTROLS_WRAPPER, tablePadding, ClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth + tablePadding - 1, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, tableOverflowShadowWidth, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, ClassName.NODEVIEW_WRAPPER, breakoutWidthStyling(), columnControlsDecoration(props), rowControlsWrapperDotStyle(props), ClassName.CORNER_CONTROLS, tableToolbarSize + 1, cornerControlHeight, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, InsertMarker(props, "\n left: -11px;\n top: 9px;\n "), ClassName.CORNER_CONTROLS, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize + 1, tableToolbarSize + 1, tableBorderColor(props), tableBorderRadiusSize, tableHeaderCellBackgroundColor(props), ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor(props), tableToolbarSelectedColor(props), ClassName.TABLE_CONTAINER, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, getBooleanFF('platform.editor.custom-table-width') ? akEditorTableToolbarSize + akEditorTableNumberColumnWidth + 1 : akEditorTableToolbarSize + akEditorTableNumberColumnWidth, ClassName.ROW_CONTROLS, ClassName.CONTROLS_BUTTON, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor(props), tableToolbarSelectedColor(props), ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableBorderDeleteColor(props), tableToolbarDeleteColor(props), ClassName.ROW_CONTROLS, tableToolbarSize, InsertMarker(props, "\n bottom: -1px;\n left: -11px;\n "), ClassName.ROW_CONTROLS_INNER, ClassName.ROW_CONTROLS_BUTTON_WRAP, tableBorderRadiusSize, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.CONTROLS_BUTTON, akEditorUnitZIndex, HeaderButton(props, "\n border-bottom: 1px solid ".concat(tableBorderColor(props), ";\n border-right: 0px;\n border-radius: 0;\n height: 100%;\n width: ").concat(tableToolbarSize, "px;\n\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, " {\n position: absolute;\n width: 30px;\n height: 50%;\n right: 0;\n bottom: 0;\n }\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, ":first-of-type {\n top: 0;\n }\n ")), ClassName.DRAG_ROW_CONTROLS, dropTargetExtendedWidth + 4, akEditorUnitZIndex, ClassName.DRAG_ROW_FLOATING_INSERT_DOT_WRAPPER, ClassName.DRAG_ROW_FLOATING_INSERT_DOT, "var(--ds-background-accent-gray-subtler, #C1C7D0)", ClassName.DRAG_COLUMN_CONTROLS, ClassName.DRAG_COLUMN_CONTROLS_INNER, "var(--ds-space-negative-150, -12px)", akEditorUnitZIndex * 13, ClassName.DRAG_COLUMN_FLOATING_INSERT_DOT_WRAPPER, ClassName.DRAG_COLUMN_FLOATING_INSERT_DOT, "var(--ds-background-accent-gray-subtler, #C1C7D0)", ClassName.CONTROLS_FLOATING_BUTTON_ROW, ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER, ClassName.DRAG_HANDLE_BUTTON_CONTAINER, "var(--ds-surface, ".concat(N0, ")"), ClassName.DRAG_HANDLE_DISABLED, "var(--ds-background-accent-gray-subtlest, #F1F2F4)", "var(--ds-icon-subtle, #626F86)", "var(--ds-background-accent-blue-subtle, #579DFF)", "var(--ds-icon-inverse, #FFF)", "var(--ds-background-accent-blue-subtle, #579dff)", "var(--ds-icon-inverse, #fff)", "var(--ds-background-accent-red-subtler-pressed, #F87462)", "var(--ds-border-inverse, #FFF)", floatingColumnControls(props), ClassName.IS_RESIZING, ClassName.ROW_CONTROLS, HeaderButtonHover(props), HeaderButtonDanger(props), ClassName.NUMBERED_COLUMN, getBooleanFF('platform.editor.custom-table-width') ? akEditorTableToolbarSize : akEditorTableToolbarSize - 1, getBooleanFF('platform.editor.table.drag-and-drop') ? 0 : akEditorTableToolbarSize, akEditorTableNumberColumnWidth + 1, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderColor(props), relativeFontSizeToBase16(fontSize()), tableHeaderCellBackgroundColor(props), tableTextColor(props), tableBorderColor(props), tableBorderColor(props), ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, "var(--ds-surface, white)", ClassName.WITH_CONTROLS, ClassName.CORNER_CONTROLS, ClassName.ROW_CONTROLS, ClassName.NUMBERED_COLUMN, getBooleanFF('platform.editor.custom-table-width') ? 0 : 1, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor(props), tableBorderSelectedColor(props), tableToolbarSelectedColor(props), akEditorUnitZIndex, "var(--ds-text-selected, ".concat(N0, ")"), ClassName.IS_RESIZING, ClassName.WITH_CONTROLS, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, tableBorderSelectedColor(props), tableBorderSelectedColor(props), tableToolbarSelectedColor(props), akEditorUnitZIndex, "var(--ds-text-selected, ".concat(N0, ")"), ClassName.NUMBERED_COLUMN_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableToolbarDeleteColor(props), tableBorderDeleteColor(props), "var(--ds-text-danger, ".concat(R500, ")"), akEditorUnitZIndex, ClassName.TABLE_NODE_WRAPPER, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_HEADER_CELL, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, akEditorSmallZIndex, ClassName.SELECTED_CELL, tableBorderSelectedColor(props), ClassName.SELECTED_CELL, tableCellSelectedColor(props), akEditorSmallZIndex, ClassName.HOVERED_CELL_IN_DANGER, ClassName.HOVERED_CELL_IN_DANGER, tableCellDeleteColor(props), akEditorUnitZIndex * 100, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, ClassName.TABLE_HEADER_CELL, ClassName.SELECTED_CELL, ClassName.TABLE_HEADER_CELL, ClassName.HOVERED_CELL, tableBorderSelectedColor(props), akEditorSmallZIndex, ClassName.HOVERED_CELL_IN_DANGER, tableBorderStyles(props), akEditorUnitZIndex * 100, tableRowControlStyles(), ClassName.ROW_CONTROLS_WRAPPER, ClassName.TABLE_LEFT_SHADOW, akEditorUnitZIndex, ClassName.DRAG_COLUMN_CONTROLS_WRAPPER, tableMarginTop, tableWrapperStyles(), ClassName.IS_RESIZING, ClassName.TABLE_NODE_WRAPPER, scrollbarStyles, ClassName.RESIZE_CURSOR, props !== null && props !== void 0 && (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.restartNumberedLists ? "" : listLargeNumericMarkersOldStyles, shadowSentinelStyles);
|
|
65
65
|
};
|
|
66
66
|
export var tableFullPageEditorStyles = css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n .ProseMirror .", " > table {\n margin-left: 0;\n // 1px border width offset added here to prevent unwanted overflow and scolling - ED-16212\n margin-right: -1px;\n width: 100%;\n }\n"])), ClassName.TABLE_NODE_WRAPPER);
|
|
67
67
|
export var tableCommentEditorStyles = css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n .ProseMirror .", " > table {\n margin-left: 0;\n margin-right: 0;\n ", ";\n }\n"])), ClassName.TABLE_NODE_WRAPPER, scrollbarStyles);
|
|
@@ -102,8 +102,10 @@ export var stickyRowOffsetTop = 8;
|
|
|
102
102
|
export var stickyHeaderBorderBottomWidth = 1;
|
|
103
103
|
export var tableOverflowShadowWidth = 8;
|
|
104
104
|
export var tableOverflowShadowWidthWide = 32;
|
|
105
|
+
export var dropTargetsZIndex = 14;
|
|
105
106
|
export var TABLE_SNAP_GAP = 9;
|
|
106
107
|
export var TABLE_HIGHLIGHT_GAP = 10;
|
|
107
108
|
export var TABLE_HIGHLIGHT_TOLERANCE = 2;
|
|
108
109
|
export var STICKY_HEADER_TOGGLE_TOLERANCE_MS = 5;
|
|
109
|
-
export var dragMenuDropdownWidth = 240;
|
|
110
|
+
export var dragMenuDropdownWidth = 240;
|
|
111
|
+
export var dropTargetExtendedWidth = 150;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
export declare const ExternalDropTargets: ({ editorView, node, getScrollOffset, getTableWrapperWidth, }: {
|
|
5
|
+
editorView: EditorView;
|
|
6
|
+
node?: PMNode | undefined;
|
|
7
|
+
getScrollOffset: () => number;
|
|
8
|
+
getTableWrapperWidth: () => number;
|
|
9
|
+
}) => JSX.Element | null;
|
|
@@ -47,6 +47,7 @@ declare class TableComponent extends React.Component<ComponentProps, TableState>
|
|
|
47
47
|
private stickyScrollbar?;
|
|
48
48
|
private isInitialOverflowSent;
|
|
49
49
|
private initialOverflowCaptureTimerId?;
|
|
50
|
+
private dragAndDropCleanupFn?;
|
|
50
51
|
constructor(props: ComponentProps);
|
|
51
52
|
componentDidMount(): void;
|
|
52
53
|
componentWillUnmount(): void;
|
|
@@ -9,7 +9,6 @@ export default class TableRow extends TableNodeView<HTMLTableRowElement> impleme
|
|
|
9
9
|
*/
|
|
10
10
|
private isHeaderRow;
|
|
11
11
|
private isStickyHeaderEnabled;
|
|
12
|
-
private isDragAndDropEnabled;
|
|
13
12
|
private editorScrollableElement?;
|
|
14
13
|
private colControlsOffset;
|
|
15
14
|
private focused;
|
|
@@ -23,7 +22,6 @@ export default class TableRow extends TableNodeView<HTMLTableRowElement> impleme
|
|
|
23
22
|
private listening;
|
|
24
23
|
private padding;
|
|
25
24
|
private top;
|
|
26
|
-
private dropTargetCleanup?;
|
|
27
25
|
/**
|
|
28
26
|
* Methods: Nodeview Lifecycle
|
|
29
27
|
*/
|
|
@@ -36,8 +34,6 @@ export default class TableRow extends TableNodeView<HTMLTableRowElement> impleme
|
|
|
36
34
|
/**
|
|
37
35
|
* Methods
|
|
38
36
|
*/
|
|
39
|
-
private addDropTarget;
|
|
40
|
-
private getCurrentData;
|
|
41
37
|
private headerRowMouseScrollEnd;
|
|
42
38
|
private headerRowMouseScroll;
|
|
43
39
|
private subscribe;
|
|
@@ -13,9 +13,9 @@ export declare class TableStickyScrollbar {
|
|
|
13
13
|
scrollLeft(left: number): void;
|
|
14
14
|
private init;
|
|
15
15
|
private createIntersectionObserver;
|
|
16
|
-
private
|
|
17
|
-
private
|
|
18
|
-
private
|
|
16
|
+
private deleteIntersectionObserver;
|
|
17
|
+
private sentinelBottomCallback;
|
|
18
|
+
private sentinelTopCallback;
|
|
19
19
|
private toggle;
|
|
20
20
|
private hide;
|
|
21
21
|
private show;
|
|
@@ -7,11 +7,11 @@ type DragControlsProps = {
|
|
|
7
7
|
editorView: EditorView;
|
|
8
8
|
tableRef: HTMLTableElement;
|
|
9
9
|
tableNode?: PmNode;
|
|
10
|
+
tableWidth: number;
|
|
10
11
|
tableActive?: boolean;
|
|
11
12
|
hoveredCell?: CellHoverMeta;
|
|
12
13
|
isInDanger?: boolean;
|
|
13
14
|
isResizing?: boolean;
|
|
14
|
-
hasHeaderRow?: boolean;
|
|
15
15
|
hoverRows: (rows: number[], danger?: boolean) => void;
|
|
16
16
|
selectRow: (row: number, expand: boolean) => void;
|
|
17
17
|
updateCellHoverLocation: (rowIndex: number) => void;
|
|
@@ -26,11 +26,13 @@ export interface Props {
|
|
|
26
26
|
insertRowButtonIndex?: number;
|
|
27
27
|
}
|
|
28
28
|
interface State {
|
|
29
|
-
|
|
29
|
+
tableWrapperWidth: number;
|
|
30
|
+
tableWrapperHeight: number;
|
|
30
31
|
}
|
|
31
32
|
export default class TableFloatingControls extends Component<Props, State> {
|
|
32
33
|
static displayName: string;
|
|
33
34
|
private resizeObserver?;
|
|
35
|
+
constructor(props: Props);
|
|
34
36
|
componentDidMount(): void;
|
|
35
37
|
componentDidUpdate(): void;
|
|
36
38
|
private tryInitResizeObserver;
|
|
@@ -47,8 +47,10 @@ export declare const stickyRowOffsetTop = 8;
|
|
|
47
47
|
export declare const stickyHeaderBorderBottomWidth = 1;
|
|
48
48
|
export declare const tableOverflowShadowWidth = 8;
|
|
49
49
|
export declare const tableOverflowShadowWidthWide = 32;
|
|
50
|
+
export declare const dropTargetsZIndex = 14;
|
|
50
51
|
export declare const TABLE_SNAP_GAP = 9;
|
|
51
52
|
export declare const TABLE_HIGHLIGHT_GAP = 10;
|
|
52
53
|
export declare const TABLE_HIGHLIGHT_TOLERANCE = 2;
|
|
53
54
|
export declare const STICKY_HEADER_TOGGLE_TOLERANCE_MS = 5;
|
|
54
55
|
export declare const dragMenuDropdownWidth = 240;
|
|
56
|
+
export declare const dropTargetExtendedWidth = 150;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
1
|
+
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
export declare const getColumnsWidths: (view: EditorView) => Array<number | undefined>;
|
|
4
4
|
export declare const isColumnDeleteButtonVisible: (selection: Selection) => boolean;
|
|
5
5
|
export declare const getColumnDeleteButtonParams: (columnsWidths: Array<number | undefined>, selection: Selection) => {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
export declare const ExternalDropTargets: ({ editorView, node, getScrollOffset, getTableWrapperWidth, }: {
|
|
5
|
+
editorView: EditorView;
|
|
6
|
+
node?: PMNode | undefined;
|
|
7
|
+
getScrollOffset: () => number;
|
|
8
|
+
getTableWrapperWidth: () => number;
|
|
9
|
+
}) => JSX.Element | null;
|
|
@@ -47,6 +47,7 @@ declare class TableComponent extends React.Component<ComponentProps, TableState>
|
|
|
47
47
|
private stickyScrollbar?;
|
|
48
48
|
private isInitialOverflowSent;
|
|
49
49
|
private initialOverflowCaptureTimerId?;
|
|
50
|
+
private dragAndDropCleanupFn?;
|
|
50
51
|
constructor(props: ComponentProps);
|
|
51
52
|
componentDidMount(): void;
|
|
52
53
|
componentWillUnmount(): void;
|
|
@@ -9,7 +9,6 @@ export default class TableRow extends TableNodeView<HTMLTableRowElement> impleme
|
|
|
9
9
|
*/
|
|
10
10
|
private isHeaderRow;
|
|
11
11
|
private isStickyHeaderEnabled;
|
|
12
|
-
private isDragAndDropEnabled;
|
|
13
12
|
private editorScrollableElement?;
|
|
14
13
|
private colControlsOffset;
|
|
15
14
|
private focused;
|
|
@@ -23,7 +22,6 @@ export default class TableRow extends TableNodeView<HTMLTableRowElement> impleme
|
|
|
23
22
|
private listening;
|
|
24
23
|
private padding;
|
|
25
24
|
private top;
|
|
26
|
-
private dropTargetCleanup?;
|
|
27
25
|
/**
|
|
28
26
|
* Methods: Nodeview Lifecycle
|
|
29
27
|
*/
|
|
@@ -36,8 +34,6 @@ export default class TableRow extends TableNodeView<HTMLTableRowElement> impleme
|
|
|
36
34
|
/**
|
|
37
35
|
* Methods
|
|
38
36
|
*/
|
|
39
|
-
private addDropTarget;
|
|
40
|
-
private getCurrentData;
|
|
41
37
|
private headerRowMouseScrollEnd;
|
|
42
38
|
private headerRowMouseScroll;
|
|
43
39
|
private subscribe;
|
|
@@ -13,9 +13,9 @@ export declare class TableStickyScrollbar {
|
|
|
13
13
|
scrollLeft(left: number): void;
|
|
14
14
|
private init;
|
|
15
15
|
private createIntersectionObserver;
|
|
16
|
-
private
|
|
17
|
-
private
|
|
18
|
-
private
|
|
16
|
+
private deleteIntersectionObserver;
|
|
17
|
+
private sentinelBottomCallback;
|
|
18
|
+
private sentinelTopCallback;
|
|
19
19
|
private toggle;
|
|
20
20
|
private hide;
|
|
21
21
|
private show;
|