@atlaskit/editor-plugin-table 5.3.10 → 5.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +3 -2
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/commands.js +5 -2
- package/dist/cjs/plugins/table/ui/DragHandle/index.js +11 -25
- package/dist/cjs/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.js +56 -20
- package/dist/cjs/plugins/table/ui/TableFloatingColumnControls/index.js +3 -1
- package/dist/cjs/plugins/table/ui/TableFloatingControls/NumberColumn/index.js +15 -27
- package/dist/cjs/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +68 -18
- package/dist/cjs/plugins/table/ui/TableFloatingControls/index.js +47 -29
- package/dist/cjs/plugins/table/ui/common-styles.js +2 -2
- package/dist/cjs/plugins/table/ui/icons/DragHandleIcon.js +11 -52
- package/dist/es2019/plugins/table/nodeviews/TableComponent.js +3 -2
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/commands.js +6 -3
- package/dist/es2019/plugins/table/ui/DragHandle/index.js +10 -24
- package/dist/es2019/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.js +57 -15
- package/dist/es2019/plugins/table/ui/TableFloatingColumnControls/index.js +3 -1
- package/dist/es2019/plugins/table/ui/TableFloatingControls/NumberColumn/index.js +4 -20
- package/dist/es2019/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +69 -17
- package/dist/es2019/plugins/table/ui/TableFloatingControls/index.js +24 -2
- package/dist/es2019/plugins/table/ui/common-styles.js +64 -4
- package/dist/es2019/plugins/table/ui/icons/DragHandleIcon.js +11 -52
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +3 -2
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/commands.js +6 -3
- package/dist/esm/plugins/table/ui/DragHandle/index.js +11 -25
- package/dist/esm/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.js +53 -19
- package/dist/esm/plugins/table/ui/TableFloatingColumnControls/index.js +3 -1
- package/dist/esm/plugins/table/ui/TableFloatingControls/NumberColumn/index.js +16 -28
- package/dist/esm/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +67 -19
- package/dist/esm/plugins/table/ui/TableFloatingControls/index.js +48 -30
- package/dist/esm/plugins/table/ui/common-styles.js +2 -2
- package/dist/esm/plugins/table/ui/icons/DragHandleIcon.js +11 -51
- package/dist/types/plugins/table/ui/DragHandle/index.d.ts +3 -3
- package/dist/types/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +4 -3
- package/dist/types/plugins/table/ui/TableFloatingColumnControls/index.d.ts +1 -0
- package/dist/types/plugins/table/ui/TableFloatingControls/NumberColumn/index.d.ts +1 -1
- package/dist/types/plugins/table/ui/TableFloatingControls/RowControls/DragControls.d.ts +4 -2
- package/dist/types/plugins/table/ui/TableFloatingControls/index.d.ts +1 -0
- package/dist/types/plugins/table/ui/icons/DragHandleIcon.d.ts +1 -6
- package/dist/types-ts4.5/plugins/table/ui/DragHandle/index.d.ts +3 -3
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +4 -3
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingColumnControls/index.d.ts +1 -0
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/NumberColumn/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/RowControls/DragControls.d.ts +4 -2
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/index.d.ts +1 -0
- package/dist/types-ts4.5/plugins/table/ui/icons/DragHandleIcon.d.ts +1 -6
- package/package.json +2 -2
- package/src/__tests__/unit/ui/NumberColumn.tsx +5 -8
- package/src/__tests__/unit/ui/RowDragControls.tsx +6 -0
- package/src/plugins/table/nodeviews/TableComponent.tsx +3 -2
- package/src/plugins/table/pm-plugins/drag-and-drop/commands.ts +11 -3
- package/src/plugins/table/ui/DragHandle/index.tsx +10 -26
- package/src/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.tsx +69 -23
- package/src/plugins/table/ui/TableFloatingColumnControls/index.tsx +3 -0
- package/src/plugins/table/ui/TableFloatingControls/NumberColumn/index.tsx +10 -15
- package/src/plugins/table/ui/TableFloatingControls/RowControls/DragControls.tsx +95 -26
- package/src/plugins/table/ui/TableFloatingControls/index.tsx +17 -1
- package/src/plugins/table/ui/common-styles.ts +67 -4
- package/src/plugins/table/ui/icons/DragHandleIcon.tsx +5 -69
|
@@ -12,7 +12,8 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
12
12
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
13
|
import React, { Component } from 'react';
|
|
14
14
|
import { browser } from '@atlaskit/editor-common/utils';
|
|
15
|
-
import { hoverRows, selectRow } from '../../commands';
|
|
15
|
+
import { hoverCell, hoverRows, selectRow } from '../../commands';
|
|
16
|
+
import { getPluginState } from '../../pm-plugins/plugin-factory';
|
|
16
17
|
import { isSelectionUpdated } from '../../utils';
|
|
17
18
|
import { CornerControls } from './CornerControls';
|
|
18
19
|
import NumberColumn from './NumberColumn';
|
|
@@ -43,6 +44,19 @@ var TableFloatingControls = /*#__PURE__*/function (_Component) {
|
|
|
43
44
|
dispatch = _this$props$editorVie.dispatch;
|
|
44
45
|
hoverRows(rows, danger)(state, dispatch);
|
|
45
46
|
});
|
|
47
|
+
// re-use across numbered columns and row controls
|
|
48
|
+
_defineProperty(_assertThisInitialized(_this), "updateCellHoverLocation", function (rowIndex) {
|
|
49
|
+
var _this$props = _this.props,
|
|
50
|
+
editorView = _this$props.editorView,
|
|
51
|
+
tableActive = _this$props.tableActive;
|
|
52
|
+
var state = editorView.state,
|
|
53
|
+
dispatch = editorView.dispatch;
|
|
54
|
+
var _getPluginState = getPluginState(state),
|
|
55
|
+
hoveredCell = _getPluginState.hoveredCell;
|
|
56
|
+
if (tableActive && hoveredCell.rowIndex !== rowIndex) {
|
|
57
|
+
hoverCell(rowIndex, hoveredCell.colIndex)(state, dispatch);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
46
60
|
return _this;
|
|
47
61
|
}
|
|
48
62
|
_createClass(TableFloatingControls, [{
|
|
@@ -89,20 +103,20 @@ var TableFloatingControls = /*#__PURE__*/function (_Component) {
|
|
|
89
103
|
key: "shouldComponentUpdate",
|
|
90
104
|
value: function shouldComponentUpdate(nextProps, nextState) {
|
|
91
105
|
var _this$state;
|
|
92
|
-
var _this$
|
|
93
|
-
tableRef = _this$
|
|
94
|
-
isInDanger = _this$
|
|
95
|
-
isResizing = _this$
|
|
96
|
-
isHeaderRowEnabled = _this$
|
|
97
|
-
isNumberColumnEnabled = _this$
|
|
98
|
-
hoveredRows = _this$
|
|
99
|
-
selection = _this$
|
|
100
|
-
tableActive = _this$
|
|
101
|
-
isHeaderColumnEnabled = _this$
|
|
102
|
-
ordering = _this$
|
|
103
|
-
headerRowHeight = _this$
|
|
104
|
-
stickyHeader = _this$
|
|
105
|
-
hoveredCell = _this$
|
|
106
|
+
var _this$props2 = this.props,
|
|
107
|
+
tableRef = _this$props2.tableRef,
|
|
108
|
+
isInDanger = _this$props2.isInDanger,
|
|
109
|
+
isResizing = _this$props2.isResizing,
|
|
110
|
+
isHeaderRowEnabled = _this$props2.isHeaderRowEnabled,
|
|
111
|
+
isNumberColumnEnabled = _this$props2.isNumberColumnEnabled,
|
|
112
|
+
hoveredRows = _this$props2.hoveredRows,
|
|
113
|
+
selection = _this$props2.selection,
|
|
114
|
+
tableActive = _this$props2.tableActive,
|
|
115
|
+
isHeaderColumnEnabled = _this$props2.isHeaderColumnEnabled,
|
|
116
|
+
ordering = _this$props2.ordering,
|
|
117
|
+
headerRowHeight = _this$props2.headerRowHeight,
|
|
118
|
+
stickyHeader = _this$props2.stickyHeader,
|
|
119
|
+
hoveredCell = _this$props2.hoveredCell;
|
|
106
120
|
var tableHeight = (_this$state = this.state) === null || _this$state === void 0 ? void 0 : _this$state.tableHeight;
|
|
107
121
|
var nextTableHeight = nextState === null || nextState === void 0 ? void 0 : nextState.tableHeight;
|
|
108
122
|
return ordering !== nextProps.ordering || tableRef !== nextProps.tableRef || tableHeight !== nextTableHeight || tableActive !== nextProps.tableActive || isInDanger !== nextProps.isInDanger || isResizing !== nextProps.isResizing || hoveredRows !== nextProps.hoveredRows || isHeaderRowEnabled !== nextProps.isHeaderRowEnabled || isHeaderColumnEnabled !== nextProps.isHeaderColumnEnabled || isNumberColumnEnabled !== nextProps.isNumberColumnEnabled || isSelectionUpdated(selection, nextProps.selection) || headerRowHeight !== nextProps.headerRowHeight || stickyHeader !== nextProps.stickyHeader || hoveredCell !== nextProps.hoveredCell;
|
|
@@ -117,20 +131,20 @@ var TableFloatingControls = /*#__PURE__*/function (_Component) {
|
|
|
117
131
|
}, {
|
|
118
132
|
key: "render",
|
|
119
133
|
value: function render() {
|
|
120
|
-
var _this$
|
|
121
|
-
editorView = _this$
|
|
122
|
-
tableRef = _this$
|
|
123
|
-
isInDanger = _this$
|
|
124
|
-
isResizing = _this$
|
|
125
|
-
isNumberColumnEnabled = _this$
|
|
126
|
-
isHeaderRowEnabled = _this$
|
|
127
|
-
isHeaderColumnEnabled = _this$
|
|
128
|
-
tableActive = _this$
|
|
129
|
-
hasHeaderRow = _this$
|
|
130
|
-
hoveredRows = _this$
|
|
131
|
-
stickyHeader = _this$
|
|
132
|
-
isDragAndDropEnabled = _this$
|
|
133
|
-
hoveredCell = _this$
|
|
134
|
+
var _this$props3 = this.props,
|
|
135
|
+
editorView = _this$props3.editorView,
|
|
136
|
+
tableRef = _this$props3.tableRef,
|
|
137
|
+
isInDanger = _this$props3.isInDanger,
|
|
138
|
+
isResizing = _this$props3.isResizing,
|
|
139
|
+
isNumberColumnEnabled = _this$props3.isNumberColumnEnabled,
|
|
140
|
+
isHeaderRowEnabled = _this$props3.isHeaderRowEnabled,
|
|
141
|
+
isHeaderColumnEnabled = _this$props3.isHeaderColumnEnabled,
|
|
142
|
+
tableActive = _this$props3.tableActive,
|
|
143
|
+
hasHeaderRow = _this$props3.hasHeaderRow,
|
|
144
|
+
hoveredRows = _this$props3.hoveredRows,
|
|
145
|
+
stickyHeader = _this$props3.stickyHeader,
|
|
146
|
+
isDragAndDropEnabled = _this$props3.isDragAndDropEnabled,
|
|
147
|
+
hoveredCell = _this$props3.hoveredCell;
|
|
134
148
|
if (!tableRef) {
|
|
135
149
|
return null;
|
|
136
150
|
}
|
|
@@ -149,14 +163,18 @@ var TableFloatingControls = /*#__PURE__*/function (_Component) {
|
|
|
149
163
|
isInDanger: isInDanger,
|
|
150
164
|
isResizing: isResizing,
|
|
151
165
|
selectRow: this.selectRow,
|
|
166
|
+
updateCellHoverLocation: this.updateCellHoverLocation,
|
|
152
167
|
stickyTop: stickyTop,
|
|
153
168
|
isDragAndDropEnabled: isDragAndDropEnabled
|
|
154
169
|
}) : null, tableActive && /*#__PURE__*/React.createElement(React.Fragment, null, isDragAndDropEnabled ? /*#__PURE__*/React.createElement(DragControls, {
|
|
155
170
|
tableRef: tableRef,
|
|
156
171
|
hoveredCell: hoveredCell,
|
|
157
172
|
editorView: editorView,
|
|
173
|
+
tableActive: tableActive,
|
|
174
|
+
isInDanger: isInDanger,
|
|
158
175
|
hoverRows: this.hoverRows,
|
|
159
|
-
selectRow: this.selectRow
|
|
176
|
+
selectRow: this.selectRow,
|
|
177
|
+
updateCellHoverLocation: this.updateCellHoverLocation
|
|
160
178
|
}) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CornerControls, {
|
|
161
179
|
editorView: editorView,
|
|
162
180
|
tableRef: tableRef,
|
|
@@ -48,7 +48,7 @@ var tableStickyHeaderColumnControlsDecorationsStyle = function tableStickyHeader
|
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
var tableRowControlStyles = function tableRowControlStyles() {
|
|
51
|
-
return getBooleanFF('platform.editor.table.drag-and-drop') ? css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n .", " {\n position: absolute;\n margin-top: ", "px;\n left: -", "px;\n z-index: ", ";\n }\n "])), ClassName.ROW_CONTROLS_WRAPPER, tableMarginTop, tableToolbarSize + 1, rowControlsZIndex) : css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\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 left: -", "px;\n }\n "])), ClassName.ROW_CONTROLS_WRAPPER, tableMarginTop - cornerControlHeight + 1, tableToolbarSize);
|
|
51
|
+
return getBooleanFF('platform.editor.table.drag-and-drop') ? css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n .", " {\n position: absolute;\n margin-top: ", "px;\n left: -", "px;\n z-index: ", ";\n }\n "])), ClassName.ROW_CONTROLS_WRAPPER, tableMarginTop, tableToolbarSize + 1, rowControlsZIndex + 4) : css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\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 left: -", "px;\n }\n "])), ClassName.ROW_CONTROLS_WRAPPER, tableMarginTop - cornerControlHeight + 1, tableToolbarSize);
|
|
52
52
|
};
|
|
53
53
|
var tableWrapperStyles = function tableWrapperStyles() {
|
|
54
54
|
if (getBooleanFF('platform.editor.custom-table-width')) {
|
|
@@ -61,7 +61,7 @@ var tableWrapperStyles = function tableWrapperStyles() {
|
|
|
61
61
|
// TODO: https://product-fabric.atlassian.net/browse/DSP-4139
|
|
62
62
|
export var tableStyles = function tableStyles(props) {
|
|
63
63
|
var _props$featureFlags;
|
|
64
|
-
return css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n .", " button {\n background: ", ";\n color: ", ";\n cursor: none;\n }\n\n .", ":not(.", ") button:hover {\n background: ", ";\n color: ", " !important;\n cursor: pointer;\n }\n\n .ProseMirror {\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n\n .", " {\n 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\n .", "\n .", "\n .", ".sticky {\n position: fixed !important;\n z-index: ", " !important;\n display: flex;\n border-left: ", "px solid\n ", ";\n margin-left: -", "px;\n }\n\n .", " col:first-of-type {\n /* moving rows out of a table layout does weird things in Chrome */\n border-right: 1px solid ", ";\n }\n\n tr.sticky {\n padding-top: ", "px;\n position: fixed;\n display: grid;\n\n /* to keep it above cell selection but below date and other nodes popups that are inside sticky header */\n z-index: ", ";\n\n overflow-y: visible;\n overflow-x: hidden;\n\n grid-auto-flow: column;\n\n /* background for where controls apply */\n background: ", ";\n box-sizing: content-box;\n\n margin-top: 2px;\n\n box-shadow: 0 6px 4px -4px ", ";\n margin-left: -1px;\n\n &.no-pointer-events {\n pointer-events: none;\n }\n }\n\n .", " .", " {\n left: unset;\n position: fixed;\n /* needs to be above sticky header row and below date and other nodes popups that are inside sticky header */\n z-index: ", ";\n }\n\n .", ".", "\n .", " {\n padding-bottom: ", "px;\n }\n\n tr.sticky th {\n border-bottom: ", "px solid\n ", ";\n margin-right: -1px;\n }\n\n .", " tr.sticky > th:last-child {\n border-right-width: 1px;\n }\n\n /* add left edge for first cell */\n .", " tr.sticky > th:first-of-type {\n margin-left: 0px;\n }\n\n /* add a little bit so the scroll lines up with the table */\n .", " tr.sticky::after {\n content: ' ';\n width: ", "px;\n }\n\n /* To fix jumpiness caused in Chrome Browsers for sticky headers */\n .", " .sticky + tr {\n min-height: 0px;\n }\n\n /* move resize line a little in sticky bar */\n .", ".", " {\n tr.sticky\n td.", ",\n tr.sticky\n th.", " {\n .", "::after {\n right: ", "px;\n }\n }\n\n /* when selected put it back to normal -- :not selector would be nicer */\n tr.sticky\n td.", ".", ",\n tr.sticky\n th.", ".", " {\n .", "::after {\n right: ", "px;\n }\n }\n }\n\n tr.sticky\n .", ",\n tr.sticky\n .", " {\n z-index: 1;\n }\n\n .", " tr.sticky {\n padding-top: ", "px;\n }\n\n .", ".", "\n .", "\n .", ":first-of-type {\n margin-top: ", "px;\n }\n\n .", ".sticky {\n border-top: ", "px solid\n ", ";\n }\n\n ", "\n ", "\n ", "\n\n .", " .", " {\n height: 0; // stop overflow flash & set correct height in update-overflow-shadows.ts\n }\n\n .less-padding {\n padding: 0 ", "px;\n\n .", " {\n padding: 0 ", "px;\n\n // https://product-fabric.atlassian.net/browse/ED-16386\n // Fixes issue where the extra padding that is added here throws off the position\n // of the rows control dot\n &::after {\n right: 6px !important;\n }\n }\n\n .", " {\n padding: 0 ", "px;\n }\n\n &.", "[data-number-column='true'] {\n padding-left: ", "px;\n }\n .", ", .", " {\n width: ", "px;\n }\n\n .", " {\n left: 6px;\n }\n\n .", " {\n left: calc(100% - 6px);\n }\n }\n\n > .", " {\n /**\n * Prevent margins collapsing, aids with placing the gap-cursor correctly\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing\n *\n * TODO: Enable this, many tests will fail!\n * border-top: 1px solid transparent;\n */\n }\n\n /* Breakout only works on top level unless wrapped in fragment mark */\n ", "\n\n ", ";\n ", ";\n\n /* Corner controls */\n .", " {\n width: ", "px;\n height: ", "px;\n display: none;\n\n .", " {\n position: relative;\n\n ", ";\n }\n }\n\n .", ".sticky {\n .", " {\n /* sticky row insert dot overlaps other row insert and messes things up */\n display: none !important;\n }\n }\n\n .", " {\n position: absolute;\n top: 0;\n width: ", "px;\n height: ", "px;\n border: 1px solid ", ";\n border-radius: 0;\n border-top-left-radius: ", "px;\n background: ", ";\n box-sizing: border-box;\n padding: 0;\n :focus {\n outline: none;\n }\n }\n .active .", " {\n border-color: ", ";\n background: ", ";\n }\n\n .", "[data-number-column='true'] {\n .", ", .", " {\n width: ", "px;\n }\n .", " .", " {\n border-right-width: 0;\n }\n }\n\n :not(.", ") .", ":hover {\n border-color: ", ";\n background: ", ";\n cursor: pointer;\n }\n\n :not(.", ")\n .", ".", " {\n border-color: ", ";\n background: ", ";\n }\n\n /* Row controls */\n .", " {\n width: ", "px;\n box-sizing: border-box;\n display: none;\n position: relative;\n\n ", ";\n\n .", " {\n display: flex;\n flex-direction: column;\n }\n .", ":last-child > button {\n border-bottom-left-radius: ", "px;\n }\n .", " {\n position: relative;\n margin-top: -1px;\n }\n .", ":hover,\n .", ".active,\n .", ":hover {\n z-index: ", ";\n }\n\n ", "\n }\n\n .", " {\n display: grid;\n align-items: center;\n position: absolute;\n left: -4px;\n }\n\n .", " {\n cursor: grab;\n width: max-content;\n padding: 0;\n border: none;\n background: none;\n }\n\n ", "\n\n :not(.", ") .", " {\n ", "\n ", "\n }\n\n /* Numbered column */\n .", " {\n position: relative;\n float: right;\n margin-left: ", "px;\n top: ", "px;\n width: ", "px;\n box-sizing: border-box;\n }\n\n .", " {\n border: 1px solid ", ";\n box-sizing: border-box;\n margin-top: -1px;\n padding-bottom: 2px;\n padding: 10px 2px;\n text-align: center;\n font-size: ", ";\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n\n :first-child:not(style),\n style:first-child + * {\n margin-top: 0;\n }\n :last-child {\n border-bottom: 1px solid ", ";\n }\n }\n\n // add a background above the first numbered column cell when sticky header is engaged\n // which hides the table when scrolling\n .", ":first-of-type::after {\n content: '';\n display: block;\n height: 33px;\n width: 100%;\n background-color: ", ";\n position: absolute;\n\n // the extra pixel is accounting for borders\n top: -34px;\n left: -1px;\n }\n\n .", " {\n .", ", .", " {\n display: block;\n }\n .", " {\n padding-left: ", "px;\n\n .", " {\n border-left: 0 none;\n }\n\n .", ".active {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n }\n }\n :not(.", ") .", " {\n .", ":not(.", ") {\n cursor: pointer;\n }\n .", ":not(.", "):hover {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n .", ".", " {\n background-color: ", ";\n border: 1px solid ", ";\n border-left: 0;\n color: ", ";\n position: relative;\n z-index: ", ";\n }\n }\n\n /* Table */\n .", " > table {\n table-layout: fixed;\n white-space: normal;\n border-top: none;\n // 1px border width offset added here to prevent unwanted overflow and scolling - ED-16212\n margin-right: -1px;\n // Allows better positioning for the shadow sentinels - ED-16668\n position: relative;\n\n > tbody > tr {\n white-space: pre-wrap;\n }\n\n .", " + * {\n margin-top: 0;\n }\n\n /*\n * Headings have a top margin by default, but we don't want this on the\n * first heading within table header cells.\n *\n * This specifically sets margin-top for the first heading within a header\n * cell when center/right aligned.\n */\n th.", " > .fabric-editor-block-mark {\n > h1:first-of-type,\n > h2:first-of-type,\n > h3:first-of-type,\n > h4:first-of-type,\n > h5:first-of-type,\n > h6:first-of-type {\n margin-top: 0;\n }\n }\n\n .", ", .", " {\n position: relative;\n }\n /* Give selected cells a blue overlay */\n .", "::after,\n .", "::after {\n z-index: ", ";\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n width: 100%;\n pointer-events: none;\n }\n .", " {\n border: 1px solid ", ";\n }\n .", "::after {\n background: ", ";\n z-index: ", ";\n }\n th.", "::after,\n td.", "::after {\n background: ", ";\n z-index: ", ";\n }\n // ED-15246: Trello card is visible through a border of a table border\n /* ED-19064: To fix when enable header column in the table,\n and selection the header column, the right border is not tableBorderSelectedColor\n when deleting the header column, the right border is not tableToolbarDeleteColor */\n td.", ",\n td.", ",\n th.", ".", ",\n th.", ".", " {\n &::after {\n height: 100%;\n width: 100%;\n border: 1px solid ", ";\n content: '';\n position: absolute;\n left: -1px;\n top: -1px;\n bottom: 0;\n z-index: ", ";\n display: inline-block;\n pointer-events: none;\n }\n &.", "::after {\n ", ";\n z-index: ", ";\n }\n }\n }\n ", "\n .", ".", " {\n z-index: ", ";\n }\n\n .", " {\n position: absolute;\n top: ", "px;\n }\n\n ", "\n }\n\n .ProseMirror.", " {\n .", " {\n overflow-x: auto;\n ", ";\n }\n }\n\n .ProseMirror.", " {\n cursor: col-resize;\n }\n\n /*\n ED-15882: When custom start numbers is enabled for lists, we have\n styles that handle this generally (in editor-common) so we can\n throw away the older table-specific styles here.\n */\n ", "\n\n ", "\n"])), ClassName.LAYOUT_BUTTON, "var(--ds-background-neutral, ".concat(N20A, ")"), "var(--ds-icon, ".concat(N300, ")"), ClassName.LAYOUT_BUTTON, ClassName.IS_RESIZING, "var(--ds-background-neutral-hovered, ".concat(B300, ")"), "var(--ds-icon, white)", tableSharedStyle(props), columnControlsLineMarker(), hoveredDeleteButton(props), hoveredCell(props), hoveredWarningCell, getBooleanFF('platform.editor.table.drag-and-drop') && insertLine(props), resizeHandle(props), rangeSelectionStyles, ClassName.LAST_ITEM_IN_CELL, ClassName.TABLE_NODE_WRAPPER, ClassName.TABLE_CELL, ClassName.TABLE_HEADER_CELL, ClassName.TABLE_CELL, tableCellBackgroundColor(props), tableBorderColor(props), tableBorderColor(props), ClassName.CONTROLS_FLOATING_BUTTON_COLUMN, insertColumnButtonWrapper(props), ClassName.CONTROLS_FLOATING_BUTTON_ROW, insertRowButtonWrapper(props), DeleteButton(props), ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, stickyRowOffsetTop + 2, akEditorTableNumberColumnWidth, akEditorStickyHeaderZIndex, stickyRowOffsetTop, "var(--ds-surface, white)", ClassName.TABLE_STICKY, ClassName.CORNER_CONTROLS, akEditorSmallZIndex, "var(--ds-surface, white)", tableToolbarSize, tableToolbarSize, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize, tableToolbarSize, tableStickyHeaderColumnControlsDecorationsStyle(props), ClassName.TABLE_STICKY, ClassName.ROW_CONTROLS, ClassName.ROW_CONTROLS_BUTTON_WRAP, akEditorStickyHeaderZIndex, tableToolbarSize, "var(--ds-surface, white)", tableToolbarSize, ClassName.TABLE_STICKY, "var(--ds-surface, green)", stickyRowOffsetTop, akEditorTableCellOnStickyHeaderZIndex - 5, "var(--ds-surface, white)", "var(--ds-shadow-overflow-perimeter, ".concat(N40A, ")"), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, akEditorTableCellOnStickyHeaderZIndex, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tableToolbarSize, stickyHeaderBorderBottomWidth, tableBorderColor(props), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, insertColumnButtonOffset + 1, ClassName.TABLE_STICKY, ClassName.TABLE_CONTAINER, ClassName.TABLE_STICKY, ClassName.WITH_RESIZE_LINE, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2 + 1, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, ClassName.WITH_CONTROLS, tableControlsSpacing, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, tableControlsSpacing + 2, ClassName.CORNER_CONTROLS, tableControlsSpacing - tableToolbarSize + 2, "var(--ds-surface, white)", sentinelStyles, OverflowShadow(props), stickyScrollbarStyles(), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tablePadding, ClassName.ROW_CONTROLS_WRAPPER, tablePadding, ClassName.COLUMN_CONTROLS_WRAPPER, tablePadding, ClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth + tablePadding - 1, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, tableOverflowShadowWidth, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, ClassName.NODEVIEW_WRAPPER, breakoutWidthStyling(), columnControlsDecoration(props), rowControlsWrapperDotStyle(props), ClassName.CORNER_CONTROLS, tableToolbarSize + 1, cornerControlHeight, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, InsertMarker(props, "\n left: -11px;\n top: 9px;\n "), ClassName.CORNER_CONTROLS, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize + 1, tableToolbarSize + 1, tableBorderColor(props), tableBorderRadiusSize, tableHeaderCellBackgroundColor(props), ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor(props), tableToolbarSelectedColor(props), ClassName.TABLE_CONTAINER, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, getBooleanFF('platform.editor.custom-table-width') ? akEditorTableToolbarSize + akEditorTableNumberColumnWidth + 1 : akEditorTableToolbarSize + akEditorTableNumberColumnWidth, ClassName.ROW_CONTROLS, ClassName.CONTROLS_BUTTON, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor(props), tableToolbarSelectedColor(props), ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableBorderDeleteColor(props), tableToolbarDeleteColor(props), ClassName.ROW_CONTROLS, tableToolbarSize, InsertMarker(props, "\n bottom: -1px;\n left: -11px;\n "), ClassName.ROW_CONTROLS_INNER, ClassName.ROW_CONTROLS_BUTTON_WRAP, tableBorderRadiusSize, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.CONTROLS_BUTTON, akEditorUnitZIndex, HeaderButton(props, "\n border-bottom: 1px solid ".concat(tableBorderColor(props), ";\n border-right: 0px;\n border-radius: 0;\n height: 100%;\n width: ").concat(tableToolbarSize, "px;\n\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, " {\n position: absolute;\n width: 30px;\n height: 50%;\n right: 0;\n bottom: 0;\n }\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, ":first-of-type {\n top: 0;\n }\n ")), ClassName.ROW_CONTROLS_WITH_DRAG, ClassName.DRAG_HANDLE_BUTTON_CONTAINER, floatingColumnControls(props), ClassName.IS_RESIZING, ClassName.ROW_CONTROLS, HeaderButtonHover(props), HeaderButtonDanger(props), ClassName.NUMBERED_COLUMN, getBooleanFF('platform.editor.custom-table-width') ? akEditorTableToolbarSize : akEditorTableToolbarSize - 1, getBooleanFF('platform.editor.table.drag-and-drop') ? 0 : akEditorTableToolbarSize, akEditorTableNumberColumnWidth + 1, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderColor(props), relativeFontSizeToBase16(fontSize()), tableHeaderCellBackgroundColor(props), tableTextColor(props), tableBorderColor(props), tableBorderColor(props), ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, "var(--ds-surface, white)", ClassName.WITH_CONTROLS, ClassName.CORNER_CONTROLS, ClassName.ROW_CONTROLS, ClassName.NUMBERED_COLUMN, getBooleanFF('platform.editor.custom-table-width') ? 0 : 1, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor(props), tableBorderSelectedColor(props), tableToolbarSelectedColor(props), akEditorUnitZIndex, "var(--ds-text-selected, ".concat(N0, ")"), ClassName.IS_RESIZING, ClassName.WITH_CONTROLS, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, tableBorderSelectedColor(props), tableBorderSelectedColor(props), tableToolbarSelectedColor(props), akEditorUnitZIndex, "var(--ds-text-selected, ".concat(N0, ")"), ClassName.NUMBERED_COLUMN_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableToolbarDeleteColor(props), tableBorderDeleteColor(props), "var(--ds-text-danger, ".concat(R500, ")"), akEditorUnitZIndex, ClassName.TABLE_NODE_WRAPPER, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_HEADER_CELL, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, akEditorSmallZIndex, ClassName.SELECTED_CELL, tableBorderSelectedColor(props), ClassName.SELECTED_CELL, tableCellSelectedColor(props), akEditorSmallZIndex, ClassName.HOVERED_CELL_IN_DANGER, ClassName.HOVERED_CELL_IN_DANGER, tableCellDeleteColor(props), akEditorUnitZIndex * 100, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, ClassName.TABLE_HEADER_CELL, ClassName.SELECTED_CELL, ClassName.TABLE_HEADER_CELL, ClassName.HOVERED_CELL, tableBorderSelectedColor(props), akEditorSmallZIndex, ClassName.HOVERED_CELL_IN_DANGER, tableBorderStyles(props), akEditorUnitZIndex * 100, tableRowControlStyles(), ClassName.ROW_CONTROLS_WRAPPER, ClassName.TABLE_LEFT_SHADOW, akEditorUnitZIndex, ClassName.COLUMN_CONTROLS_WRAPPER, tableMarginTop + 1, tableWrapperStyles(), ClassName.IS_RESIZING, ClassName.TABLE_NODE_WRAPPER, scrollbarStyles, ClassName.RESIZE_CURSOR, props !== null && props !== void 0 && (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.restartNumberedLists ? "" : listLargeNumericMarkersOldStyles, shadowSentinelStyles);
|
|
64
|
+
return css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n .", " button {\n background: ", ";\n color: ", ";\n cursor: none;\n }\n\n .", ":not(.", ") button:hover {\n background: ", ";\n color: ", " !important;\n cursor: pointer;\n }\n\n .ProseMirror {\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n\n .", " {\n 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\n .", "\n .", "\n .", ".sticky {\n position: fixed !important;\n z-index: ", " !important;\n display: flex;\n border-left: ", "px solid\n ", ";\n margin-left: -", "px;\n }\n\n .", " col:first-of-type {\n /* moving rows out of a table layout does weird things in Chrome */\n border-right: 1px solid ", ";\n }\n\n tr.sticky {\n padding-top: ", "px;\n position: fixed;\n display: grid;\n\n /* to keep it above cell selection but below date and other nodes popups that are inside sticky header */\n z-index: ", ";\n\n overflow-y: visible;\n overflow-x: hidden;\n\n grid-auto-flow: column;\n\n /* background for where controls apply */\n background: ", ";\n box-sizing: content-box;\n\n margin-top: 2px;\n\n box-shadow: 0 6px 4px -4px ", ";\n margin-left: -1px;\n\n &.no-pointer-events {\n pointer-events: none;\n }\n }\n\n .", " .", " {\n left: unset;\n position: fixed;\n /* needs to be above sticky header row and below date and other nodes popups that are inside sticky header */\n z-index: ", ";\n }\n\n .", ".", "\n .", " {\n padding-bottom: ", "px;\n }\n\n tr.sticky th {\n border-bottom: ", "px solid\n ", ";\n margin-right: -1px;\n }\n\n .", " tr.sticky > th:last-child {\n border-right-width: 1px;\n }\n\n /* add left edge for first cell */\n .", " tr.sticky > th:first-of-type {\n margin-left: 0px;\n }\n\n /* add a little bit so the scroll lines up with the table */\n .", " tr.sticky::after {\n content: ' ';\n width: ", "px;\n }\n\n /* To fix jumpiness caused in Chrome Browsers for sticky headers */\n .", " .sticky + tr {\n min-height: 0px;\n }\n\n /* move resize line a little in sticky bar */\n .", ".", " {\n tr.sticky\n td.", ",\n tr.sticky\n th.", " {\n .", "::after {\n right: ", "px;\n }\n }\n\n /* when selected put it back to normal -- :not selector would be nicer */\n tr.sticky\n td.", ".", ",\n tr.sticky\n th.", ".", " {\n .", "::after {\n right: ", "px;\n }\n }\n }\n\n tr.sticky\n .", ",\n tr.sticky\n .", " {\n z-index: 1;\n }\n\n .", " tr.sticky {\n padding-top: ", "px;\n }\n\n .", ".", "\n .", "\n .", ":first-of-type {\n margin-top: ", "px;\n }\n\n .", ".sticky {\n border-top: ", "px solid\n ", ";\n }\n\n ", "\n ", "\n ", "\n\n .", " .", " {\n height: 0; // stop overflow flash & set correct height in update-overflow-shadows.ts\n }\n\n .less-padding {\n padding: 0 ", "px;\n\n .", " {\n padding: 0 ", "px;\n\n // https://product-fabric.atlassian.net/browse/ED-16386\n // Fixes issue where the extra padding that is added here throws off the position\n // of the rows control dot\n &::after {\n right: 6px !important;\n }\n }\n\n .", " {\n padding: 0 ", "px;\n }\n\n &.", "[data-number-column='true'] {\n padding-left: ", "px;\n }\n .", ", .", " {\n width: ", "px;\n }\n\n .", " {\n left: 6px;\n }\n\n .", " {\n left: calc(100% - 6px);\n }\n }\n\n > .", " {\n /**\n * Prevent margins collapsing, aids with placing the gap-cursor correctly\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing\n *\n * TODO: Enable this, many tests will fail!\n * border-top: 1px solid transparent;\n */\n }\n\n /* Breakout only works on top level unless wrapped in fragment mark */\n ", "\n\n ", ";\n ", ";\n\n /* Corner controls */\n .", " {\n width: ", "px;\n height: ", "px;\n display: none;\n\n .", " {\n position: relative;\n\n ", ";\n }\n }\n\n .", ".sticky {\n .", " {\n /* sticky row insert dot overlaps other row insert and messes things up */\n display: none !important;\n }\n }\n\n .", " {\n position: absolute;\n top: 0;\n width: ", "px;\n height: ", "px;\n border: 1px solid ", ";\n border-radius: 0;\n border-top-left-radius: ", "px;\n background: ", ";\n box-sizing: border-box;\n padding: 0;\n :focus {\n outline: none;\n }\n }\n .active .", " {\n border-color: ", ";\n background: ", ";\n }\n\n .", "[data-number-column='true'] {\n .", ", .", " {\n width: ", "px;\n }\n .", " .", " {\n border-right-width: 0;\n }\n }\n\n :not(.", ") .", ":hover {\n border-color: ", ";\n background: ", ";\n cursor: pointer;\n }\n\n :not(.", ")\n .", ".", " {\n border-color: ", ";\n background: ", ";\n }\n\n /* Row controls */\n .", " {\n width: ", "px;\n box-sizing: border-box;\n display: none;\n position: relative;\n\n ", ";\n\n .", " {\n display: flex;\n flex-direction: column;\n }\n .", ":last-child > button {\n border-bottom-left-radius: ", "px;\n }\n .", " {\n position: relative;\n margin-top: -1px;\n }\n .", ":hover,\n .", ".active,\n .", ":hover {\n z-index: ", ";\n }\n\n ", "\n }\n\n .", " {\n display: grid;\n align-items: center;\n position: absolute;\n left: -4px;\n z-index: ", ";\n }\n\n .", " {\n cursor: grab;\n padding: 0;\n\n border-radius: 6px;\n width: max-content;\n height: max-content;\n border: 2px solid ", ";\n display: flex;\n justify-content: center;\n align-items: center;\n\n svg {\n rect {\n //\n fill: ", ";\n }\n g {\n fill: ", ";\n }\n }\n\n &:hover {\n svg {\n rect {\n fill: ", ";\n }\n g {\n fill: ", ";\n }\n }\n }\n\n &.selected {\n svg {\n rect {\n fill: ", ";\n }\n g {\n fill: ", ";\n }\n }\n }\n\n &.danger {\n svg {\n rect {\n fill: ", ";\n }\n g {\n fill: ", ";\n }\n }\n }\n\n &.disabled {\n svg {\n rect {\n fill: ", ";\n }\n g {\n fill: ", ";\n }\n }\n }\n }\n\n ", "\n\n :not(.", ") .", " {\n ", "\n ", "\n }\n\n /* Numbered column */\n .", " {\n position: relative;\n float: right;\n margin-left: ", "px;\n top: ", "px;\n width: ", "px;\n box-sizing: border-box;\n }\n\n .", " {\n border: 1px solid ", ";\n box-sizing: border-box;\n margin-top: -1px;\n padding-bottom: 2px;\n padding: 10px 2px;\n text-align: center;\n font-size: ", ";\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n\n :first-child:not(style),\n style:first-child + * {\n margin-top: 0;\n }\n :last-child {\n border-bottom: 1px solid ", ";\n }\n }\n\n // add a background above the first numbered column cell when sticky header is engaged\n // which hides the table when scrolling\n .", ":first-of-type::after {\n content: '';\n display: block;\n height: 33px;\n width: 100%;\n background-color: ", ";\n position: absolute;\n\n // the extra pixel is accounting for borders\n top: -34px;\n left: -1px;\n }\n\n .", " {\n .", ", .", " {\n display: block;\n }\n .", " {\n padding-left: ", "px;\n\n .", " {\n border-left: 0 none;\n }\n\n .", ".active {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n }\n }\n :not(.", ") .", " {\n .", ":not(.", ") {\n cursor: pointer;\n }\n .", ":not(.", "):hover {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n .", ".", " {\n background-color: ", ";\n border: 1px solid ", ";\n border-left: 0;\n color: ", ";\n position: relative;\n z-index: ", ";\n }\n }\n\n /* Table */\n .", " > table {\n table-layout: fixed;\n white-space: normal;\n border-top: none;\n // 1px border width offset added here to prevent unwanted overflow and scolling - ED-16212\n margin-right: -1px;\n // Allows better positioning for the shadow sentinels - ED-16668\n position: relative;\n\n > tbody > tr {\n white-space: pre-wrap;\n }\n\n .", " + * {\n margin-top: 0;\n }\n\n /*\n * Headings have a top margin by default, but we don't want this on the\n * first heading within table header cells.\n *\n * This specifically sets margin-top for the first heading within a header\n * cell when center/right aligned.\n */\n th.", " > .fabric-editor-block-mark {\n > h1:first-of-type,\n > h2:first-of-type,\n > h3:first-of-type,\n > h4:first-of-type,\n > h5:first-of-type,\n > h6:first-of-type {\n margin-top: 0;\n }\n }\n\n .", ", .", " {\n position: relative;\n }\n /* Give selected cells a blue overlay */\n .", "::after,\n .", "::after {\n z-index: ", ";\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n width: 100%;\n pointer-events: none;\n }\n .", " {\n border: 1px solid ", ";\n }\n .", "::after {\n background: ", ";\n z-index: ", ";\n }\n th.", "::after,\n td.", "::after {\n background: ", ";\n z-index: ", ";\n }\n // ED-15246: Trello card is visible through a border of a table border\n /* ED-19064: To fix when enable header column in the table,\n and selection the header column, the right border is not tableBorderSelectedColor\n when deleting the header column, the right border is not tableToolbarDeleteColor */\n td.", ",\n td.", ",\n th.", ".", ",\n th.", ".", " {\n &::after {\n height: 100%;\n width: 100%;\n border: 1px solid ", ";\n content: '';\n position: absolute;\n left: -1px;\n top: -1px;\n bottom: 0;\n z-index: ", ";\n display: inline-block;\n pointer-events: none;\n }\n &.", "::after {\n ", ";\n z-index: ", ";\n }\n }\n }\n ", "\n .", ".", " {\n z-index: ", ";\n }\n\n .", " {\n position: absolute;\n top: ", "px;\n }\n\n ", "\n }\n\n .ProseMirror.", " {\n .", " {\n overflow-x: auto;\n ", ";\n }\n }\n\n .ProseMirror.", " {\n cursor: col-resize;\n }\n\n /*\n ED-15882: When custom start numbers is enabled for lists, we have\n styles that handle this generally (in editor-common) so we can\n throw away the older table-specific styles here.\n */\n ", "\n\n ", "\n"])), ClassName.LAYOUT_BUTTON, "var(--ds-background-neutral, ".concat(N20A, ")"), "var(--ds-icon, ".concat(N300, ")"), ClassName.LAYOUT_BUTTON, ClassName.IS_RESIZING, "var(--ds-background-neutral-hovered, ".concat(B300, ")"), "var(--ds-icon, white)", tableSharedStyle(props), columnControlsLineMarker(), hoveredDeleteButton(props), hoveredCell(props), hoveredWarningCell, getBooleanFF('platform.editor.table.drag-and-drop') && insertLine(props), resizeHandle(props), rangeSelectionStyles, ClassName.LAST_ITEM_IN_CELL, ClassName.TABLE_NODE_WRAPPER, ClassName.TABLE_CELL, ClassName.TABLE_HEADER_CELL, ClassName.TABLE_CELL, tableCellBackgroundColor(props), tableBorderColor(props), tableBorderColor(props), ClassName.CONTROLS_FLOATING_BUTTON_COLUMN, insertColumnButtonWrapper(props), ClassName.CONTROLS_FLOATING_BUTTON_ROW, insertRowButtonWrapper(props), DeleteButton(props), ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, stickyRowOffsetTop + 2, akEditorTableNumberColumnWidth, akEditorStickyHeaderZIndex, stickyRowOffsetTop, "var(--ds-surface, white)", ClassName.TABLE_STICKY, ClassName.CORNER_CONTROLS, akEditorSmallZIndex, "var(--ds-surface, white)", tableToolbarSize, tableToolbarSize, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize, tableToolbarSize, tableStickyHeaderColumnControlsDecorationsStyle(props), ClassName.TABLE_STICKY, ClassName.ROW_CONTROLS, ClassName.ROW_CONTROLS_BUTTON_WRAP, akEditorStickyHeaderZIndex, tableToolbarSize, "var(--ds-surface, white)", tableToolbarSize, ClassName.TABLE_STICKY, "var(--ds-surface, green)", stickyRowOffsetTop, akEditorTableCellOnStickyHeaderZIndex - 5, "var(--ds-surface, white)", "var(--ds-shadow-overflow-perimeter, ".concat(N40A, ")"), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, akEditorTableCellOnStickyHeaderZIndex, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tableToolbarSize, stickyHeaderBorderBottomWidth, tableBorderColor(props), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, insertColumnButtonOffset + 1, ClassName.TABLE_STICKY, ClassName.TABLE_CONTAINER, ClassName.TABLE_STICKY, ClassName.WITH_RESIZE_LINE, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2 + 1, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, ClassName.WITH_CONTROLS, tableControlsSpacing, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, tableControlsSpacing + 2, ClassName.CORNER_CONTROLS, tableControlsSpacing - tableToolbarSize + 2, "var(--ds-surface, white)", sentinelStyles, OverflowShadow(props), stickyScrollbarStyles(), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tablePadding, ClassName.ROW_CONTROLS_WRAPPER, tablePadding, ClassName.COLUMN_CONTROLS_WRAPPER, tablePadding, ClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth + tablePadding - 1, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, tableOverflowShadowWidth, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, ClassName.NODEVIEW_WRAPPER, breakoutWidthStyling(), columnControlsDecoration(props), rowControlsWrapperDotStyle(props), ClassName.CORNER_CONTROLS, tableToolbarSize + 1, cornerControlHeight, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, InsertMarker(props, "\n left: -11px;\n top: 9px;\n "), ClassName.CORNER_CONTROLS, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize + 1, tableToolbarSize + 1, tableBorderColor(props), tableBorderRadiusSize, tableHeaderCellBackgroundColor(props), ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor(props), tableToolbarSelectedColor(props), ClassName.TABLE_CONTAINER, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, getBooleanFF('platform.editor.custom-table-width') ? akEditorTableToolbarSize + akEditorTableNumberColumnWidth + 1 : akEditorTableToolbarSize + akEditorTableNumberColumnWidth, ClassName.ROW_CONTROLS, ClassName.CONTROLS_BUTTON, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor(props), tableToolbarSelectedColor(props), ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableBorderDeleteColor(props), tableToolbarDeleteColor(props), ClassName.ROW_CONTROLS, tableToolbarSize, InsertMarker(props, "\n bottom: -1px;\n left: -11px;\n "), ClassName.ROW_CONTROLS_INNER, ClassName.ROW_CONTROLS_BUTTON_WRAP, tableBorderRadiusSize, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.CONTROLS_BUTTON, akEditorUnitZIndex, HeaderButton(props, "\n border-bottom: 1px solid ".concat(tableBorderColor(props), ";\n border-right: 0px;\n border-radius: 0;\n height: 100%;\n width: ").concat(tableToolbarSize, "px;\n\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, " {\n position: absolute;\n width: 30px;\n height: 50%;\n right: 0;\n bottom: 0;\n }\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, ":first-of-type {\n top: 0;\n }\n ")), ClassName.ROW_CONTROLS_WITH_DRAG, akEditorUnitZIndex, ClassName.DRAG_HANDLE_BUTTON_CONTAINER, "var(--ds-surface, ".concat(N0, ")"), "var(--ds-background-accent-gray-subtlest, #F1F2F4)", "var(--ds-icon-subtle, #626F86)", "var(--ds-background-accent-blue-subtle, #579DFF)", "var(--ds-icon-inverse, #FFF)", "var(--ds-background-accent-blue-subtle, #579DFF)", "var(--ds-icon-inverse, #FFF)", "var(--ds-background-accent-red-subtler-pressed, #F87462)", "var(--ds-border-inverse, #FFF)", "var(--ds-background-accent-gray-subtlest, #F1F2F4)", "var(--ds-border-inverse, #FFF)", floatingColumnControls(props), ClassName.IS_RESIZING, ClassName.ROW_CONTROLS, HeaderButtonHover(props), HeaderButtonDanger(props), ClassName.NUMBERED_COLUMN, getBooleanFF('platform.editor.custom-table-width') ? akEditorTableToolbarSize : akEditorTableToolbarSize - 1, getBooleanFF('platform.editor.table.drag-and-drop') ? 0 : akEditorTableToolbarSize, akEditorTableNumberColumnWidth + 1, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderColor(props), relativeFontSizeToBase16(fontSize()), tableHeaderCellBackgroundColor(props), tableTextColor(props), tableBorderColor(props), tableBorderColor(props), ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, "var(--ds-surface, white)", ClassName.WITH_CONTROLS, ClassName.CORNER_CONTROLS, ClassName.ROW_CONTROLS, ClassName.NUMBERED_COLUMN, getBooleanFF('platform.editor.custom-table-width') ? 0 : 1, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor(props), tableBorderSelectedColor(props), tableToolbarSelectedColor(props), akEditorUnitZIndex, "var(--ds-text-selected, ".concat(N0, ")"), ClassName.IS_RESIZING, ClassName.WITH_CONTROLS, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, tableBorderSelectedColor(props), tableBorderSelectedColor(props), tableToolbarSelectedColor(props), akEditorUnitZIndex, "var(--ds-text-selected, ".concat(N0, ")"), ClassName.NUMBERED_COLUMN_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableToolbarDeleteColor(props), tableBorderDeleteColor(props), "var(--ds-text-danger, ".concat(R500, ")"), akEditorUnitZIndex, ClassName.TABLE_NODE_WRAPPER, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_HEADER_CELL, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, akEditorSmallZIndex, ClassName.SELECTED_CELL, tableBorderSelectedColor(props), ClassName.SELECTED_CELL, tableCellSelectedColor(props), akEditorSmallZIndex, ClassName.HOVERED_CELL_IN_DANGER, ClassName.HOVERED_CELL_IN_DANGER, tableCellDeleteColor(props), akEditorUnitZIndex * 100, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, ClassName.TABLE_HEADER_CELL, ClassName.SELECTED_CELL, ClassName.TABLE_HEADER_CELL, ClassName.HOVERED_CELL, tableBorderSelectedColor(props), akEditorSmallZIndex, ClassName.HOVERED_CELL_IN_DANGER, tableBorderStyles(props), akEditorUnitZIndex * 100, tableRowControlStyles(), ClassName.ROW_CONTROLS_WRAPPER, ClassName.TABLE_LEFT_SHADOW, akEditorUnitZIndex, ClassName.COLUMN_CONTROLS_WRAPPER, tableMarginTop + 1, tableWrapperStyles(), ClassName.IS_RESIZING, ClassName.TABLE_NODE_WRAPPER, scrollbarStyles, ClassName.RESIZE_CURSOR, props !== null && props !== void 0 && (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.restartNumberedLists ? "" : listLargeNumericMarkersOldStyles, shadowSentinelStyles);
|
|
65
65
|
};
|
|
66
66
|
export var tableFullPageEditorStyles = css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n .ProseMirror .", " > table {\n margin-left: 0;\n // 1px border width offset added here to prevent unwanted overflow and scolling - ED-16212\n margin-right: -1px;\n width: 100%;\n }\n"])), ClassName.TABLE_NODE_WRAPPER);
|
|
67
67
|
export var tableCommentEditorStyles = css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n .ProseMirror .", " > table {\n margin-left: 0;\n margin-right: 0;\n ", ";\n }\n"])), ClassName.TABLE_NODE_WRAPPER, scrollbarStyles);
|
|
@@ -1,55 +1,15 @@
|
|
|
1
|
-
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
2
1
|
import React from 'react';
|
|
3
|
-
export var DragHandleIcon = function DragHandleIcon(
|
|
4
|
-
var backgroundColor = _ref.backgroundColor,
|
|
5
|
-
foregroundColor = _ref.foregroundColor;
|
|
2
|
+
export var DragHandleIcon = function DragHandleIcon() {
|
|
6
3
|
return /*#__PURE__*/React.createElement("svg", {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
fill: "none"
|
|
11
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
4
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5
|
+
width: "24",
|
|
6
|
+
height: "16",
|
|
7
|
+
fill: "none"
|
|
12
8
|
}, /*#__PURE__*/React.createElement("rect", {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}), /*#__PURE__*/React.createElement("g", {
|
|
20
|
-
clipPath: "url(#clip0_125_45007)"
|
|
21
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
22
|
-
d: "M11 12C11 11.4477 10.5523 11 10 11C9.44772 11 9 11.4477 9 12C9 12.5523 9.44772 13 10 13C10.5523 13 11 12.5523 11 12Z",
|
|
23
|
-
fill: foregroundColor || '#626F86'
|
|
24
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
25
|
-
d: "M11 8C11 7.44772 10.5523 7 10 7C9.44772 7 9 7.44772 9 8C9 8.55228 9.44772 9 10 9C10.5523 9 11 8.55228 11 8Z",
|
|
26
|
-
fill: foregroundColor || '#626F86'
|
|
27
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
28
|
-
d: "M19 12C19 11.4477 18.5523 11 18 11C17.4477 11 17 11.4477 17 12C17 12.5523 17.4477 13 18 13C18.5523 13 19 12.5523 19 12Z",
|
|
29
|
-
fill: foregroundColor || '#626F86'
|
|
30
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
31
|
-
d: "M19 8C19 7.44772 18.5523 7 18 7C17.4477 7 17 7.44772 17 8C17 8.55228 17.4477 9 18 9C18.5523 9 19 8.55228 19 8Z",
|
|
32
|
-
fill: foregroundColor || '#626F86'
|
|
33
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
34
|
-
d: "M15 12C15 11.4477 14.5523 11 14 11C13.4477 11 13 11.4477 13 12C13 12.5523 13.4477 13 14 13C14.5523 13 15 12.5523 15 12Z",
|
|
35
|
-
fill: foregroundColor || '#626F86'
|
|
36
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
37
|
-
d: "M15 8C15 7.44772 14.5523 7 14 7C13.4477 7 13 7.44772 13 8C13 8.55228 13.4477 9 14 9C14.5523 9 15 8.55228 15 8Z",
|
|
38
|
-
fill: foregroundColor || '#626F86'
|
|
39
|
-
})), /*#__PURE__*/React.createElement("rect", {
|
|
40
|
-
x: "1",
|
|
41
|
-
y: "1",
|
|
42
|
-
width: "26",
|
|
43
|
-
height: "18",
|
|
44
|
-
rx: "5",
|
|
45
|
-
stroke: "white",
|
|
46
|
-
strokeWidth: "2"
|
|
47
|
-
}), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
|
|
48
|
-
id: "clip0_125_45007"
|
|
49
|
-
}, /*#__PURE__*/React.createElement("rect", {
|
|
50
|
-
width: "16",
|
|
51
|
-
height: "24",
|
|
52
|
-
fill: "white",
|
|
53
|
-
transform: "matrix(0 -1 1 0 2 18)"
|
|
54
|
-
}))));
|
|
9
|
+
width: "24",
|
|
10
|
+
height: "16",
|
|
11
|
+
rx: "4"
|
|
12
|
+
}), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
|
|
13
|
+
d: "M9 10a1 1 0 1 0-2 0 1 1 0 0 0 2 0ZM9 6a1 1 0 1 0-2 0 1 1 0 0 0 2 0ZM17 10a1 1 0 1 0-2 0 1 1 0 0 0 2 0ZM17 6a1 1 0 1 0-2 0 1 1 0 0 0 2 0ZM13 10a1 1 0 1 0-2 0 1 1 0 0 0 2 0ZM13 6a1 1 0 1 0-2 0 1 1 0 0 0 2 0Z"
|
|
14
|
+
})));
|
|
55
15
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { MouseEventHandler } from 'react';
|
|
2
|
-
type
|
|
2
|
+
type DragHandleAppearance = 'default' | 'selected' | 'disabled' | 'danger';
|
|
3
3
|
type DragHandleProps = {
|
|
4
4
|
tableLocalId: string;
|
|
5
5
|
indexes: number[];
|
|
6
6
|
previewWidth?: number;
|
|
7
7
|
previewHeight?: number;
|
|
8
8
|
direction?: 'column' | 'row';
|
|
9
|
-
|
|
9
|
+
appearance?: DragHandleAppearance;
|
|
10
10
|
onClick?: MouseEventHandler;
|
|
11
11
|
onMouseOver?: MouseEventHandler;
|
|
12
12
|
onMouseOut?: MouseEventHandler;
|
|
13
13
|
};
|
|
14
|
-
export declare const DragHandle: ({ tableLocalId, direction,
|
|
14
|
+
export declare const DragHandle: ({ tableLocalId, direction, appearance, indexes, previewWidth, previewHeight, onMouseOver, onMouseOut, onClick, }: DragHandleProps) => JSX.Element;
|
|
15
15
|
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { CellHoverMeta } from '../../../types';
|
|
4
|
-
export interface
|
|
4
|
+
export interface ColumnControlsProps {
|
|
5
5
|
editorView: EditorView;
|
|
6
6
|
tableActive?: boolean;
|
|
7
|
+
isInDanger?: boolean;
|
|
7
8
|
tableRef: HTMLTableElement;
|
|
8
9
|
hoveredCell?: CellHoverMeta;
|
|
9
10
|
isResizing?: boolean;
|
|
@@ -12,5 +13,5 @@ export interface Props {
|
|
|
12
13
|
rowHeights?: number[];
|
|
13
14
|
colWidths?: (number | undefined)[];
|
|
14
15
|
}
|
|
15
|
-
export declare const ColumnControls:
|
|
16
|
+
export declare const ColumnControls: ({ editorView, tableActive, tableRef, hoveredCell, isResizing, stickyTop, localId, isInDanger, rowHeights, colWidths, }: ColumnControlsProps) => JSX.Element;
|
|
16
17
|
export default ColumnControls;
|
|
@@ -7,6 +7,7 @@ export interface Props {
|
|
|
7
7
|
hoverRows: (rows: number[], danger?: boolean) => void;
|
|
8
8
|
hoveredRows?: number[];
|
|
9
9
|
selectRow: (row: number, expand: boolean) => void;
|
|
10
|
+
updateCellHoverLocation: (rowIndex: number) => void;
|
|
10
11
|
hasHeaderRow?: boolean;
|
|
11
12
|
isInDanger?: boolean;
|
|
12
13
|
isResizing?: boolean;
|
|
@@ -18,7 +19,6 @@ export default class NumberColumn extends Component<Props, any> {
|
|
|
18
19
|
private hoverRows;
|
|
19
20
|
private selectRow;
|
|
20
21
|
private clearHoverSelection;
|
|
21
|
-
private updateDragHandleLocation;
|
|
22
22
|
private getCellStyles;
|
|
23
23
|
private getClassNames;
|
|
24
24
|
}
|
|
@@ -7,8 +7,10 @@ type DragControlsProps = {
|
|
|
7
7
|
tableRef: HTMLTableElement;
|
|
8
8
|
tableActive?: boolean;
|
|
9
9
|
hoveredCell?: CellHoverMeta;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
isInDanger?: boolean;
|
|
11
|
+
hoverRows: (rows: number[], danger?: boolean) => void;
|
|
12
|
+
selectRow: (row: number, expand: boolean) => void;
|
|
13
|
+
updateCellHoverLocation: (rowIndex: number) => void;
|
|
12
14
|
};
|
|
13
15
|
export declare const DragControls: React.FC<import("react-intl-next").WithIntlProps<DragControlsProps & WrappedComponentProps<"intl">>> & {
|
|
14
16
|
WrappedComponent: React.ComponentType<DragControlsProps & WrappedComponentProps<"intl">>;
|
|
@@ -1,7 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
backgroundColor?: string;
|
|
4
|
-
foregroundColor?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare const DragHandleIcon: ({ backgroundColor, foregroundColor, }: DragHandleIconProps) => JSX.Element;
|
|
7
|
-
export {};
|
|
2
|
+
export declare const DragHandleIcon: () => JSX.Element;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { MouseEventHandler } from 'react';
|
|
2
|
-
type
|
|
2
|
+
type DragHandleAppearance = 'default' | 'selected' | 'disabled' | 'danger';
|
|
3
3
|
type DragHandleProps = {
|
|
4
4
|
tableLocalId: string;
|
|
5
5
|
indexes: number[];
|
|
6
6
|
previewWidth?: number;
|
|
7
7
|
previewHeight?: number;
|
|
8
8
|
direction?: 'column' | 'row';
|
|
9
|
-
|
|
9
|
+
appearance?: DragHandleAppearance;
|
|
10
10
|
onClick?: MouseEventHandler;
|
|
11
11
|
onMouseOver?: MouseEventHandler;
|
|
12
12
|
onMouseOut?: MouseEventHandler;
|
|
13
13
|
};
|
|
14
|
-
export declare const DragHandle: ({ tableLocalId, direction,
|
|
14
|
+
export declare const DragHandle: ({ tableLocalId, direction, appearance, indexes, previewWidth, previewHeight, onMouseOver, onMouseOut, onClick, }: DragHandleProps) => JSX.Element;
|
|
15
15
|
export {};
|
package/dist/types-ts4.5/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { CellHoverMeta } from '../../../types';
|
|
4
|
-
export interface
|
|
4
|
+
export interface ColumnControlsProps {
|
|
5
5
|
editorView: EditorView;
|
|
6
6
|
tableActive?: boolean;
|
|
7
|
+
isInDanger?: boolean;
|
|
7
8
|
tableRef: HTMLTableElement;
|
|
8
9
|
hoveredCell?: CellHoverMeta;
|
|
9
10
|
isResizing?: boolean;
|
|
@@ -12,5 +13,5 @@ export interface Props {
|
|
|
12
13
|
rowHeights?: number[];
|
|
13
14
|
colWidths?: (number | undefined)[];
|
|
14
15
|
}
|
|
15
|
-
export declare const ColumnControls:
|
|
16
|
+
export declare const ColumnControls: ({ editorView, tableActive, tableRef, hoveredCell, isResizing, stickyTop, localId, isInDanger, rowHeights, colWidths, }: ColumnControlsProps) => JSX.Element;
|
|
16
17
|
export default ColumnControls;
|
|
@@ -7,6 +7,7 @@ export interface Props {
|
|
|
7
7
|
hoverRows: (rows: number[], danger?: boolean) => void;
|
|
8
8
|
hoveredRows?: number[];
|
|
9
9
|
selectRow: (row: number, expand: boolean) => void;
|
|
10
|
+
updateCellHoverLocation: (rowIndex: number) => void;
|
|
10
11
|
hasHeaderRow?: boolean;
|
|
11
12
|
isInDanger?: boolean;
|
|
12
13
|
isResizing?: boolean;
|
|
@@ -18,7 +19,6 @@ export default class NumberColumn extends Component<Props, any> {
|
|
|
18
19
|
private hoverRows;
|
|
19
20
|
private selectRow;
|
|
20
21
|
private clearHoverSelection;
|
|
21
|
-
private updateDragHandleLocation;
|
|
22
22
|
private getCellStyles;
|
|
23
23
|
private getClassNames;
|
|
24
24
|
}
|
package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/RowControls/DragControls.d.ts
CHANGED
|
@@ -7,8 +7,10 @@ type DragControlsProps = {
|
|
|
7
7
|
tableRef: HTMLTableElement;
|
|
8
8
|
tableActive?: boolean;
|
|
9
9
|
hoveredCell?: CellHoverMeta;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
isInDanger?: boolean;
|
|
11
|
+
hoverRows: (rows: number[], danger?: boolean) => void;
|
|
12
|
+
selectRow: (row: number, expand: boolean) => void;
|
|
13
|
+
updateCellHoverLocation: (rowIndex: number) => void;
|
|
12
14
|
};
|
|
13
15
|
export declare const DragControls: React.FC<import("react-intl-next").WithIntlProps<DragControlsProps & WrappedComponentProps<"intl">>> & {
|
|
14
16
|
WrappedComponent: React.ComponentType<DragControlsProps & WrappedComponentProps<"intl">>;
|
|
@@ -1,7 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
backgroundColor?: string;
|
|
4
|
-
foregroundColor?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare const DragHandleIcon: ({ backgroundColor, foregroundColor, }: DragHandleIconProps) => JSX.Element;
|
|
7
|
-
export {};
|
|
2
|
+
export declare const DragHandleIcon: () => JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.12",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@atlaskit/adf-schema": "^32.0.0",
|
|
31
31
|
"@atlaskit/custom-steps": "^0.0.2",
|
|
32
|
-
"@atlaskit/editor-common": "^76.
|
|
32
|
+
"@atlaskit/editor-common": "^76.15.0",
|
|
33
33
|
"@atlaskit/editor-palette": "1.5.1",
|
|
34
34
|
"@atlaskit/editor-plugin-analytics": "^0.2.0",
|
|
35
35
|
"@atlaskit/editor-plugin-content-insertion": "^0.1.0",
|
|
@@ -27,9 +27,7 @@ import {
|
|
|
27
27
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
28
28
|
|
|
29
29
|
import tablePlugin from '../../../plugins/table-plugin';
|
|
30
|
-
import { getPluginState } from '../../../plugins/table/pm-plugins/plugin-factory';
|
|
31
30
|
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
32
|
-
// import type { TablePluginState } from '../../../plugins/table/types';
|
|
33
31
|
import { TableCssClassName as ClassName } from '../../../plugins/table/types';
|
|
34
32
|
import NumberColumn from '../../../plugins/table/ui/TableFloatingControls/NumberColumn';
|
|
35
33
|
|
|
@@ -55,6 +53,7 @@ describe('NumberColumn', () => {
|
|
|
55
53
|
doc(p('text'), table()(tr(tdEmpty, tdEmpty, tdEmpty))),
|
|
56
54
|
{ dragAndDropEnabled: true },
|
|
57
55
|
);
|
|
56
|
+
const hoverCellLocationMock = jest.fn();
|
|
58
57
|
const ref = editorView.dom.querySelector('table');
|
|
59
58
|
|
|
60
59
|
const { container } = render(
|
|
@@ -65,6 +64,7 @@ describe('NumberColumn', () => {
|
|
|
65
64
|
editorView={editorView}
|
|
66
65
|
hoverRows={jest.fn()}
|
|
67
66
|
selectRow={jest.fn()}
|
|
67
|
+
updateCellHoverLocation={hoverCellLocationMock}
|
|
68
68
|
isDragAndDropEnabled
|
|
69
69
|
/>
|
|
70
70
|
</IntlProvider>,
|
|
@@ -76,12 +76,7 @@ describe('NumberColumn', () => {
|
|
|
76
76
|
|
|
77
77
|
fireEvent.mouseOver(firstNumberedCell!);
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
// colIndex is not defined yet, keep undefined
|
|
81
|
-
expect(pluginState.hoveredCell).toEqual({
|
|
82
|
-
colIndex: undefined,
|
|
83
|
-
rowIndex: 0,
|
|
84
|
-
});
|
|
79
|
+
expect(hoverCellLocationMock).toHaveBeenCalledWith(0);
|
|
85
80
|
});
|
|
86
81
|
|
|
87
82
|
it('should render button disabled numbered column cells - when drag and drop is enabled', () => {
|
|
@@ -99,6 +94,7 @@ describe('NumberColumn', () => {
|
|
|
99
94
|
editorView={editorView}
|
|
100
95
|
hoverRows={jest.fn()}
|
|
101
96
|
selectRow={jest.fn()}
|
|
97
|
+
updateCellHoverLocation={jest.fn()}
|
|
102
98
|
isDragAndDropEnabled
|
|
103
99
|
/>
|
|
104
100
|
</IntlProvider>,
|
|
@@ -130,6 +126,7 @@ describe('NumberColumn', () => {
|
|
|
130
126
|
editorView={editorView}
|
|
131
127
|
hoverRows={jest.fn()}
|
|
132
128
|
selectRow={jest.fn()}
|
|
129
|
+
updateCellHoverLocation={jest.fn()}
|
|
133
130
|
isDragAndDropEnabled={false}
|
|
134
131
|
/>
|
|
135
132
|
</IntlProvider>,
|
|
@@ -70,6 +70,9 @@ describe('NumberColumn', () => {
|
|
|
70
70
|
tableActive
|
|
71
71
|
editorView={editorView}
|
|
72
72
|
hoveredCell={{ rowIndex: 1, colIndex: 1 }}
|
|
73
|
+
hoverRows={jest.fn()}
|
|
74
|
+
selectRow={jest.fn()}
|
|
75
|
+
updateCellHoverLocation={jest.fn()}
|
|
73
76
|
/>
|
|
74
77
|
</IntlProvider>,
|
|
75
78
|
);
|
|
@@ -105,6 +108,9 @@ describe('NumberColumn', () => {
|
|
|
105
108
|
colIndex: undefined,
|
|
106
109
|
rowIndex: undefined,
|
|
107
110
|
}}
|
|
111
|
+
hoverRows={jest.fn()}
|
|
112
|
+
selectRow={jest.fn()}
|
|
113
|
+
updateCellHoverLocation={jest.fn()}
|
|
108
114
|
/>
|
|
109
115
|
</IntlProvider>,
|
|
110
116
|
);
|