@atlaskit/editor-plugin-table 2.9.1 → 2.10.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 +17 -0
- package/dist/cjs/plugins/table/event-handlers.js +52 -56
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +19 -69
- package/dist/cjs/plugins/table/nodeviews/TableResizer.js +5 -1
- package/dist/cjs/plugins/table/nodeviews/table.js +23 -30
- package/dist/cjs/plugins/table/nodeviews/tableCell.js +3 -6
- package/dist/cjs/plugins/table/nodeviews/update-overflow-shadows.js +2 -40
- package/dist/cjs/plugins/table/pm-plugins/main.js +3 -3
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +2 -73
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/plugin.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/event-handlers.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/dom.js +1 -5
- package/dist/cjs/plugins/table/ui/TableFloatingControls/index.js +3 -7
- package/dist/cjs/plugins/table/ui/common-styles.js +2 -2
- package/dist/cjs/plugins/table/utils/dom.js +5 -12
- package/dist/es2019/plugins/table/event-handlers.js +3 -6
- package/dist/es2019/plugins/table/nodeviews/TableComponent.js +18 -69
- package/dist/es2019/plugins/table/nodeviews/TableResizer.js +6 -1
- package/dist/es2019/plugins/table/nodeviews/table.js +24 -32
- package/dist/es2019/plugins/table/nodeviews/tableCell.js +3 -7
- package/dist/es2019/plugins/table/nodeviews/update-overflow-shadows.js +0 -35
- package/dist/es2019/plugins/table/pm-plugins/main.js +3 -4
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +2 -77
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/plugin.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/event-handlers.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/dom.js +1 -5
- package/dist/es2019/plugins/table/ui/TableFloatingControls/index.js +3 -9
- package/dist/es2019/plugins/table/ui/common-styles.js +3 -3
- package/dist/es2019/plugins/table/utils/dom.js +5 -12
- package/dist/esm/plugins/table/event-handlers.js +52 -56
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +19 -69
- package/dist/esm/plugins/table/nodeviews/TableResizer.js +5 -1
- package/dist/esm/plugins/table/nodeviews/table.js +23 -30
- package/dist/esm/plugins/table/nodeviews/tableCell.js +3 -6
- package/dist/esm/plugins/table/nodeviews/update-overflow-shadows.js +0 -37
- package/dist/esm/plugins/table/pm-plugins/main.js +3 -3
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +2 -73
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/plugin.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/event-handlers.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/dom.js +1 -5
- package/dist/esm/plugins/table/ui/TableFloatingControls/index.js +3 -7
- package/dist/esm/plugins/table/ui/common-styles.js +2 -2
- package/dist/esm/plugins/table/utils/dom.js +5 -12
- package/dist/types/plugins/table/event-handlers.d.ts +1 -2
- package/dist/types/plugins/table/nodeviews/TableComponent.d.ts +0 -2
- package/dist/types/plugins/table/nodeviews/table.d.ts +0 -1
- package/dist/types/plugins/table/nodeviews/tableCell.d.ts +2 -3
- package/dist/types/plugins/table/nodeviews/types.d.ts +0 -1
- package/dist/types/plugins/table/nodeviews/update-overflow-shadows.d.ts +0 -6
- package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +1 -6
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/dom.d.ts +1 -2
- package/dist/types/plugins/table/types.d.ts +2 -2
- package/dist/types/plugins/table/ui/TableFloatingControls/index.d.ts +0 -1
- package/dist/types/plugins/table/utils/dom.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/event-handlers.d.ts +1 -2
- package/dist/types-ts4.5/plugins/table/nodeviews/TableComponent.d.ts +0 -2
- package/dist/types-ts4.5/plugins/table/nodeviews/table.d.ts +0 -1
- package/dist/types-ts4.5/plugins/table/nodeviews/tableCell.d.ts +2 -3
- package/dist/types-ts4.5/plugins/table/nodeviews/types.d.ts +0 -1
- package/dist/types-ts4.5/plugins/table/nodeviews/update-overflow-shadows.d.ts +0 -6
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +1 -6
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/dom.d.ts +1 -2
- package/dist/types-ts4.5/plugins/table/types.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/table/utils/dom.d.ts +1 -1
- package/package.json +2 -2
- package/report.api.md +2 -0
- package/src/__tests__/integration/horizontal-scroll-shadows.ts +6 -9
- package/src/__tests__/integration/resize.ts +6 -16
- package/src/__tests__/unit/event-handlers.ts +1 -4
- package/src/__tests__/unit/nodeviews/TableComponent.tsx +48 -92
- package/src/__tests__/unit/nodeviews/cell.ts +1 -3
- package/src/__tests__/unit/nodeviews/table.ts +71 -83
- package/src/__tests__/unit/pm-plugins/sticky-headers/tableRow.tsx +5 -9
- package/src/__tests__/unit/ui/RowControls.tsx +1 -0
- package/src/__tests__/unit/utils/dom.ts +6 -112
- package/src/plugins/table/event-handlers.ts +72 -79
- package/src/plugins/table/nodeviews/TableComponent.tsx +37 -114
- package/src/plugins/table/nodeviews/TableResizer.tsx +3 -0
- package/src/plugins/table/nodeviews/table.tsx +22 -30
- package/src/plugins/table/nodeviews/tableCell.tsx +3 -11
- package/src/plugins/table/nodeviews/types.ts +0 -1
- package/src/plugins/table/nodeviews/update-overflow-shadows.ts +0 -54
- package/src/plugins/table/pm-plugins/main.ts +4 -22
- package/src/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.ts +1 -83
- package/src/plugins/table/pm-plugins/sticky-headers/plugin.ts +1 -7
- package/src/plugins/table/pm-plugins/table-resizing/event-handlers.ts +1 -1
- package/src/plugins/table/pm-plugins/table-resizing/utils/dom.ts +30 -48
- package/src/plugins/table/types.ts +3 -2
- package/src/plugins/table/ui/TableFloatingControls/index.tsx +3 -15
- package/src/plugins/table/ui/common-styles.ts +1 -1
- package/src/plugins/table/utils/dom.ts +3 -11
- package/tmp/api-report-tmp.d.ts +2 -0
|
@@ -49,14 +49,13 @@ var supportedHeaderRow = function supportedHeaderRow(node) {
|
|
|
49
49
|
};
|
|
50
50
|
exports.supportedHeaderRow = supportedHeaderRow;
|
|
51
51
|
var TableRowNodeView = /*#__PURE__*/function () {
|
|
52
|
-
function TableRowNodeView(node, view, getPos, eventDispatcher
|
|
52
|
+
function TableRowNodeView(node, view, getPos, eventDispatcher) {
|
|
53
53
|
var _this = this;
|
|
54
54
|
(0, _classCallCheck2.default)(this, TableRowNodeView);
|
|
55
55
|
// this is the sticky header table row
|
|
56
56
|
(0, _defineProperty2.default)(this, "colControlsOffset", 0);
|
|
57
57
|
(0, _defineProperty2.default)(this, "focused", false);
|
|
58
58
|
(0, _defineProperty2.default)(this, "topPosEditorElement", 0);
|
|
59
|
-
(0, _defineProperty2.default)(this, "stickyHeadersOptimization", false);
|
|
60
59
|
(0, _defineProperty2.default)(this, "sentinels", {});
|
|
61
60
|
/* external events */
|
|
62
61
|
(0, _defineProperty2.default)(this, "listening", false);
|
|
@@ -72,62 +71,9 @@ var TableRowNodeView = /*#__PURE__*/function () {
|
|
|
72
71
|
_this.headerRowMouseScrollEnd();
|
|
73
72
|
}
|
|
74
73
|
}, HEADER_ROW_SCROLL_THROTTLE_TIMEOUT));
|
|
75
|
-
(0, _defineProperty2.default)(this, "onScroll", function () {
|
|
76
|
-
if (!_this.tree) {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
_this.latestDomTop = (0, _dom2.getTop)(_this.tree.wrapper);
|
|
80
|
-
|
|
81
|
-
// kick off rAF loop again if it hasn't already happened
|
|
82
|
-
if (!_this.nextFrame) {
|
|
83
|
-
_this.loop();
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
(0, _defineProperty2.default)(this, "loop", function () {
|
|
87
|
-
_this.nextFrame = window.requestAnimationFrame(function () {
|
|
88
|
-
if (_this.previousDomTop === _this.latestDomTop && _this.previousPadding === _this.padding) {
|
|
89
|
-
_this.nextFrame = undefined;
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// can't store these since React might re-render at any time
|
|
94
|
-
var tree = _this.tree;
|
|
95
|
-
if (!tree) {
|
|
96
|
-
_this.nextFrame = undefined;
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
_this.paint(tree);
|
|
100
|
-
|
|
101
|
-
// run again on next frame
|
|
102
|
-
_this.previousPadding = _this.padding;
|
|
103
|
-
_this.previousDomTop = _this.latestDomTop;
|
|
104
|
-
_this.loop();
|
|
105
|
-
});
|
|
106
|
-
});
|
|
107
|
-
(0, _defineProperty2.default)(this, "paint", function (tree) {
|
|
108
|
-
var table = tree.table,
|
|
109
|
-
wrapper = tree.wrapper;
|
|
110
|
-
|
|
111
|
-
// If the previous refresh is less than 10ms then don't do anything.
|
|
112
|
-
// The jumpiness happen under that time and this is to avoid it.
|
|
113
|
-
var timelapse = Math.abs(performance.now() - _this.lastTimePainted);
|
|
114
|
-
if (timelapse < 10) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
if (_this.shouldHeaderStick(tree)) {
|
|
118
|
-
_this.makeHeaderRowSticky(tree);
|
|
119
|
-
} else {
|
|
120
|
-
_this.makeRowHeaderNotSticky(table);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// ensure scroll positions are locked
|
|
124
|
-
_this.dom.scrollLeft = wrapper.scrollLeft;
|
|
125
|
-
_this.lastTimePainted = performance.now();
|
|
126
|
-
});
|
|
127
74
|
/* receive external events */
|
|
128
75
|
(0, _defineProperty2.default)(this, "onTablePluginState", function (state) {
|
|
129
76
|
var tableRef = state.tableRef;
|
|
130
|
-
var focusChanged = false;
|
|
131
77
|
var tree = _this.tree;
|
|
132
78
|
if (!tree) {
|
|
133
79
|
return;
|
|
@@ -147,9 +93,6 @@ var TableRowNodeView = /*#__PURE__*/function () {
|
|
|
147
93
|
if (isCurrentTableSelected && !state.isHeaderRowEnabled && _this.tree) {
|
|
148
94
|
_this.makeRowHeaderNotSticky(_this.tree.table);
|
|
149
95
|
}
|
|
150
|
-
if (isCurrentTableSelected !== _this.focused) {
|
|
151
|
-
focusChanged = true;
|
|
152
|
-
}
|
|
153
96
|
_this.focused = isCurrentTableSelected;
|
|
154
97
|
var wrapper = tree.wrapper;
|
|
155
98
|
var tableContainer = wrapper.parentElement;
|
|
@@ -171,10 +114,6 @@ var TableRowNodeView = /*#__PURE__*/function () {
|
|
|
171
114
|
|
|
172
115
|
// run after table style changes have been committed
|
|
173
116
|
setTimeout(function () {
|
|
174
|
-
// if focus changed while header is sticky - still repaint the positions will shift
|
|
175
|
-
if (!_this.stickyHeadersOptimization || focusChanged && _this.isSticky) {
|
|
176
|
-
_this.paint(tree);
|
|
177
|
-
}
|
|
178
117
|
(0, _dom.syncStickyRowToTable)(tree.table);
|
|
179
118
|
}, 0);
|
|
180
119
|
});
|
|
@@ -306,9 +245,6 @@ var TableRowNodeView = /*#__PURE__*/function () {
|
|
|
306
245
|
this.eventDispatcher = eventDispatcher;
|
|
307
246
|
this.dom = document.createElement('tr');
|
|
308
247
|
this.contentDOM = this.dom;
|
|
309
|
-
var featureFlags = getEditorFeatureFlags();
|
|
310
|
-
var stickyHeadersOptimization = featureFlags.stickyHeadersOptimization;
|
|
311
|
-
this.stickyHeadersOptimization = !!stickyHeadersOptimization;
|
|
312
248
|
this.lastTimePainted = 0;
|
|
313
249
|
this.isHeaderRow = supportedHeaderRow(node);
|
|
314
250
|
this.isSticky = false;
|
|
@@ -327,11 +263,7 @@ var TableRowNodeView = /*#__PURE__*/function () {
|
|
|
327
263
|
value: function subscribe() {
|
|
328
264
|
this.editorScrollableElement = (0, _ui.findOverflowScrollParent)(this.view.dom) || window;
|
|
329
265
|
if (this.editorScrollableElement) {
|
|
330
|
-
|
|
331
|
-
this.initObservers();
|
|
332
|
-
} else {
|
|
333
|
-
this.editorScrollableElement.addEventListener('scroll', this.onScroll);
|
|
334
|
-
}
|
|
266
|
+
this.initObservers();
|
|
335
267
|
this.topPosEditorElement = (0, _dom2.getTop)(this.editorScrollableElement);
|
|
336
268
|
}
|
|
337
269
|
this.eventDispatcher.on('widthPlugin', this.updateStickyHeaderWidth);
|
|
@@ -359,9 +291,6 @@ var TableRowNodeView = /*#__PURE__*/function () {
|
|
|
359
291
|
if (this.resizeObserver) {
|
|
360
292
|
this.resizeObserver.disconnect();
|
|
361
293
|
}
|
|
362
|
-
if (this.editorScrollableElement && !this.stickyHeadersOptimization) {
|
|
363
|
-
this.editorScrollableElement.removeEventListener('scroll', this.onScroll);
|
|
364
|
-
}
|
|
365
294
|
this.eventDispatcher.off('widthPlugin', this.updateStickyHeaderWidth);
|
|
366
295
|
this.eventDispatcher.off(_pluginKey.pluginKey.key, this.onTablePluginState);
|
|
367
296
|
this.listening = false;
|
|
@@ -19,7 +19,7 @@ var createPlugin = function createPlugin(dispatch, eventDispatcher) {
|
|
|
19
19
|
props: {
|
|
20
20
|
nodeViews: {
|
|
21
21
|
tableRow: function tableRow(node, view, getPos) {
|
|
22
|
-
return new _tableRow.TableRowNodeView(node, view, getPos, eventDispatcher
|
|
22
|
+
return new _tableRow.TableRowNodeView(node, view, getPos, eventDispatcher);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -139,7 +139,7 @@ var handleMouseDown = function handleMouseDown(view, event, localResizeHandlePos
|
|
|
139
139
|
var map = _tableMap.TableMap.get(table);
|
|
140
140
|
var colIndex = map.colCount($cell.pos - $cell.start(-1)) + $cell.nodeAfter.attrs.colspan - 1;
|
|
141
141
|
(0, _utils3.resizeColumn)(resizeState, colIndex, clientX - dragging.startX, dom);
|
|
142
|
-
(0, _utils3.updateControls)(
|
|
142
|
+
(0, _utils3.updateControls)()(state);
|
|
143
143
|
(0, _utils2.updateResizeHandles)(dom);
|
|
144
144
|
}
|
|
145
145
|
window.addEventListener('mouseup', finish);
|
|
@@ -6,12 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.updateStickyMargins = exports.updateControls = exports.syncStickyRowToTable = exports.isClickNear = exports.getResizeCellPos = exports.applyTableWidthToStickyRow = exports.applyColWidthsToStickyRow = void 0;
|
|
7
7
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
8
8
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
9
|
-
var _updateOverflowShadows = require("../../../nodeviews/update-overflow-shadows");
|
|
10
9
|
var _types = require("../../../types");
|
|
11
10
|
var _columnControls = require("../../../utils/column-controls");
|
|
12
11
|
var _rowControls = require("../../../utils/row-controls");
|
|
13
12
|
var _pluginFactory = require("../../plugin-factory");
|
|
14
|
-
var updateControls = function updateControls(
|
|
13
|
+
var updateControls = function updateControls() {
|
|
15
14
|
return function (state) {
|
|
16
15
|
var _getMainPluginState = (0, _pluginFactory.getPluginState)(state),
|
|
17
16
|
tableRef = _getMainPluginState.tableRef;
|
|
@@ -41,9 +40,6 @@ var updateControls = function updateControls(getEditorFeatureFlags) {
|
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
|
-
var rightShadows = wrapper.parentElement.querySelectorAll(".".concat(_types.TableCssClassName.TABLE_RIGHT_SHADOW));
|
|
45
|
-
var leftShadows = wrapper.parentElement.querySelectorAll(".".concat(_types.TableCssClassName.TABLE_LEFT_SHADOW));
|
|
46
|
-
(0, _updateOverflowShadows.updateOverflowShadows)(getEditorFeatureFlags)(wrapper, tableRef, rightShadows, leftShadows);
|
|
47
43
|
};
|
|
48
44
|
};
|
|
49
45
|
exports.updateControls = updateControls;
|
|
@@ -74,9 +74,7 @@ var TableFloatingControls = /*#__PURE__*/function (_Component) {
|
|
|
74
74
|
var _window,
|
|
75
75
|
_this2 = this;
|
|
76
76
|
var tableRef = this.props.tableRef;
|
|
77
|
-
|
|
78
|
-
tableRenderOptimization = _this$props$getEditor.tableRenderOptimization;
|
|
79
|
-
if (tableRenderOptimization && tableRef && !this.resizeObserver && (_window = window) !== null && _window !== void 0 && _window.ResizeObserver) {
|
|
77
|
+
if (tableRef && !this.resizeObserver && (_window = window) !== null && _window !== void 0 && _window.ResizeObserver) {
|
|
80
78
|
this.resizeObserver = new ResizeObserver(function (entries) {
|
|
81
79
|
var _iterator = _createForOfIteratorHelper(entries),
|
|
82
80
|
_step;
|
|
@@ -114,10 +112,8 @@ var TableFloatingControls = /*#__PURE__*/function (_Component) {
|
|
|
114
112
|
ordering = _this$props.ordering,
|
|
115
113
|
headerRowHeight = _this$props.headerRowHeight,
|
|
116
114
|
stickyHeader = _this$props.stickyHeader;
|
|
117
|
-
var _this$
|
|
118
|
-
|
|
119
|
-
var tableHeight = tableRenderOptimization ? (_this$state = this.state) === null || _this$state === void 0 ? void 0 : _this$state.tableHeight : this.props.tableHeight;
|
|
120
|
-
var nextTableHeight = tableRenderOptimization ? nextState === null || nextState === void 0 ? void 0 : nextState.tableHeight : nextProps.tableHeight;
|
|
115
|
+
var tableHeight = (_this$state = this.state) === null || _this$state === void 0 ? void 0 : _this$state.tableHeight;
|
|
116
|
+
var nextTableHeight = nextState === null || nextState === void 0 ? void 0 : nextState.tableHeight;
|
|
121
117
|
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 || (0, _utils2.isSelectionUpdated)(selection, nextProps.selection) || headerRowHeight !== nextProps.headerRowHeight || stickyHeader !== nextProps.stickyHeader;
|
|
122
118
|
}
|
|
123
119
|
}, {
|
|
@@ -45,8 +45,8 @@ var tableWrapperStyles = function tableWrapperStyles() {
|
|
|
45
45
|
|
|
46
46
|
// TODO: https://product-fabric.atlassian.net/browse/DSP-4139
|
|
47
47
|
var tableStyles = function tableStyles(props) {
|
|
48
|
-
var _props$featureFlags
|
|
49
|
-
return (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\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 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 /* 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 z-index: 0;\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 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 &.", "[data-number-column='true'] {\n padding-left: ", "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 /* 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 :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 .", " {\n .", ", .", " {\n display: block;\n }\n .", " {\n padding-left: 1px;\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 .", " {\n cursor: pointer;\n }\n .", ":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 border: 1px solid ", ";\n z-index: ", ";\n }\n }\n }\n .", " {\n position: absolute;\n /* top of corner control is table margin top - corner control height + 1 pixel of table border. */\n top: ", "px;\n }\n .", ".", " {\n z-index: ", ";\n }\n .", " {\n left: -", "px;\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"])), _types.TableCssClassName.LAYOUT_BUTTON, "var(--ds-background-neutral, ".concat(_colors.N20A, ")"), "var(--ds-icon, ".concat(_colors.N300, ")"), _types.TableCssClassName.LAYOUT_BUTTON, _types.TableCssClassName.IS_RESIZING, "var(--ds-background-neutral-hovered, ".concat(_colors.B300, ")"), "var(--ds-icon, white)", (0, _styles.tableSharedStyle)(props), (0, _uiStyles.columnControlsLineMarker)(), (0, _uiStyles.hoveredDeleteButton)(props), (0, _uiStyles.hoveredCell)(props), _uiStyles.hoveredWarningCell, (0, _uiStyles.resizeHandle)(props), rangeSelectionStyles, _types.TableCssClassName.LAST_ITEM_IN_CELL, _types.TableCssClassName.TABLE_NODE_WRAPPER, _types.TableCssClassName.TABLE_CELL, _types.TableCssClassName.TABLE_HEADER_CELL, _types.TableCssClassName.TABLE_CELL, (0, _consts.tableCellBackgroundColor)(props), (0, _consts.tableBorderColor)(props), (0, _consts.tableBorderColor)(props), _types.TableCssClassName.CONTROLS_FLOATING_BUTTON_COLUMN, (0, _uiStyles.insertColumnButtonWrapper)(props), _types.TableCssClassName.CONTROLS_FLOATING_BUTTON_ROW, (0, _uiStyles.insertRowButtonWrapper)(props), (0, _uiStyles.DeleteButton)(props), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.NUMBERED_COLUMN, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _consts.stickyRowOffsetTop + 2, _editorSharedStyles.akEditorTableNumberColumnWidth, _editorSharedStyles.akEditorStickyHeaderZIndex, _consts.stickyRowOffsetTop, "var(--ds-surface, white)", _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.CORNER_CONTROLS, _editorSharedStyles.akEditorSmallZIndex, "var(--ds-surface, white)", _consts.tableToolbarSize, _consts.tableToolbarSize, _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _consts.tableToolbarSize, _consts.tableToolbarSize, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.COLUMN_CONTROLS_DECORATIONS, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.ROW_CONTROLS, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _editorSharedStyles.akEditorStickyHeaderZIndex, _consts.tableToolbarSize, "var(--ds-surface, white)", _consts.tableToolbarSize, _types.TableCssClassName.TABLE_STICKY, "var(--ds-surface, green)", _consts.stickyRowOffsetTop, _editorSharedStyles.akEditorTableCellOnStickyHeaderZIndex - 5, "var(--ds-surface, white)", "var(--ds-shadow-overflow-perimeter, ".concat(_colors.N40A, ")"), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY_SHADOW, _editorSharedStyles.akEditorTableCellOnStickyHeaderZIndex, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY_SHADOW, _consts.tableToolbarSize, _consts.stickyHeaderBorderBottomWidth, (0, _consts.tableBorderColor)(props), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY, insertColumnButtonOffset + 1, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.RESIZE_HANDLE_DECORATION, (_consts.resizeHandlerAreaWidth - _consts.resizeLineWidth) / 2 + 1, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.RESIZE_HANDLE_DECORATION, (_consts.resizeHandlerAreaWidth - _consts.resizeLineWidth) / 2, _types.TableCssClassName.HOVERED_CELL, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.WITH_CONTROLS, _consts.tableControlsSpacing, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.NUMBERED_COLUMN, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _consts.tableControlsSpacing + 2, _types.TableCssClassName.CORNER_CONTROLS, _consts.tableControlsSpacing - _consts.tableToolbarSize + 2, "var(--ds-surface, white)", (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.stickyHeadersOptimization ? sentinelStyles : '', (0, _uiStyles.OverflowShadow)(props), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY_SHADOW, _consts.tablePadding, _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _consts.tablePadding, _types.TableCssClassName.TABLE_CONTAINER, _editorSharedStyles.akEditorTableNumberColumnWidth + _consts.tablePadding - 1, _types.TableCssClassName.TABLE_LEFT_SHADOW, _types.TableCssClassName.TABLE_RIGHT_SHADOW, _types.TableCssClassName.NODEVIEW_WRAPPER, breakoutWidthStyling(), (0, _uiStyles.columnControlsDecoration)(props), _types.TableCssClassName.CORNER_CONTROLS, _consts.tableToolbarSize + 1, cornerControlHeight, _types.TableCssClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, (0, _uiStyles.InsertMarker)(props, "\n left: -11px;\n top: 9px;\n "), _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _consts.tableToolbarSize + 1, _consts.tableToolbarSize + 1, (0, _consts.tableBorderColor)(props), _consts.tableBorderRadiusSize, (0, _consts.tableHeaderCellBackgroundColor)(props), _types.TableCssClassName.CONTROLS_CORNER_BUTTON, (0, _consts.tableBorderSelectedColor)(props), (0, _consts.tableToolbarSelectedColor)(props), _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _editorSharedStyles.akEditorTableToolbarSize + _editorSharedStyles.akEditorTableNumberColumnWidth, _types.TableCssClassName.ROW_CONTROLS, _types.TableCssClassName.CONTROLS_BUTTON, _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, (0, _consts.tableBorderSelectedColor)(props), (0, _consts.tableToolbarSelectedColor)(props), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, (0, _consts.tableBorderDeleteColor)(props), (0, _consts.tableToolbarDeleteColor)(props), _types.TableCssClassName.ROW_CONTROLS, _consts.tableToolbarSize, (0, _uiStyles.InsertMarker)(props, "\n bottom: -1px;\n left: -11px;\n "), _types.TableCssClassName.ROW_CONTROLS_INNER, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _consts.tableBorderRadiusSize, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _types.TableCssClassName.CONTROLS_BUTTON, _editorSharedStyles.akEditorUnitZIndex, (0, _uiStyles.HeaderButton)(props, "\n border-bottom: 1px solid ".concat((0, _consts.tableBorderColor)(props), ";\n border-right: 0px;\n border-radius: 0;\n height: 100%;\n width: ").concat(_consts.tableToolbarSize, "px;\n\n .").concat(_types.TableCssClassName.CONTROLS_BUTTON_OVERLAY, " {\n position: absolute;\n width: 30px;\n height: 50%;\n right: 0;\n bottom: 0;\n }\n .").concat(_types.TableCssClassName.CONTROLS_BUTTON_OVERLAY, ":first-of-type {\n top: 0;\n }\n ")), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.ROW_CONTROLS, (0, _uiStyles.HeaderButtonHover)(props), (0, _uiStyles.HeaderButtonDanger)(props), _types.TableCssClassName.NUMBERED_COLUMN, _editorSharedStyles.akEditorTableToolbarSize - 1, _editorSharedStyles.akEditorTableToolbarSize, _editorSharedStyles.akEditorTableNumberColumnWidth + 1, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, (0, _consts.tableBorderColor)(props), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _consts.tableHeaderCellBackgroundColor)(props), (0, _consts.tableTextColor)(props), (0, _consts.tableBorderColor)(props), (0, _consts.tableBorderColor)(props), _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.ROW_CONTROLS, _types.TableCssClassName.NUMBERED_COLUMN, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, (0, _consts.tableBorderSelectedColor)(props), (0, _consts.tableBorderSelectedColor)(props), (0, _consts.tableToolbarSelectedColor)(props), _editorSharedStyles.akEditorUnitZIndex, "var(--ds-text-selected, ".concat(_colors.N0, ")"), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, (0, _consts.tableBorderSelectedColor)(props), (0, _consts.tableBorderSelectedColor)(props), (0, _consts.tableToolbarSelectedColor)(props), _editorSharedStyles.akEditorUnitZIndex, "var(--ds-text-selected, ".concat(_colors.N0, ")"), _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, (0, _consts.tableToolbarDeleteColor)(props), (0, _consts.tableBorderDeleteColor)(props), "var(--ds-text-danger, ".concat(_colors.R500, ")"), _editorSharedStyles.akEditorUnitZIndex, _types.TableCssClassName.TABLE_NODE_WRAPPER, _types.TableCssClassName.COLUMN_CONTROLS_DECORATIONS, _types.TableCssClassName.TABLE_HEADER_CELL, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _editorSharedStyles.akEditorSmallZIndex, _types.TableCssClassName.SELECTED_CELL, (0, _consts.tableBorderSelectedColor)(props), _types.TableCssClassName.SELECTED_CELL, (0, _consts.tableCellSelectedColor)(props), _editorSharedStyles.akEditorSmallZIndex, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, (0, _consts.tableCellDeleteColor)(props), _editorSharedStyles.akEditorUnitZIndex * 100, _types.TableCssClassName.HOVERED_CELL, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.TABLE_HEADER_CELL, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.TABLE_HEADER_CELL, _types.TableCssClassName.HOVERED_CELL, (0, _consts.tableBorderSelectedColor)(props), _editorSharedStyles.akEditorSmallZIndex, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, (0, _consts.tableBorderDeleteColor)(props), _editorSharedStyles.akEditorUnitZIndex * 100, _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _styles.tableMarginTop - cornerControlHeight + 1, _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _types.TableCssClassName.TABLE_LEFT_SHADOW, _editorSharedStyles.akEditorUnitZIndex, _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _consts.tableToolbarSize, tableWrapperStyles(), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.TABLE_NODE_WRAPPER, _scrollbar.scrollbarStyles, _types.TableCssClassName.RESIZE_CURSOR, props !== null && props !== void 0 && (_props$featureFlags2 = props.featureFlags) !== null && _props$featureFlags2 !== void 0 && _props$featureFlags2.restartNumberedLists ? "" : listLargeNumericMarkersOldStyles, shadowSentinelStyles);
|
|
48
|
+
var _props$featureFlags;
|
|
49
|
+
return (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\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 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 /* 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 z-index: 0;\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 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 &.", "[data-number-column='true'] {\n padding-left: ", "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 /* 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 :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 .", " {\n .", ", .", " {\n display: block;\n }\n .", " {\n padding-left: 1px;\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 .", " {\n cursor: pointer;\n }\n .", ":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 border: 1px solid ", ";\n z-index: ", ";\n }\n }\n }\n .", " {\n position: absolute;\n /* top of corner control is table margin top - corner control height + 1 pixel of table border. */\n top: ", "px;\n }\n .", ".", " {\n z-index: ", ";\n }\n .", " {\n left: -", "px;\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"])), _types.TableCssClassName.LAYOUT_BUTTON, "var(--ds-background-neutral, ".concat(_colors.N20A, ")"), "var(--ds-icon, ".concat(_colors.N300, ")"), _types.TableCssClassName.LAYOUT_BUTTON, _types.TableCssClassName.IS_RESIZING, "var(--ds-background-neutral-hovered, ".concat(_colors.B300, ")"), "var(--ds-icon, white)", (0, _styles.tableSharedStyle)(props), (0, _uiStyles.columnControlsLineMarker)(), (0, _uiStyles.hoveredDeleteButton)(props), (0, _uiStyles.hoveredCell)(props), _uiStyles.hoveredWarningCell, (0, _uiStyles.resizeHandle)(props), rangeSelectionStyles, _types.TableCssClassName.LAST_ITEM_IN_CELL, _types.TableCssClassName.TABLE_NODE_WRAPPER, _types.TableCssClassName.TABLE_CELL, _types.TableCssClassName.TABLE_HEADER_CELL, _types.TableCssClassName.TABLE_CELL, (0, _consts.tableCellBackgroundColor)(props), (0, _consts.tableBorderColor)(props), (0, _consts.tableBorderColor)(props), _types.TableCssClassName.CONTROLS_FLOATING_BUTTON_COLUMN, (0, _uiStyles.insertColumnButtonWrapper)(props), _types.TableCssClassName.CONTROLS_FLOATING_BUTTON_ROW, (0, _uiStyles.insertRowButtonWrapper)(props), (0, _uiStyles.DeleteButton)(props), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.NUMBERED_COLUMN, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _consts.stickyRowOffsetTop + 2, _editorSharedStyles.akEditorTableNumberColumnWidth, _editorSharedStyles.akEditorStickyHeaderZIndex, _consts.stickyRowOffsetTop, "var(--ds-surface, white)", _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.CORNER_CONTROLS, _editorSharedStyles.akEditorSmallZIndex, "var(--ds-surface, white)", _consts.tableToolbarSize, _consts.tableToolbarSize, _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _consts.tableToolbarSize, _consts.tableToolbarSize, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.COLUMN_CONTROLS_DECORATIONS, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.ROW_CONTROLS, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _editorSharedStyles.akEditorStickyHeaderZIndex, _consts.tableToolbarSize, "var(--ds-surface, white)", _consts.tableToolbarSize, _types.TableCssClassName.TABLE_STICKY, "var(--ds-surface, green)", _consts.stickyRowOffsetTop, _editorSharedStyles.akEditorTableCellOnStickyHeaderZIndex - 5, "var(--ds-surface, white)", "var(--ds-shadow-overflow-perimeter, ".concat(_colors.N40A, ")"), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY_SHADOW, _editorSharedStyles.akEditorTableCellOnStickyHeaderZIndex, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY_SHADOW, _consts.tableToolbarSize, _consts.stickyHeaderBorderBottomWidth, (0, _consts.tableBorderColor)(props), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY, insertColumnButtonOffset + 1, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.RESIZE_HANDLE_DECORATION, (_consts.resizeHandlerAreaWidth - _consts.resizeLineWidth) / 2 + 1, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.RESIZE_HANDLE_DECORATION, (_consts.resizeHandlerAreaWidth - _consts.resizeLineWidth) / 2, _types.TableCssClassName.HOVERED_CELL, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.WITH_CONTROLS, _consts.tableControlsSpacing, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.NUMBERED_COLUMN, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _consts.tableControlsSpacing + 2, _types.TableCssClassName.CORNER_CONTROLS, _consts.tableControlsSpacing - _consts.tableToolbarSize + 2, "var(--ds-surface, white)", sentinelStyles, (0, _uiStyles.OverflowShadow)(props), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY_SHADOW, _consts.tablePadding, _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _consts.tablePadding, _types.TableCssClassName.TABLE_CONTAINER, _editorSharedStyles.akEditorTableNumberColumnWidth + _consts.tablePadding - 1, _types.TableCssClassName.TABLE_LEFT_SHADOW, _types.TableCssClassName.TABLE_RIGHT_SHADOW, _types.TableCssClassName.NODEVIEW_WRAPPER, breakoutWidthStyling(), (0, _uiStyles.columnControlsDecoration)(props), _types.TableCssClassName.CORNER_CONTROLS, _consts.tableToolbarSize + 1, cornerControlHeight, _types.TableCssClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, (0, _uiStyles.InsertMarker)(props, "\n left: -11px;\n top: 9px;\n "), _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _consts.tableToolbarSize + 1, _consts.tableToolbarSize + 1, (0, _consts.tableBorderColor)(props), _consts.tableBorderRadiusSize, (0, _consts.tableHeaderCellBackgroundColor)(props), _types.TableCssClassName.CONTROLS_CORNER_BUTTON, (0, _consts.tableBorderSelectedColor)(props), (0, _consts.tableToolbarSelectedColor)(props), _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _editorSharedStyles.akEditorTableToolbarSize + _editorSharedStyles.akEditorTableNumberColumnWidth, _types.TableCssClassName.ROW_CONTROLS, _types.TableCssClassName.CONTROLS_BUTTON, _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, (0, _consts.tableBorderSelectedColor)(props), (0, _consts.tableToolbarSelectedColor)(props), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, (0, _consts.tableBorderDeleteColor)(props), (0, _consts.tableToolbarDeleteColor)(props), _types.TableCssClassName.ROW_CONTROLS, _consts.tableToolbarSize, (0, _uiStyles.InsertMarker)(props, "\n bottom: -1px;\n left: -11px;\n "), _types.TableCssClassName.ROW_CONTROLS_INNER, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _consts.tableBorderRadiusSize, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _types.TableCssClassName.CONTROLS_BUTTON, _editorSharedStyles.akEditorUnitZIndex, (0, _uiStyles.HeaderButton)(props, "\n border-bottom: 1px solid ".concat((0, _consts.tableBorderColor)(props), ";\n border-right: 0px;\n border-radius: 0;\n height: 100%;\n width: ").concat(_consts.tableToolbarSize, "px;\n\n .").concat(_types.TableCssClassName.CONTROLS_BUTTON_OVERLAY, " {\n position: absolute;\n width: 30px;\n height: 50%;\n right: 0;\n bottom: 0;\n }\n .").concat(_types.TableCssClassName.CONTROLS_BUTTON_OVERLAY, ":first-of-type {\n top: 0;\n }\n ")), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.ROW_CONTROLS, (0, _uiStyles.HeaderButtonHover)(props), (0, _uiStyles.HeaderButtonDanger)(props), _types.TableCssClassName.NUMBERED_COLUMN, _editorSharedStyles.akEditorTableToolbarSize - 1, _editorSharedStyles.akEditorTableToolbarSize, _editorSharedStyles.akEditorTableNumberColumnWidth + 1, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, (0, _consts.tableBorderColor)(props), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _consts.tableHeaderCellBackgroundColor)(props), (0, _consts.tableTextColor)(props), (0, _consts.tableBorderColor)(props), (0, _consts.tableBorderColor)(props), _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.ROW_CONTROLS, _types.TableCssClassName.NUMBERED_COLUMN, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, (0, _consts.tableBorderSelectedColor)(props), (0, _consts.tableBorderSelectedColor)(props), (0, _consts.tableToolbarSelectedColor)(props), _editorSharedStyles.akEditorUnitZIndex, "var(--ds-text-selected, ".concat(_colors.N0, ")"), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, (0, _consts.tableBorderSelectedColor)(props), (0, _consts.tableBorderSelectedColor)(props), (0, _consts.tableToolbarSelectedColor)(props), _editorSharedStyles.akEditorUnitZIndex, "var(--ds-text-selected, ".concat(_colors.N0, ")"), _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, (0, _consts.tableToolbarDeleteColor)(props), (0, _consts.tableBorderDeleteColor)(props), "var(--ds-text-danger, ".concat(_colors.R500, ")"), _editorSharedStyles.akEditorUnitZIndex, _types.TableCssClassName.TABLE_NODE_WRAPPER, _types.TableCssClassName.COLUMN_CONTROLS_DECORATIONS, _types.TableCssClassName.TABLE_HEADER_CELL, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _editorSharedStyles.akEditorSmallZIndex, _types.TableCssClassName.SELECTED_CELL, (0, _consts.tableBorderSelectedColor)(props), _types.TableCssClassName.SELECTED_CELL, (0, _consts.tableCellSelectedColor)(props), _editorSharedStyles.akEditorSmallZIndex, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, (0, _consts.tableCellDeleteColor)(props), _editorSharedStyles.akEditorUnitZIndex * 100, _types.TableCssClassName.HOVERED_CELL, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.TABLE_HEADER_CELL, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.TABLE_HEADER_CELL, _types.TableCssClassName.HOVERED_CELL, (0, _consts.tableBorderSelectedColor)(props), _editorSharedStyles.akEditorSmallZIndex, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, (0, _consts.tableBorderDeleteColor)(props), _editorSharedStyles.akEditorUnitZIndex * 100, _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _styles.tableMarginTop - cornerControlHeight + 1, _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _types.TableCssClassName.TABLE_LEFT_SHADOW, _editorSharedStyles.akEditorUnitZIndex, _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _consts.tableToolbarSize, tableWrapperStyles(), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.TABLE_NODE_WRAPPER, _scrollbar.scrollbarStyles, _types.TableCssClassName.RESIZE_CURSOR, props !== null && props !== void 0 && (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.restartNumberedLists ? "" : listLargeNumericMarkersOldStyles, shadowSentinelStyles);
|
|
50
50
|
};
|
|
51
51
|
exports.tableStyles = tableStyles;
|
|
52
52
|
var tableFullPageEditorStyles = (0, _react.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\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"])), _types.TableCssClassName.TABLE_NODE_WRAPPER);
|
|
@@ -98,22 +98,15 @@ var isTableContainerOrWrapper = function isTableContainerOrWrapper(node) {
|
|
|
98
98
|
* the same is valid to the right side.
|
|
99
99
|
*/
|
|
100
100
|
exports.isTableContainerOrWrapper = isTableContainerOrWrapper;
|
|
101
|
-
var getMousePositionHorizontalRelativeByElement = function getMousePositionHorizontalRelativeByElement(mouseEvent,
|
|
101
|
+
var getMousePositionHorizontalRelativeByElement = function getMousePositionHorizontalRelativeByElement(mouseEvent, elementContentRects, gapInPixels) {
|
|
102
102
|
var element = mouseEvent.target;
|
|
103
103
|
if (element instanceof HTMLElement) {
|
|
104
|
+
var _closestCell$id, _elementContentRects$, _elementContentRects$2;
|
|
104
105
|
var width, x;
|
|
105
106
|
var closestCell = element.closest(SELECTOR_TABLE_LEAFS);
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
width = (_elementContentRects$ = elementContentRects === null || elementContentRects === void 0 ? void 0 : (_elementContentRects$2 = elementContentRects[id]) === null || _elementContentRects$2 === void 0 ? void 0 : _elementContentRects$2.width) !== null && _elementContentRects$ !== void 0 ? _elementContentRects$ : 0;
|
|
110
|
-
x = mouseEvent.offsetX;
|
|
111
|
-
} else {
|
|
112
|
-
var elementRect = element.getBoundingClientRect();
|
|
113
|
-
width = elementRect.width;
|
|
114
|
-
var left = elementRect.left;
|
|
115
|
-
x = mouseEvent.clientX - left;
|
|
116
|
-
}
|
|
107
|
+
var id = (_closestCell$id = closestCell === null || closestCell === void 0 ? void 0 : closestCell.id) !== null && _closestCell$id !== void 0 ? _closestCell$id : '';
|
|
108
|
+
width = (_elementContentRects$ = elementContentRects === null || elementContentRects === void 0 ? void 0 : (_elementContentRects$2 = elementContentRects[id]) === null || _elementContentRects$2 === void 0 ? void 0 : _elementContentRects$2.width) !== null && _elementContentRects$ !== void 0 ? _elementContentRects$ : 0;
|
|
109
|
+
x = mouseEvent.offsetX;
|
|
117
110
|
if (width <= 0) {
|
|
118
111
|
return null;
|
|
119
112
|
}
|
|
@@ -182,7 +182,7 @@ export const handleMouseLeave = (view, event) => {
|
|
|
182
182
|
}
|
|
183
183
|
return false;
|
|
184
184
|
};
|
|
185
|
-
export const handleMouseMove =
|
|
185
|
+
export const handleMouseMove = (view, event, elementContentRects) => {
|
|
186
186
|
if (!(event.target instanceof HTMLElement)) {
|
|
187
187
|
return false;
|
|
188
188
|
}
|
|
@@ -196,7 +196,7 @@ export const handleMouseMove = getEditorFeatureFlags => (view, event, elementCon
|
|
|
196
196
|
insertColumnButtonIndex
|
|
197
197
|
} = getPluginState(state);
|
|
198
198
|
const [startIndex, endIndex] = getColumnOrRowIndex(element);
|
|
199
|
-
const positionColumn = getMousePositionHorizontalRelativeByElement(event,
|
|
199
|
+
const positionColumn = getMousePositionHorizontalRelativeByElement(event, elementContentRects) === 'right' ? endIndex : startIndex;
|
|
200
200
|
if (positionColumn !== insertColumnButtonIndex) {
|
|
201
201
|
return showInsertColumnButton(positionColumn)(state, dispatch);
|
|
202
202
|
}
|
|
@@ -215,11 +215,8 @@ export const handleMouseMove = getEditorFeatureFlags => (view, event, elementCon
|
|
|
215
215
|
return showInsertRowButton(positionRow)(state, dispatch);
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
const {
|
|
219
|
-
mouseMoveOptimization
|
|
220
|
-
} = getEditorFeatureFlags();
|
|
221
218
|
if (!isResizeHandleDecoration(element) && isCell(element)) {
|
|
222
|
-
const positionColumn = getMousePositionHorizontalRelativeByElement(event,
|
|
219
|
+
const positionColumn = getMousePositionHorizontalRelativeByElement(event, elementContentRects, RESIZE_HANDLE_AREA_DECORATION_GAP);
|
|
223
220
|
if (positionColumn !== null) {
|
|
224
221
|
const {
|
|
225
222
|
state,
|
|
@@ -21,16 +21,13 @@ import TableFloatingControls from '../ui/TableFloatingControls';
|
|
|
21
21
|
import { containsHeaderRow, isTableNested, tablesHaveDifferentColumnWidths, tablesHaveDifferentNoOfColumns } from '../utils';
|
|
22
22
|
import { OverflowShadowsObserver } from './OverflowShadowsObserver';
|
|
23
23
|
import { TableContainer } from './TableContainer';
|
|
24
|
-
import { updateOverflowShadows } from './update-overflow-shadows';
|
|
25
24
|
const isIE11 = browser.ie_version === 11;
|
|
26
|
-
const NOOP = () => undefined;
|
|
27
25
|
class TableComponent extends React.Component {
|
|
28
26
|
constructor(props) {
|
|
29
27
|
super(props);
|
|
30
28
|
_defineProperty(this, "state", {
|
|
31
29
|
scroll: 0,
|
|
32
30
|
parentWidth: undefined,
|
|
33
|
-
isLoading: true,
|
|
34
31
|
[ShadowEvent.SHOW_BEFORE_SHADOW]: false,
|
|
35
32
|
[ShadowEvent.SHOW_AFTER_SHADOW]: false
|
|
36
33
|
});
|
|
@@ -53,9 +50,6 @@ class TableComponent extends React.Component {
|
|
|
53
50
|
}
|
|
54
51
|
});
|
|
55
52
|
_defineProperty(this, "onStickyState", state => {
|
|
56
|
-
const {
|
|
57
|
-
tableOverflowShadowsOptimization
|
|
58
|
-
} = this.props.getEditorFeatureFlags();
|
|
59
53
|
const pos = this.props.getPos();
|
|
60
54
|
if (!isValidPosition(pos, this.props.view.state)) {
|
|
61
55
|
return;
|
|
@@ -65,7 +59,7 @@ class TableComponent extends React.Component {
|
|
|
65
59
|
this.setState({
|
|
66
60
|
stickyHeader
|
|
67
61
|
});
|
|
68
|
-
if (
|
|
62
|
+
if (this.overflowShadowsObserver) {
|
|
69
63
|
this.overflowShadowsObserver.updateStickyShadows();
|
|
70
64
|
}
|
|
71
65
|
}
|
|
@@ -84,12 +78,6 @@ class TableComponent extends React.Component {
|
|
|
84
78
|
header.style.marginRight = '2px';
|
|
85
79
|
}
|
|
86
80
|
}
|
|
87
|
-
const {
|
|
88
|
-
tableOverflowShadowsOptimization
|
|
89
|
-
} = this.props.getEditorFeatureFlags();
|
|
90
|
-
if (!tableOverflowShadowsOptimization) {
|
|
91
|
-
this.updateShadows();
|
|
92
|
-
}
|
|
93
81
|
this.setState({
|
|
94
82
|
[ShadowEvent.SHOW_BEFORE_SHADOW]: this.wrapper.scrollLeft !== 0
|
|
95
83
|
});
|
|
@@ -248,8 +236,7 @@ class TableComponent extends React.Component {
|
|
|
248
236
|
const {
|
|
249
237
|
options: _options,
|
|
250
238
|
containerWidth: _containerWidth,
|
|
251
|
-
getNode: _getNode
|
|
252
|
-
getEditorFeatureFlags
|
|
239
|
+
getNode: _getNode
|
|
253
240
|
} = props;
|
|
254
241
|
this.node = _getNode();
|
|
255
242
|
this.containerWidth = _containerWidth;
|
|
@@ -269,17 +256,6 @@ class TableComponent extends React.Component {
|
|
|
269
256
|
}
|
|
270
257
|
});
|
|
271
258
|
}
|
|
272
|
-
const {
|
|
273
|
-
initialRenderOptimization
|
|
274
|
-
} = getEditorFeatureFlags();
|
|
275
|
-
if (!initialRenderOptimization) {
|
|
276
|
-
// @see ED-7945
|
|
277
|
-
requestAnimationFrame(() => {
|
|
278
|
-
this.setState({
|
|
279
|
-
isLoading: false
|
|
280
|
-
});
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
259
|
}
|
|
284
260
|
componentDidMount() {
|
|
285
261
|
const {
|
|
@@ -331,6 +307,7 @@ class TableComponent extends React.Component {
|
|
|
331
307
|
eventDispatcher.off(stickyHeadersPluginKey.key, this.onStickyState);
|
|
332
308
|
}
|
|
333
309
|
componentDidUpdate() {
|
|
310
|
+
var _this$wrapper;
|
|
334
311
|
const {
|
|
335
312
|
view,
|
|
336
313
|
getNode,
|
|
@@ -344,20 +321,12 @@ class TableComponent extends React.Component {
|
|
|
344
321
|
if (isInDanger && !table) {
|
|
345
322
|
clearHoverSelection()(view.state, view.dispatch);
|
|
346
323
|
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
}
|
|
350
|
-
if (
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
var _this$wrapper;
|
|
354
|
-
if ((_this$wrapper = this.wrapper) !== null && _this$wrapper !== void 0 && _this$wrapper.parentElement && this.table && !this.overflowShadowsObserver) {
|
|
355
|
-
this.overflowShadowsObserver = new OverflowShadowsObserver(this.updateShadowState, this.table, this.wrapper);
|
|
356
|
-
}
|
|
357
|
-
if (this.overflowShadowsObserver) {
|
|
358
|
-
var _this$state$stickyHea;
|
|
359
|
-
this.overflowShadowsObserver.observeShadowSentinels((_this$state$stickyHea = this.state.stickyHeader) === null || _this$state$stickyHea === void 0 ? void 0 : _this$state$stickyHea.sticky);
|
|
360
|
-
}
|
|
324
|
+
if ((_this$wrapper = this.wrapper) !== null && _this$wrapper !== void 0 && _this$wrapper.parentElement && this.table && !this.overflowShadowsObserver) {
|
|
325
|
+
this.overflowShadowsObserver = new OverflowShadowsObserver(this.updateShadowState, this.table, this.wrapper);
|
|
326
|
+
}
|
|
327
|
+
if (this.overflowShadowsObserver) {
|
|
328
|
+
var _this$state$stickyHea;
|
|
329
|
+
this.overflowShadowsObserver.observeShadowSentinels((_this$state$stickyHea = this.state.stickyHeader) === null || _this$state$stickyHea === void 0 ? void 0 : _this$state$stickyHea.sticky);
|
|
361
330
|
}
|
|
362
331
|
const currentTable = getNode();
|
|
363
332
|
if (currentTable.attrs.__autoSize) {
|
|
@@ -375,20 +344,11 @@ class TableComponent extends React.Component {
|
|
|
375
344
|
view
|
|
376
345
|
} = this.props;
|
|
377
346
|
recreateResizeColsByNode(this.table, currentTable);
|
|
378
|
-
updateControls(
|
|
347
|
+
updateControls()(view.state);
|
|
379
348
|
}
|
|
380
349
|
this.handleTableResizingDebounced();
|
|
381
350
|
}
|
|
382
351
|
}
|
|
383
|
-
updateShadows() {
|
|
384
|
-
var _this$wrapper2;
|
|
385
|
-
const parent = (_this$wrapper2 = this.wrapper) === null || _this$wrapper2 === void 0 ? void 0 : _this$wrapper2.parentElement;
|
|
386
|
-
if (this.wrapper && parent) {
|
|
387
|
-
const rightShadows = parent.querySelectorAll(`.${ClassName.TABLE_RIGHT_SHADOW}`);
|
|
388
|
-
const leftShadows = parent.querySelectorAll(`.${ClassName.TABLE_LEFT_SHADOW}`);
|
|
389
|
-
updateOverflowShadows(this.props.getEditorFeatureFlags)(this.wrapper, this.table, rightShadows, leftShadows);
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
352
|
render() {
|
|
393
353
|
const {
|
|
394
354
|
view,
|
|
@@ -405,7 +365,6 @@ class TableComponent extends React.Component {
|
|
|
405
365
|
pluginInjectionApi
|
|
406
366
|
} = this.props;
|
|
407
367
|
const {
|
|
408
|
-
isLoading,
|
|
409
368
|
showBeforeShadow,
|
|
410
369
|
showAfterShadow
|
|
411
370
|
} = this.state;
|
|
@@ -415,17 +374,8 @@ class TableComponent extends React.Component {
|
|
|
415
374
|
isInDanger,
|
|
416
375
|
hoveredRows
|
|
417
376
|
} = getPluginState(view.state);
|
|
418
|
-
const {
|
|
419
|
-
stickyHeadersOptimization,
|
|
420
|
-
initialRenderOptimization,
|
|
421
|
-
tableRenderOptimization,
|
|
422
|
-
tableOverflowShadowsOptimization
|
|
423
|
-
} = this.props.getEditorFeatureFlags();
|
|
424
377
|
const tableRef = this.table || undefined;
|
|
425
378
|
const headerRow = tableRef ? tableRef.querySelector('tr[data-header-row]') : undefined;
|
|
426
|
-
|
|
427
|
-
//dont need to change tableHeight with tableRenderOptimization because it will be observed inside floating components
|
|
428
|
-
const tableHeight = tableRef && !tableRenderOptimization ? tableRef.offsetHeight : undefined;
|
|
429
379
|
const hasHeaderRow = containsHeaderRow(node);
|
|
430
380
|
const rowControls = /*#__PURE__*/React.createElement("div", {
|
|
431
381
|
className: ClassName.ROW_CONTROLS_WRAPPER
|
|
@@ -444,15 +394,14 @@ class TableComponent extends React.Component {
|
|
|
444
394
|
// pass `selection` and `tableHeight` to control re-render
|
|
445
395
|
,
|
|
446
396
|
selection: view.state.selection,
|
|
447
|
-
tableHeight: tableHeight,
|
|
448
397
|
headerRowHeight: headerRow ? headerRow.offsetHeight : undefined,
|
|
449
398
|
stickyHeader: this.state.stickyHeader,
|
|
450
399
|
getEditorFeatureFlags: this.props.getEditorFeatureFlags
|
|
451
400
|
}));
|
|
452
|
-
const shadowPadding = allowControls &&
|
|
453
|
-
const shadowStyle =
|
|
401
|
+
const shadowPadding = allowControls && tableActive ? -tableToolbarSize : tableMarginSides;
|
|
402
|
+
const shadowStyle = memoizeOne(visible => ({
|
|
454
403
|
visibility: visible ? 'visible' : 'hidden'
|
|
455
|
-
}))
|
|
404
|
+
}));
|
|
456
405
|
const isNested = isTableNested(view.state, getPos());
|
|
457
406
|
return /*#__PURE__*/React.createElement(TableContainer, {
|
|
458
407
|
className: classnames(ClassName.TABLE_CONTAINER, {
|
|
@@ -470,16 +419,16 @@ class TableComponent extends React.Component {
|
|
|
470
419
|
isNested: isNested,
|
|
471
420
|
pluginInjectionApi: pluginInjectionApi,
|
|
472
421
|
isTableResizingEnabled: options === null || options === void 0 ? void 0 : options.isTableResizingEnabled
|
|
473
|
-
},
|
|
422
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
474
423
|
className: ClassName.TABLE_STICKY_SENTINEL_TOP,
|
|
475
424
|
"data-testid": "sticky-sentinel-top"
|
|
476
|
-
}), allowControls &&
|
|
425
|
+
}), allowControls && rowControls, /*#__PURE__*/React.createElement("div", {
|
|
477
426
|
style: shadowStyle(showBeforeShadow),
|
|
478
427
|
className: ClassName.TABLE_LEFT_SHADOW
|
|
479
428
|
}), this.state.stickyHeader && /*#__PURE__*/React.createElement("div", {
|
|
480
429
|
className: `${ClassName.TABLE_LEFT_SHADOW} ${ClassName.TABLE_STICKY_SHADOW}`,
|
|
481
430
|
style: {
|
|
482
|
-
visibility:
|
|
431
|
+
visibility: showBeforeShadow && hasHeaderRow ? 'visible' : 'hidden',
|
|
483
432
|
top: `${this.state.stickyHeader.top + this.state.stickyHeader.padding + shadowPadding + 2}px`
|
|
484
433
|
}
|
|
485
434
|
}), /*#__PURE__*/React.createElement("div", {
|
|
@@ -506,10 +455,10 @@ class TableComponent extends React.Component {
|
|
|
506
455
|
}, /*#__PURE__*/React.createElement("div", {
|
|
507
456
|
className: `${ClassName.TABLE_RIGHT_SHADOW} ${ClassName.TABLE_STICKY_SHADOW}`,
|
|
508
457
|
style: {
|
|
509
|
-
visibility:
|
|
458
|
+
visibility: showAfterShadow && hasHeaderRow ? 'visible' : 'hidden',
|
|
510
459
|
top: `${this.state.stickyHeader.top + this.state.stickyHeader.padding + shadowPadding + 2}px`
|
|
511
460
|
}
|
|
512
|
-
})),
|
|
461
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
513
462
|
className: ClassName.TABLE_STICKY_SENTINEL_BOTTOM,
|
|
514
463
|
"data-testid": "sticky-sentinel-bottom"
|
|
515
464
|
}));
|
|
@@ -4,6 +4,7 @@ import { getGuidelinesWithHighlights } from '@atlaskit/editor-common/guideline';
|
|
|
4
4
|
import { ResizerNext } from '@atlaskit/editor-common/resizer';
|
|
5
5
|
import { resizerHandleShadowClassName } from '@atlaskit/editor-common/styles';
|
|
6
6
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
7
|
+
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
7
8
|
import { COLUMN_MIN_WIDTH, getColgroupChildrenLength, previewScaleTable, scaleTable } from '../pm-plugins/table-resizing/utils';
|
|
8
9
|
import { pluginKey as tableWidthPluginKey } from '../pm-plugins/table-width';
|
|
9
10
|
import { TABLE_HIGHLIGHT_GAP, TABLE_HIGHLIGHT_TOLERANCE, TABLE_SNAP_GAP } from '../ui/consts';
|
|
@@ -70,6 +71,9 @@ export const TableResizer = ({
|
|
|
70
71
|
const [snappingEnabled, setSnappingEnabled] = useState(false);
|
|
71
72
|
const resizerMinWidth = getResizerMinWidth(node);
|
|
72
73
|
const handleHeightSize = getResizerHandleHeight(tableRef);
|
|
74
|
+
const {
|
|
75
|
+
isInDanger
|
|
76
|
+
} = getPluginState(editorView.state);
|
|
73
77
|
const {
|
|
74
78
|
startMeasure,
|
|
75
79
|
endMeasure,
|
|
@@ -200,6 +204,7 @@ export const TableResizer = ({
|
|
|
200
204
|
handlePositioning: "adjacent",
|
|
201
205
|
innerPadding: tableHandlePosition,
|
|
202
206
|
isHandleVisible: ((_findTable = findTable((_editorView$state = editorView.state) === null || _editorView$state === void 0 ? void 0 : _editorView$state.selection)) === null || _findTable === void 0 ? void 0 : _findTable.pos) === getPos(),
|
|
203
|
-
handleComponent: handleComponent
|
|
207
|
+
handleComponent: handleComponent,
|
|
208
|
+
appearance: isInDanger ? 'danger' : undefined
|
|
204
209
|
}, children);
|
|
205
210
|
};
|