@atlaskit/editor-plugin-table 3.1.3 → 3.2.0
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 +10 -0
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +36 -2
- package/dist/cjs/plugins/table/nodeviews/TableStickyScrollbar.js +154 -0
- package/dist/cjs/plugins/table/toolbar.js +6 -0
- package/dist/cjs/plugins/table/ui/common-styles.js +9 -2
- package/dist/es2019/plugins/table/nodeviews/TableComponent.js +37 -3
- package/dist/es2019/plugins/table/nodeviews/TableStickyScrollbar.js +112 -0
- package/dist/es2019/plugins/table/toolbar.js +6 -0
- package/dist/es2019/plugins/table/ui/common-styles.js +33 -1
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +37 -3
- package/dist/esm/plugins/table/nodeviews/TableStickyScrollbar.js +146 -0
- package/dist/esm/plugins/table/toolbar.js +6 -0
- package/dist/esm/plugins/table/ui/common-styles.js +8 -2
- package/dist/types/plugins/table/nodeviews/TableComponent.d.ts +1 -0
- package/dist/types/plugins/table/nodeviews/TableStickyScrollbar.d.ts +24 -0
- package/dist/types/plugins/table/toolbar.d.ts +4 -4
- package/dist/types/plugins/table/types.d.ts +3 -0
- package/dist/types/plugins/table/ui/common-styles.d.ts +1 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/TableComponent.d.ts +1 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/TableStickyScrollbar.d.ts +24 -0
- package/dist/types-ts4.5/plugins/table/toolbar.d.ts +4 -4
- package/dist/types-ts4.5/plugins/table/types.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/ui/common-styles.d.ts +1 -0
- package/package.json +6 -3
- package/src/plugins/table/nodeviews/TableComponent.tsx +54 -3
- package/src/plugins/table/nodeviews/TableStickyScrollbar.ts +204 -0
- package/src/plugins/table/toolbar.tsx +10 -6
- package/src/plugins/table/ui/common-styles.ts +38 -0
|
@@ -12,6 +12,7 @@ import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
|
12
12
|
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
13
13
|
import { findCellRectClosestToPos, findTable, getSelectionRect, isSelectionType, splitCell } from '@atlaskit/editor-tables/utils';
|
|
14
14
|
import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
15
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
15
16
|
import { clearHoverSelection, hoverColumns, hoverMergedCells, hoverRows, hoverTable, removeDescendantNodes } from './commands';
|
|
16
17
|
import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics, deleteTableWithAnalytics, distributeColumnsWidthsWithAnalytics, emptyMultipleCellsWithAnalytics, insertColumnWithAnalytics, insertRowWithAnalytics, mergeCellsWithAnalytics, setColorWithAnalytics, sortColumnWithAnalytics, splitCellWithAnalytics, toggleHeaderColumnWithAnalytics, toggleHeaderRowWithAnalytics, toggleNumberColumnWithAnalytics, wrapTableInExpandWithAnalytics } from './commands-with-analytics';
|
|
17
18
|
import { getPluginState } from './pm-plugins/plugin-factory';
|
|
@@ -337,6 +338,11 @@ export const getToolbarConfig = (getEditorContainerWidth, editorAnalyticsAPI, ge
|
|
|
337
338
|
getDomRef,
|
|
338
339
|
nodeType,
|
|
339
340
|
offset: [0, 18],
|
|
341
|
+
absoluteOffset: getBooleanFF('platform.editor.table-sticky-scrollbar') ? {
|
|
342
|
+
top: -6
|
|
343
|
+
} : {
|
|
344
|
+
top: 0
|
|
345
|
+
},
|
|
340
346
|
zIndex: akEditorFloatingPanelZIndex + 1,
|
|
341
347
|
// Place the context menu slightly above the others
|
|
342
348
|
items: [menu, separator(menu.hidden), ...cellItems, ...colorPicker, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { tableMarginTop, tableSharedStyle } from '@atlaskit/editor-common/styles';
|
|
3
|
-
import { akEditorSelectedNodeClassName, akEditorSmallZIndex, akEditorStickyHeaderZIndex, akEditorTableCellOnStickyHeaderZIndex, akEditorTableNumberColumnWidth, akEditorTableToolbarSize, akEditorUnitZIndex, getSelectionStyles, relativeFontSizeToBase16, SelectionStyle } from '@atlaskit/editor-shared-styles';
|
|
3
|
+
import { akEditorSelectedNodeClassName, akEditorSmallZIndex, akEditorStickyHeaderZIndex, akEditorTableCellOnStickyHeaderZIndex, akEditorTableNumberColumnWidth, akEditorTableToolbarSize, akEditorUnitZIndex, getSelectionStyles, MAX_BROWSER_SCROLLBAR_HEIGHT, relativeFontSizeToBase16, SelectionStyle } from '@atlaskit/editor-shared-styles';
|
|
4
4
|
import { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
|
|
5
5
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
6
|
import { B300, N0, N20A, N300, N40A, R500 } from '@atlaskit/theme/colors';
|
|
@@ -16,6 +16,7 @@ const cornerControlHeight = tableToolbarSize + 1;
|
|
|
16
16
|
its center should be aligned with the edge
|
|
17
17
|
*/
|
|
18
18
|
export const insertColumnButtonOffset = tableInsertColumnButtonSize / 2;
|
|
19
|
+
export const tableRowHeight = 44;
|
|
19
20
|
const rangeSelectionStyles = `
|
|
20
21
|
.${ClassName.NODEVIEW_WRAPPER}.${akEditorSelectedNodeClassName} table tbody tr {
|
|
21
22
|
th,td {
|
|
@@ -48,6 +49,36 @@ const sentinelStyles = `.${ClassName.TABLE_CONTAINER} {
|
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
}`;
|
|
52
|
+
const stickyScrollbarSentinelStyles = `.${ClassName.TABLE_CONTAINER} {
|
|
53
|
+
> .${ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM},
|
|
54
|
+
> .${ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP} {
|
|
55
|
+
position: absolute;
|
|
56
|
+
width: 100%;
|
|
57
|
+
height: 1px;
|
|
58
|
+
margin-top: -1px;
|
|
59
|
+
// need this to avoid sentinel being focused via keyboard
|
|
60
|
+
// this still allows it to be detected by intersection observer
|
|
61
|
+
visibility: hidden;
|
|
62
|
+
}
|
|
63
|
+
> .${ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP} {
|
|
64
|
+
top: ${columnControlsDecorationHeight + tableRowHeight * 3}px;
|
|
65
|
+
}
|
|
66
|
+
> .${ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM} {
|
|
67
|
+
bottom: ${MAX_BROWSER_SCROLLBAR_HEIGHT}px;
|
|
68
|
+
}
|
|
69
|
+
}`;
|
|
70
|
+
const stickyScrollbarContainerStyles = `.${ClassName.TABLE_CONTAINER} {
|
|
71
|
+
> .${ClassName.TABLE_STICKY_SCROLLBAR_CONTAINER} {
|
|
72
|
+
width: 100%;
|
|
73
|
+
display: none;
|
|
74
|
+
overflow-x: auto;
|
|
75
|
+
position: sticky;
|
|
76
|
+
bottom: 0;
|
|
77
|
+
}
|
|
78
|
+
}`;
|
|
79
|
+
const stickyScrollbarStyles = () => {
|
|
80
|
+
return getBooleanFF('platform.editor.table-sticky-scrollbar') ? `${stickyScrollbarContainerStyles} ${stickyScrollbarSentinelStyles}` : '';
|
|
81
|
+
};
|
|
51
82
|
const shadowSentinelStyles = `
|
|
52
83
|
.${ClassName.TABLE_SHADOW_SENTINEL_LEFT},
|
|
53
84
|
.${ClassName.TABLE_SHADOW_SENTINEL_RIGHT} {
|
|
@@ -349,6 +380,7 @@ export const tableStyles = props => {
|
|
|
349
380
|
|
|
350
381
|
${sentinelStyles}
|
|
351
382
|
${OverflowShadow(props)}
|
|
383
|
+
${stickyScrollbarStyles()}
|
|
352
384
|
|
|
353
385
|
.${ClassName.TABLE_STICKY} .${ClassName.TABLE_STICKY_SHADOW} {
|
|
354
386
|
height: 0; // stop overflow flash & set correct height in update-overflow-shadows.ts
|
|
@@ -18,7 +18,7 @@ import { createDispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
|
18
18
|
import { getParentNodeWidth } from '@atlaskit/editor-common/node-width';
|
|
19
19
|
import { tableMarginSides } from '@atlaskit/editor-common/styles';
|
|
20
20
|
import { analyticsEventKey, browser, isValidPosition } from '@atlaskit/editor-common/utils';
|
|
21
|
-
import { akEditorTableToolbarSize as tableToolbarSize } from '@atlaskit/editor-shared-styles';
|
|
21
|
+
import { MAX_BROWSER_SCROLLBAR_HEIGHT, akEditorTableToolbarSize as tableToolbarSize } from '@atlaskit/editor-shared-styles';
|
|
22
22
|
import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
23
23
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
24
24
|
import { autoSizeTable, clearHoverSelection } from '../commands';
|
|
@@ -34,6 +34,7 @@ import TableFloatingControls from '../ui/TableFloatingControls';
|
|
|
34
34
|
import { containsHeaderRow, isTableNested, tablesHaveDifferentColumnWidths, tablesHaveDifferentNoOfColumns } from '../utils';
|
|
35
35
|
import { OverflowShadowsObserver } from './OverflowShadowsObserver';
|
|
36
36
|
import { TableContainer } from './TableContainer';
|
|
37
|
+
import { TableStickyScrollbar } from './TableStickyScrollbar';
|
|
37
38
|
var isIE11 = browser.ie_version === 11;
|
|
38
39
|
// When table is inserted via paste, keyboard shortcut or quickInsert,
|
|
39
40
|
// componentDidUpdate is called multiple times. The isOverflowing value is correct only on the last update.
|
|
@@ -87,6 +88,11 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
87
88
|
if (!_this.wrapper || event.target !== _this.wrapper) {
|
|
88
89
|
return;
|
|
89
90
|
}
|
|
91
|
+
if (getBooleanFF('platform.editor.table-sticky-scrollbar')) {
|
|
92
|
+
if (_this.stickyScrollbar) {
|
|
93
|
+
_this.stickyScrollbar.scrollLeft(_this.wrapper.scrollLeft);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
90
96
|
if (_this.table) {
|
|
91
97
|
// sync sticky header row to table scroll
|
|
92
98
|
var headers = _this.table.querySelectorAll('tr[data-header-row]');
|
|
@@ -297,7 +303,14 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
297
303
|
eventDispatcher = _this$props7.eventDispatcher,
|
|
298
304
|
options = _this$props7.options;
|
|
299
305
|
if (allowColumnResizing && this.wrapper && !isIE11) {
|
|
300
|
-
this.wrapper.addEventListener('scroll', this.handleScrollDebounced
|
|
306
|
+
this.wrapper.addEventListener('scroll', this.handleScrollDebounced, {
|
|
307
|
+
passive: true
|
|
308
|
+
});
|
|
309
|
+
if (getBooleanFF('platform.editor.table-sticky-scrollbar')) {
|
|
310
|
+
if (this.table) {
|
|
311
|
+
this.stickyScrollbar = new TableStickyScrollbar(this.wrapper, this.props.view);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
301
314
|
}
|
|
302
315
|
if (allowColumnResizing) {
|
|
303
316
|
/**
|
|
@@ -329,6 +342,11 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
329
342
|
if (this.wrapper && !isIE11) {
|
|
330
343
|
this.wrapper.removeEventListener('scroll', this.handleScrollDebounced);
|
|
331
344
|
}
|
|
345
|
+
if (getBooleanFF('platform.editor.table-sticky-scrollbar')) {
|
|
346
|
+
if (this.stickyScrollbar) {
|
|
347
|
+
this.stickyScrollbar.dispose();
|
|
348
|
+
}
|
|
349
|
+
}
|
|
332
350
|
this.handleScrollDebounced.cancel();
|
|
333
351
|
this.scaleTableDebounced.cancel();
|
|
334
352
|
this.handleTableResizingDebounced.cancel();
|
|
@@ -501,6 +519,9 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
501
519
|
}, /*#__PURE__*/React.createElement("div", {
|
|
502
520
|
className: ClassName.TABLE_STICKY_SENTINEL_TOP,
|
|
503
521
|
"data-testid": "sticky-sentinel-top"
|
|
522
|
+
}), getBooleanFF('platform.editor.table-sticky-scrollbar') && /*#__PURE__*/React.createElement("div", {
|
|
523
|
+
className: ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP,
|
|
524
|
+
"data-testid": "sticky-scrollbar-sentinel-top"
|
|
504
525
|
}), allowControls && rowControls, /*#__PURE__*/React.createElement("div", {
|
|
505
526
|
style: shadowStyle(showBeforeShadow),
|
|
506
527
|
className: ClassName.TABLE_LEFT_SHADOW
|
|
@@ -523,7 +544,17 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
523
544
|
}
|
|
524
545
|
}
|
|
525
546
|
}
|
|
526
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
547
|
+
}), getBooleanFF('platform.editor.table-sticky-scrollbar') && /*#__PURE__*/React.createElement("div", {
|
|
548
|
+
className: ClassName.TABLE_STICKY_SCROLLBAR_CONTAINER,
|
|
549
|
+
style: {
|
|
550
|
+
height: MAX_BROWSER_SCROLLBAR_HEIGHT,
|
|
551
|
+
display: 'none'
|
|
552
|
+
}
|
|
553
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
554
|
+
style: {
|
|
555
|
+
width: tableRef === null || tableRef === void 0 ? void 0 : tableRef.clientWidth
|
|
556
|
+
}
|
|
557
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
527
558
|
style: shadowStyle(showAfterShadow),
|
|
528
559
|
className: ClassName.TABLE_RIGHT_SHADOW
|
|
529
560
|
}), this.state.stickyHeader && /*#__PURE__*/React.createElement("div", {
|
|
@@ -540,6 +571,9 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
540
571
|
})), /*#__PURE__*/React.createElement("div", {
|
|
541
572
|
className: ClassName.TABLE_STICKY_SENTINEL_BOTTOM,
|
|
542
573
|
"data-testid": "sticky-sentinel-bottom"
|
|
574
|
+
}), getBooleanFF('platform.editor.table-sticky-scrollbar') && /*#__PURE__*/React.createElement("div", {
|
|
575
|
+
className: ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM,
|
|
576
|
+
"data-testid": "sticky-scrollbar-sentinel-bottom"
|
|
543
577
|
}));
|
|
544
578
|
}
|
|
545
579
|
}]);
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
+
import rafSchedule from 'raf-schd';
|
|
5
|
+
import { findOverflowScrollParent } from '@atlaskit/editor-common/ui';
|
|
6
|
+
import { TableCssClassName as ClassName } from '../types';
|
|
7
|
+
export var TableStickyScrollbar = /*#__PURE__*/function () {
|
|
8
|
+
function TableStickyScrollbar(wrapper, view) {
|
|
9
|
+
var _this = this;
|
|
10
|
+
_classCallCheck(this, TableStickyScrollbar);
|
|
11
|
+
_defineProperty(this, "sentinels", {});
|
|
12
|
+
_defineProperty(this, "handleScroll", function (event) {
|
|
13
|
+
if (!_this.stickyScrollbarContainerElement || !_this.wrapper || event.target !== _this.stickyScrollbarContainerElement) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
_this.wrapper.scrollLeft = _this.stickyScrollbarContainerElement.scrollLeft;
|
|
17
|
+
});
|
|
18
|
+
_defineProperty(this, "handleScrollDebounced", rafSchedule(this.handleScroll));
|
|
19
|
+
this.wrapper = wrapper;
|
|
20
|
+
this.view = view;
|
|
21
|
+
this.init();
|
|
22
|
+
}
|
|
23
|
+
_createClass(TableStickyScrollbar, [{
|
|
24
|
+
key: "dispose",
|
|
25
|
+
value: function dispose() {
|
|
26
|
+
if (this.stickyScrollbarContainerElement) {
|
|
27
|
+
this.stickyScrollbarContainerElement.removeEventListener('scroll', this.handleScrollDebounced);
|
|
28
|
+
this.handleScrollDebounced.cancel();
|
|
29
|
+
}
|
|
30
|
+
this.deleteIntesactionObserver();
|
|
31
|
+
}
|
|
32
|
+
}, {
|
|
33
|
+
key: "scrollLeft",
|
|
34
|
+
value: function scrollLeft(left) {
|
|
35
|
+
if (this.stickyScrollbarContainerElement) {
|
|
36
|
+
this.stickyScrollbarContainerElement.scrollLeft = left;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}, {
|
|
40
|
+
key: "init",
|
|
41
|
+
value: function init() {
|
|
42
|
+
var _this$wrapper$parentE;
|
|
43
|
+
if (!this.wrapper) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
this.stickyScrollbarContainerElement = (_this$wrapper$parentE = this.wrapper.parentElement) === null || _this$wrapper$parentE === void 0 ? void 0 : _this$wrapper$parentE.querySelector(".".concat(ClassName.TABLE_STICKY_SCROLLBAR_CONTAINER));
|
|
47
|
+
if (this.stickyScrollbarContainerElement) {
|
|
48
|
+
this.stickyScrollbarContainerElement.addEventListener('scroll', this.handleScrollDebounced, {
|
|
49
|
+
passive: true
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
this.createIntersectionObserver();
|
|
53
|
+
}
|
|
54
|
+
}, {
|
|
55
|
+
key: "createIntersectionObserver",
|
|
56
|
+
value: function createIntersectionObserver() {
|
|
57
|
+
var _this2 = this,
|
|
58
|
+
_this$wrapper,
|
|
59
|
+
_this$wrapper$parentE2,
|
|
60
|
+
_this$wrapper$parentE3,
|
|
61
|
+
_this$wrapper2,
|
|
62
|
+
_this$wrapper2$parent,
|
|
63
|
+
_this$wrapper2$parent2;
|
|
64
|
+
this.editorScrollableElement = findOverflowScrollParent(this.view.dom) || window.document;
|
|
65
|
+
if (!this.editorScrollableElement || !this.wrapper) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
this.intersectionObserver = new IntersectionObserver(function (entries, _) {
|
|
69
|
+
if (!_this2.stickyScrollbarContainerElement) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
entries.forEach(function (entry) {
|
|
73
|
+
var _entry$rootBounds;
|
|
74
|
+
var target = entry.target;
|
|
75
|
+
// if the rootBounds has 0 height, e.g. confluence preview mode, we do nothing.
|
|
76
|
+
if (((_entry$rootBounds = entry.rootBounds) === null || _entry$rootBounds === void 0 ? void 0 : _entry$rootBounds.height) === 0) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (target.classList.contains(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM)) {
|
|
80
|
+
_this2.sentenialBottomCallback(entry);
|
|
81
|
+
}
|
|
82
|
+
if (target.classList.contains(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP)) {
|
|
83
|
+
_this2.sentenialTopCallback(entry);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}, {
|
|
87
|
+
root: this.editorScrollableElement
|
|
88
|
+
});
|
|
89
|
+
this.sentinels.bottom = (_this$wrapper = this.wrapper) === null || _this$wrapper === void 0 ? void 0 : (_this$wrapper$parentE2 = _this$wrapper.parentElement) === null || _this$wrapper$parentE2 === void 0 ? void 0 : (_this$wrapper$parentE3 = _this$wrapper$parentE2.getElementsByClassName(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM)) === null || _this$wrapper$parentE3 === void 0 ? void 0 : _this$wrapper$parentE3.item(0);
|
|
90
|
+
this.sentinels.top = (_this$wrapper2 = this.wrapper) === null || _this$wrapper2 === void 0 ? void 0 : (_this$wrapper2$parent = _this$wrapper2.parentElement) === null || _this$wrapper2$parent === void 0 ? void 0 : (_this$wrapper2$parent2 = _this$wrapper2$parent.getElementsByClassName(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP)) === null || _this$wrapper2$parent2 === void 0 ? void 0 : _this$wrapper2$parent2.item(0);
|
|
91
|
+
[this.sentinels.bottom, this.sentinels.top].forEach(function (el) {
|
|
92
|
+
return _this2.intersectionObserver.observe(el);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}, {
|
|
96
|
+
key: "deleteIntesactionObserver",
|
|
97
|
+
value: function deleteIntesactionObserver() {
|
|
98
|
+
if (this.intersectionObserver) {
|
|
99
|
+
if (this.sentinels.bottom) {
|
|
100
|
+
this.intersectionObserver.unobserve(this.sentinels.bottom);
|
|
101
|
+
}
|
|
102
|
+
this.intersectionObserver.disconnect();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}, {
|
|
106
|
+
key: "sentenialBottomCallback",
|
|
107
|
+
value: function sentenialBottomCallback(entry) {
|
|
108
|
+
var _entry$rootBounds2;
|
|
109
|
+
var sentinelIsAboveScrollArea = entry.boundingClientRect.top < (((_entry$rootBounds2 = entry.rootBounds) === null || _entry$rootBounds2 === void 0 ? void 0 : _entry$rootBounds2.top) || 0);
|
|
110
|
+
this.bottomSentinelState = sentinelIsAboveScrollArea ? 'above' : entry.isIntersecting ? 'visible' : 'below';
|
|
111
|
+
this.toggle();
|
|
112
|
+
}
|
|
113
|
+
}, {
|
|
114
|
+
key: "sentenialTopCallback",
|
|
115
|
+
value: function sentenialTopCallback(entry) {
|
|
116
|
+
var _entry$rootBounds3;
|
|
117
|
+
var sentinelIsBelowScrollArea = (((_entry$rootBounds3 = entry.rootBounds) === null || _entry$rootBounds3 === void 0 ? void 0 : _entry$rootBounds3.bottom) || 0) < entry.boundingClientRect.top;
|
|
118
|
+
this.topSentinelState = sentinelIsBelowScrollArea ? 'below' : entry.isIntersecting ? 'visible' : 'above';
|
|
119
|
+
this.toggle();
|
|
120
|
+
}
|
|
121
|
+
}, {
|
|
122
|
+
key: "toggle",
|
|
123
|
+
value: function toggle() {
|
|
124
|
+
if ((this.topSentinelState === 'visible' || this.topSentinelState === 'above') && this.bottomSentinelState === 'below') {
|
|
125
|
+
this.show();
|
|
126
|
+
} else {
|
|
127
|
+
this.hide();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}, {
|
|
131
|
+
key: "hide",
|
|
132
|
+
value: function hide() {
|
|
133
|
+
if (this.stickyScrollbarContainerElement && this.stickyScrollbarContainerElement.style.display !== 'none') {
|
|
134
|
+
this.stickyScrollbarContainerElement.style.display = 'none';
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}, {
|
|
138
|
+
key: "show",
|
|
139
|
+
value: function show() {
|
|
140
|
+
if (this.stickyScrollbarContainerElement && this.stickyScrollbarContainerElement.style.display !== 'block') {
|
|
141
|
+
this.stickyScrollbarContainerElement.style.display = 'block';
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}]);
|
|
145
|
+
return TableStickyScrollbar;
|
|
146
|
+
}();
|
|
@@ -12,6 +12,7 @@ import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
|
12
12
|
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
13
13
|
import { findCellRectClosestToPos, findTable, getSelectionRect, isSelectionType, splitCell } from '@atlaskit/editor-tables/utils';
|
|
14
14
|
import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
15
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
15
16
|
import { clearHoverSelection, hoverColumns, hoverMergedCells, hoverRows, hoverTable, removeDescendantNodes } from './commands';
|
|
16
17
|
import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics, deleteTableWithAnalytics, distributeColumnsWidthsWithAnalytics, emptyMultipleCellsWithAnalytics, insertColumnWithAnalytics, insertRowWithAnalytics, mergeCellsWithAnalytics, setColorWithAnalytics, sortColumnWithAnalytics, splitCellWithAnalytics, toggleHeaderColumnWithAnalytics, toggleHeaderRowWithAnalytics, toggleNumberColumnWithAnalytics, wrapTableInExpandWithAnalytics } from './commands-with-analytics';
|
|
17
18
|
import { getPluginState } from './pm-plugins/plugin-factory';
|
|
@@ -343,6 +344,11 @@ export var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth,
|
|
|
343
344
|
getDomRef: getDomRef,
|
|
344
345
|
nodeType: nodeType,
|
|
345
346
|
offset: [0, 18],
|
|
347
|
+
absoluteOffset: getBooleanFF('platform.editor.table-sticky-scrollbar') ? {
|
|
348
|
+
top: -6
|
|
349
|
+
} : {
|
|
350
|
+
top: 0
|
|
351
|
+
},
|
|
346
352
|
zIndex: akEditorFloatingPanelZIndex + 1,
|
|
347
353
|
// Place the context menu slightly above the others
|
|
348
354
|
items: [menu, separator(menu.hidden)].concat(cellItems, colorPicker, [{
|
|
@@ -2,7 +2,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { tableMarginTop, tableSharedStyle } from '@atlaskit/editor-common/styles';
|
|
5
|
-
import { akEditorSelectedNodeClassName, akEditorSmallZIndex, akEditorStickyHeaderZIndex, akEditorTableCellOnStickyHeaderZIndex, akEditorTableNumberColumnWidth, akEditorTableToolbarSize, akEditorUnitZIndex, getSelectionStyles, relativeFontSizeToBase16, SelectionStyle } from '@atlaskit/editor-shared-styles';
|
|
5
|
+
import { akEditorSelectedNodeClassName, akEditorSmallZIndex, akEditorStickyHeaderZIndex, akEditorTableCellOnStickyHeaderZIndex, akEditorTableNumberColumnWidth, akEditorTableToolbarSize, akEditorUnitZIndex, getSelectionStyles, MAX_BROWSER_SCROLLBAR_HEIGHT, relativeFontSizeToBase16, SelectionStyle } from '@atlaskit/editor-shared-styles';
|
|
6
6
|
import { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
|
|
7
7
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
8
8
|
import { B300, N0, N20A, N300, N40A, R500 } from '@atlaskit/theme/colors';
|
|
@@ -18,8 +18,14 @@ var cornerControlHeight = tableToolbarSize + 1;
|
|
|
18
18
|
its center should be aligned with the edge
|
|
19
19
|
*/
|
|
20
20
|
export var insertColumnButtonOffset = tableInsertColumnButtonSize / 2;
|
|
21
|
+
export var tableRowHeight = 44;
|
|
21
22
|
var rangeSelectionStyles = "\n.".concat(ClassName.NODEVIEW_WRAPPER, ".").concat(akEditorSelectedNodeClassName, " table tbody tr {\n th,td {\n ").concat(getSelectionStyles([SelectionStyle.Blanket, SelectionStyle.Border]), "\n }\n}\n");
|
|
22
23
|
var sentinelStyles = ".".concat(ClassName.TABLE_CONTAINER, " {\n > .").concat(ClassName.TABLE_STICKY_SENTINEL_TOP, ", > .").concat(ClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n position: absolute;\n width: 100%;\n height: 1px;\n margin-top: -1px;\n // need this to avoid sentinel being focused via keyboard\n // this still allows it to be detected by intersection observer\n visibility: hidden;\n }\n > .").concat(ClassName.TABLE_STICKY_SENTINEL_TOP, " {\n top: ").concat(columnControlsDecorationHeight, "px;\n }\n > .").concat(ClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n bottom: ").concat(tableScrollbarOffset + stickyRowOffsetTop + tablePadding * 2 + 23, "px;\n }\n &.").concat(ClassName.WITH_CONTROLS, " {\n > .").concat(ClassName.TABLE_STICKY_SENTINEL_TOP, " {\n top: 0px;\n }\n > .").concat(ClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n margin-bottom: ").concat(columnControlsDecorationHeight, "px;\n }\n }\n}");
|
|
24
|
+
var stickyScrollbarSentinelStyles = ".".concat(ClassName.TABLE_CONTAINER, " {\n > .").concat(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM, ",\n > .").concat(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP, " {\n position: absolute;\n width: 100%;\n height: 1px;\n margin-top: -1px;\n // need this to avoid sentinel being focused via keyboard\n // this still allows it to be detected by intersection observer\n visibility: hidden;\n }\n > .").concat(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP, " {\n top: ").concat(columnControlsDecorationHeight + tableRowHeight * 3, "px;\n }\n > .").concat(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM, " {\n bottom: ").concat(MAX_BROWSER_SCROLLBAR_HEIGHT, "px;\n }\n}");
|
|
25
|
+
var stickyScrollbarContainerStyles = ".".concat(ClassName.TABLE_CONTAINER, " {\n > .").concat(ClassName.TABLE_STICKY_SCROLLBAR_CONTAINER, " {\n width: 100%;\n display: none;\n overflow-x: auto;\n position: sticky;\n bottom: 0;\n }\n}");
|
|
26
|
+
var stickyScrollbarStyles = function stickyScrollbarStyles() {
|
|
27
|
+
return getBooleanFF('platform.editor.table-sticky-scrollbar') ? "".concat(stickyScrollbarContainerStyles, " ").concat(stickyScrollbarSentinelStyles) : '';
|
|
28
|
+
};
|
|
23
29
|
var shadowSentinelStyles = "\n .".concat(ClassName.TABLE_SHADOW_SENTINEL_LEFT, ",\n .").concat(ClassName.TABLE_SHADOW_SENTINEL_RIGHT, " {\n position: absolute;\n top: 0;\n height: 100%;\n width: 1px;\n visibility: hidden;\n }\n .").concat(ClassName.TABLE_SHADOW_SENTINEL_LEFT, " {\n left: 0;\n }\n .").concat(ClassName.TABLE_SHADOW_SENTINEL_RIGHT, " {\n right: 0;\n }\n");
|
|
24
30
|
// previous styles to add spacing to numbered lists with
|
|
25
31
|
// large item markers (e.g. 101, 102, ...) when nested inside tables
|
|
@@ -38,7 +44,7 @@ var tableWrapperStyles = function tableWrapperStyles() {
|
|
|
38
44
|
// TODO: https://product-fabric.atlassian.net/browse/DSP-4139
|
|
39
45
|
export var tableStyles = function tableStyles(props) {
|
|
40
46
|
var _props$featureFlags;
|
|
41
|
-
return css(_templateObject4 || (_templateObject4 = _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 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 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 /* 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: ", "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 .", " {\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"])), 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), hoveredWarningCell, 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), 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, ClassName.TABLE_STICKY, ClassName.COLUMN_CONTROLS_DECORATIONS, 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), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tablePadding, ClassName.ROW_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), 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.IS_RESIZING, ClassName.ROW_CONTROLS, HeaderButtonHover(props), HeaderButtonDanger(props), ClassName.NUMBERED_COLUMN, getBooleanFF('platform.editor.custom-table-width') ? akEditorTableToolbarSize : akEditorTableToolbarSize - 1, akEditorTableToolbarSize, akEditorTableNumberColumnWidth + 1, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderColor(props), relativeFontSizeToBase16(fontSize()), tableHeaderCellBackgroundColor(props), tableTextColor(props), tableBorderColor(props), tableBorderColor(props), 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, 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, tableBorderDeleteColor(props), akEditorUnitZIndex * 100, ClassName.ROW_CONTROLS_WRAPPER, tableMarginTop - cornerControlHeight + 1, ClassName.ROW_CONTROLS_WRAPPER, ClassName.TABLE_LEFT_SHADOW, akEditorUnitZIndex, ClassName.ROW_CONTROLS_WRAPPER, tableToolbarSize, 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);
|
|
47
|
+
return css(_templateObject4 || (_templateObject4 = _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 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 .", " .", " {\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 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 /* 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: ", "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 .", " {\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"])), 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), hoveredWarningCell, 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), 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, ClassName.TABLE_STICKY, ClassName.COLUMN_CONTROLS_DECORATIONS, 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.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), 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.IS_RESIZING, ClassName.ROW_CONTROLS, HeaderButtonHover(props), HeaderButtonDanger(props), ClassName.NUMBERED_COLUMN, getBooleanFF('platform.editor.custom-table-width') ? akEditorTableToolbarSize : akEditorTableToolbarSize - 1, akEditorTableToolbarSize, akEditorTableNumberColumnWidth + 1, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderColor(props), relativeFontSizeToBase16(fontSize()), tableHeaderCellBackgroundColor(props), tableTextColor(props), tableBorderColor(props), tableBorderColor(props), 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, 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, tableBorderDeleteColor(props), akEditorUnitZIndex * 100, ClassName.ROW_CONTROLS_WRAPPER, tableMarginTop - cornerControlHeight + 1, ClassName.ROW_CONTROLS_WRAPPER, ClassName.TABLE_LEFT_SHADOW, akEditorUnitZIndex, ClassName.ROW_CONTROLS_WRAPPER, tableToolbarSize, 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);
|
|
42
48
|
};
|
|
43
49
|
export var tableFullPageEditorStyles = css(_templateObject5 || (_templateObject5 = _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);
|
|
44
50
|
export var tableCommentEditorStyles = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n .ProseMirror .", " > table {\n margin-left: 0;\n margin-right: 0;\n ", ";\n }\n"])), ClassName.TABLE_NODE_WRAPPER, scrollbarStyles);
|
|
@@ -43,6 +43,7 @@ declare class TableComponent extends React.Component<ComponentProps, TableState>
|
|
|
43
43
|
private containerWidth?;
|
|
44
44
|
private layoutSize?;
|
|
45
45
|
private overflowShadowsObserver?;
|
|
46
|
+
private stickyScrollbar?;
|
|
46
47
|
private isInitialOverflowSent;
|
|
47
48
|
private initialOverflowCaptureTimerId?;
|
|
48
49
|
constructor(props: ComponentProps);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
+
export declare class TableStickyScrollbar {
|
|
3
|
+
private wrapper;
|
|
4
|
+
private view;
|
|
5
|
+
private editorScrollableElement?;
|
|
6
|
+
private intersectionObserver?;
|
|
7
|
+
private stickyScrollbarContainerElement?;
|
|
8
|
+
private sentinels;
|
|
9
|
+
private topSentinelState?;
|
|
10
|
+
private bottomSentinelState?;
|
|
11
|
+
constructor(wrapper: HTMLDivElement, view: EditorView);
|
|
12
|
+
dispose(): void;
|
|
13
|
+
scrollLeft(left: number): void;
|
|
14
|
+
private init;
|
|
15
|
+
private createIntersectionObserver;
|
|
16
|
+
private deleteIntesactionObserver;
|
|
17
|
+
private sentenialBottomCallback;
|
|
18
|
+
private sentenialTopCallback;
|
|
19
|
+
private toggle;
|
|
20
|
+
private hide;
|
|
21
|
+
private show;
|
|
22
|
+
private handleScroll;
|
|
23
|
+
private handleScrollDebounced;
|
|
24
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { Command, FloatingToolbarDropdown, FloatingToolbarHandler, FloatingToolbarItem, GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
|
-
import { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
import { Rect } from '@atlaskit/editor-tables/table-map';
|
|
6
|
-
import { PluginConfig, ToolbarMenuConfig, ToolbarMenuContext, ToolbarMenuState } from './types';
|
|
3
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
+
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
6
|
+
import type { PluginConfig, ToolbarMenuConfig, ToolbarMenuContext, ToolbarMenuState } from './types';
|
|
7
7
|
export declare const messages: {
|
|
8
8
|
tableOptions: {
|
|
9
9
|
id: string;
|
|
@@ -295,8 +295,11 @@ export declare const TableCssClassName: {
|
|
|
295
295
|
TABLE_RIGHT_SHADOW: string;
|
|
296
296
|
TABLE_STICKY_SHADOW: string;
|
|
297
297
|
TABLE_STICKY_WRAPPER: string;
|
|
298
|
+
TABLE_STICKY_SCROLLBAR_CONTAINER: string;
|
|
298
299
|
TABLE_STICKY_SENTINEL_TOP: string;
|
|
299
300
|
TABLE_STICKY_SENTINEL_BOTTOM: string;
|
|
301
|
+
TABLE_STICKY_SCROLLBAR_SENTINEL_TOP: string;
|
|
302
|
+
TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM: string;
|
|
300
303
|
TABLE_SHADOW_SENTINEL_LEFT: string;
|
|
301
304
|
TABLE_SHADOW_SENTINEL_RIGHT: string;
|
|
302
305
|
TABLE_CELL_NODEVIEW_CONTENT_DOM: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { ThemeProps } from '@atlaskit/theme/types';
|
|
3
3
|
export declare const insertColumnButtonOffset: number;
|
|
4
|
+
export declare const tableRowHeight = 44;
|
|
4
5
|
export declare const tableStyles: (props: ThemeProps & {
|
|
5
6
|
featureFlags?: FeatureFlags;
|
|
6
7
|
}) => import("@emotion/react").SerializedStyles;
|
|
@@ -43,6 +43,7 @@ declare class TableComponent extends React.Component<ComponentProps, TableState>
|
|
|
43
43
|
private containerWidth?;
|
|
44
44
|
private layoutSize?;
|
|
45
45
|
private overflowShadowsObserver?;
|
|
46
|
+
private stickyScrollbar?;
|
|
46
47
|
private isInitialOverflowSent;
|
|
47
48
|
private initialOverflowCaptureTimerId?;
|
|
48
49
|
constructor(props: ComponentProps);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
+
export declare class TableStickyScrollbar {
|
|
3
|
+
private wrapper;
|
|
4
|
+
private view;
|
|
5
|
+
private editorScrollableElement?;
|
|
6
|
+
private intersectionObserver?;
|
|
7
|
+
private stickyScrollbarContainerElement?;
|
|
8
|
+
private sentinels;
|
|
9
|
+
private topSentinelState?;
|
|
10
|
+
private bottomSentinelState?;
|
|
11
|
+
constructor(wrapper: HTMLDivElement, view: EditorView);
|
|
12
|
+
dispose(): void;
|
|
13
|
+
scrollLeft(left: number): void;
|
|
14
|
+
private init;
|
|
15
|
+
private createIntersectionObserver;
|
|
16
|
+
private deleteIntesactionObserver;
|
|
17
|
+
private sentenialBottomCallback;
|
|
18
|
+
private sentenialTopCallback;
|
|
19
|
+
private toggle;
|
|
20
|
+
private hide;
|
|
21
|
+
private show;
|
|
22
|
+
private handleScroll;
|
|
23
|
+
private handleScrollDebounced;
|
|
24
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { Command, FloatingToolbarDropdown, FloatingToolbarHandler, FloatingToolbarItem, GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
|
-
import { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
import { Rect } from '@atlaskit/editor-tables/table-map';
|
|
6
|
-
import { PluginConfig, ToolbarMenuConfig, ToolbarMenuContext, ToolbarMenuState } from './types';
|
|
3
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
+
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
6
|
+
import type { PluginConfig, ToolbarMenuConfig, ToolbarMenuContext, ToolbarMenuState } from './types';
|
|
7
7
|
export declare const messages: {
|
|
8
8
|
tableOptions: {
|
|
9
9
|
id: string;
|
|
@@ -295,8 +295,11 @@ export declare const TableCssClassName: {
|
|
|
295
295
|
TABLE_RIGHT_SHADOW: string;
|
|
296
296
|
TABLE_STICKY_SHADOW: string;
|
|
297
297
|
TABLE_STICKY_WRAPPER: string;
|
|
298
|
+
TABLE_STICKY_SCROLLBAR_CONTAINER: string;
|
|
298
299
|
TABLE_STICKY_SENTINEL_TOP: string;
|
|
299
300
|
TABLE_STICKY_SENTINEL_BOTTOM: string;
|
|
301
|
+
TABLE_STICKY_SCROLLBAR_SENTINEL_TOP: string;
|
|
302
|
+
TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM: string;
|
|
300
303
|
TABLE_SHADOW_SENTINEL_LEFT: string;
|
|
301
304
|
TABLE_SHADOW_SENTINEL_RIGHT: string;
|
|
302
305
|
TABLE_CELL_NODEVIEW_CONTENT_DOM: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { ThemeProps } from '@atlaskit/theme/types';
|
|
3
3
|
export declare const insertColumnButtonOffset: number;
|
|
4
|
+
export declare const tableRowHeight = 44;
|
|
4
5
|
export declare const tableStyles: (props: ThemeProps & {
|
|
5
6
|
featureFlags?: FeatureFlags;
|
|
6
7
|
}) => import("@emotion/react").SerializedStyles;
|