@atlaskit/editor-plugin-table 5.4.3 → 5.4.5
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 +14 -0
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/keymap.js +1 -1
- package/dist/cjs/plugins/table/types.js +1 -1
- package/dist/cjs/plugins/table/ui/DragHandle/HandleIconComponent.js +29 -0
- package/dist/cjs/plugins/table/ui/DragHandle/index.js +21 -20
- package/dist/cjs/plugins/table/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +1 -1
- package/dist/cjs/plugins/table/ui/TableFloatingControls/RowDropTarget/index.js +1 -1
- package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
- package/dist/cjs/plugins/table/ui/consts.js +1 -2
- package/dist/cjs/plugins/table/ui/ui-styles.js +10 -13
- package/dist/cjs/plugins/table/utils/decoration.js +7 -6
- package/dist/es2019/plugins/table/nodeviews/TableComponent.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/keymap.js +1 -1
- package/dist/es2019/plugins/table/types.js +1 -1
- package/dist/es2019/plugins/table/ui/DragHandle/HandleIconComponent.js +24 -0
- package/dist/es2019/plugins/table/ui/DragHandle/index.js +21 -20
- package/dist/es2019/plugins/table/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +1 -1
- package/dist/es2019/plugins/table/ui/TableFloatingControls/RowDropTarget/index.js +1 -1
- package/dist/es2019/plugins/table/ui/common-styles.js +6 -2
- package/dist/es2019/plugins/table/ui/consts.js +0 -1
- package/dist/es2019/plugins/table/ui/ui-styles.js +18 -12
- package/dist/es2019/plugins/table/utils/decoration.js +7 -6
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/keymap.js +1 -1
- package/dist/esm/plugins/table/types.js +1 -1
- package/dist/esm/plugins/table/ui/DragHandle/HandleIconComponent.js +22 -0
- package/dist/esm/plugins/table/ui/DragHandle/index.js +21 -20
- package/dist/esm/plugins/table/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +1 -1
- package/dist/esm/plugins/table/ui/TableFloatingControls/RowDropTarget/index.js +1 -1
- package/dist/esm/plugins/table/ui/common-styles.js +2 -2
- package/dist/esm/plugins/table/ui/consts.js +0 -1
- package/dist/esm/plugins/table/ui/ui-styles.js +10 -13
- package/dist/esm/plugins/table/utils/decoration.js +7 -6
- package/dist/types/plugins/table/types.d.ts +1 -1
- package/dist/types/plugins/table/ui/DragHandle/HandleIconComponent.d.ts +13 -0
- package/dist/types/plugins/table/ui/consts.d.ts +0 -1
- package/dist/types/plugins/table/ui/ui-styles.d.ts +0 -1
- package/dist/types-ts4.5/plugins/table/types.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/DragHandle/HandleIconComponent.d.ts +13 -0
- package/dist/types-ts4.5/plugins/table/ui/consts.d.ts +0 -1
- package/dist/types-ts4.5/plugins/table/ui/ui-styles.d.ts +0 -1
- package/package.json +3 -3
- package/src/__tests__/integration/__fixtures__/basic-table.ts +1 -1
- package/src/__tests__/unit/analytics.ts +1 -1
- package/src/__tests__/unit/collab.ts +1 -1
- package/src/__tests__/unit/commands/sort.ts +1 -1
- package/src/__tests__/unit/copy-paste.ts +1 -1
- package/src/__tests__/unit/event-handlers/index.ts +1 -1
- package/src/__tests__/unit/event-handlers.ts +1 -1
- package/src/__tests__/unit/fix-tables.ts +1 -1
- package/src/__tests__/unit/handlers.ts +1 -1
- package/src/__tests__/unit/hover-selection.ts +1 -1
- package/src/__tests__/unit/index.ts +1 -1
- package/src/__tests__/unit/layout.ts +1 -1
- package/src/__tests__/unit/nodeviews/TableComponent.tsx +1 -1
- package/src/__tests__/unit/nodeviews/TableContainer.tsx +1 -1
- package/src/__tests__/unit/nodeviews/cell.ts +1 -1
- package/src/__tests__/unit/pm-plugins/safari-delete-composition-text-issue-workaround.ts +1 -1
- package/src/__tests__/unit/pm-plugins/table-width.ts +1 -1
- package/src/__tests__/unit/sort-column.ts +1 -1
- package/src/__tests__/unit/transforms/delete-columns.ts +1 -1
- package/src/__tests__/unit/transforms/delete-rows.ts +1 -1
- package/src/__tests__/unit/transforms/merging.ts +1 -1
- package/src/__tests__/unit/ui/ContextualMenu.tsx +1 -1
- package/src/__tests__/unit/ui/CornerControls.tsx +1 -1
- package/src/__tests__/unit/ui/FloatingContextualButton.tsx +1 -1
- package/src/__tests__/unit/ui/FloatingContextualMenu.tsx +1 -1
- package/src/__tests__/unit/ui/FloatingDeleteButton.tsx +1 -1
- package/src/__tests__/unit/ui/FloatingDragMenu.tsx +1 -1
- package/src/__tests__/unit/ui/FloatingInsertButton.tsx +1 -1
- package/src/__tests__/unit/ui/NumberColumn.tsx +1 -1
- package/src/__tests__/unit/ui/RowControls.tsx +1 -1
- package/src/__tests__/unit/ui/RowDragControls.tsx +1 -1
- package/src/__tests__/unit/ui/TableFloatingColumnControls.tsx +1 -1
- package/src/__tests__/unit/ui/TableFloatingControls.tsx +1 -1
- package/src/__tests__/unit/utils/nodes.ts +1 -1
- package/src/__tests__/unit/utils/row-controls.ts +1 -1
- package/src/plugins/table/nodeviews/TableComponent.tsx +2 -2
- package/src/plugins/table/pm-plugins/drag-and-drop/utils/monitor.ts +1 -1
- package/src/plugins/table/pm-plugins/keymap.ts +4 -4
- package/src/plugins/table/types.ts +1 -1
- package/src/plugins/table/ui/DragHandle/HandleIconComponent.tsx +51 -0
- package/src/plugins/table/ui/DragHandle/index.tsx +30 -33
- package/src/plugins/table/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.tsx +1 -1
- package/src/plugins/table/ui/TableFloatingControls/RowDropTarget/index.tsx +1 -1
- package/src/plugins/table/ui/common-styles.ts +5 -2
- package/src/plugins/table/ui/consts.ts +0 -5
- package/src/plugins/table/ui/ui-styles.ts +17 -12
- package/src/plugins/table/utils/decoration.ts +14 -19
- package/src/__tests__/integration/__fixtures__/large-table-with-sticky-header.ts +0 -2311
- package/src/__tests__/integration/__fixtures__/table-and-paragraph-adf.ts +0 -130
- package/src/__tests__/integration/horizontal-scroll-shadows.ts +0 -197
- package/src/__tests__/integration/meta-arrowup-cursor-in-first-row.ts +0 -42
- package/src/__tests__/integration/sticky-header.ts +0 -133
- package/tmp/api-report-tmp.d.ts +0 -100
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31, _templateObject32, _templateObject33, _templateObject34
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31, _templateObject32, _templateObject33, _templateObject34;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { tableCellBorderWidth, tableMarginTop, tableMarginTopWithControl } from '@atlaskit/editor-common/styles';
|
|
5
5
|
import { akEditorShadowZIndex, akEditorTableNumberColumnWidth, akEditorUnitZIndex } from '@atlaskit/editor-shared-styles';
|
|
@@ -7,7 +7,7 @@ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
|
7
7
|
import { B300, N0, N300, N40A, N60A, Y200, Y50 } from '@atlaskit/theme/colors';
|
|
8
8
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
9
9
|
import { TableCssClassName as ClassName } from '../types';
|
|
10
|
-
import { columnControlsDecorationHeight, columnControlsSelectedZIndex, columnControlsZIndex, dragTableInsertColumnButtonSize, insertLineWidth, lineMarkerSize, resizeHandlerAreaWidth, resizeHandlerZIndex, resizeLineWidth, tableBorderColor, tableBorderDeleteColor, tableBorderSelectedColor, tableCellDeleteColor,
|
|
10
|
+
import { columnControlsDecorationHeight, columnControlsSelectedZIndex, columnControlsZIndex, dragTableInsertColumnButtonSize, insertLineWidth, lineMarkerSize, resizeHandlerAreaWidth, resizeHandlerZIndex, resizeLineWidth, tableBorderColor, tableBorderDeleteColor, tableBorderSelectedColor, tableCellDeleteColor, tableCellHoverDeleteIconBackground, tableCellHoverDeleteIconColor, tableCellSelectedDeleteIconBackground, tableCellSelectedDeleteIconColor, tableDeleteButtonSize, tableHeaderCellBackgroundColor, tableInsertColumnButtonSize, tableOverflowShadowWidth, tableOverflowShadowWidthWide, tableToolbarDeleteColor, tableToolbarSelectedColor, tableToolbarSize } from './consts';
|
|
11
11
|
var InsertLine = function InsertLine(props, cssString) {
|
|
12
12
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n background: ", ";\n display: none;\n position: absolute;\n z-index: ", ";\n ", "\n }\n"])), ClassName.CONTROLS_INSERT_LINE, tableBorderSelectedColor(props), akEditorUnitZIndex, cssString);
|
|
13
13
|
};
|
|
@@ -92,31 +92,28 @@ export var columnControlsDecoration = function columnControlsDecoration(props) {
|
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
94
|
export var hoveredDeleteButton = function hoveredDeleteButton(props) {
|
|
95
|
-
return css(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["\n .", ".", " {\n .", ",\n .", ",\n .", " {\n border: 1px solid ", ";\n }\n .", "::after {\n background: ", ";\n }\n }\n"])), ClassName.TABLE_CONTAINER, ClassName.HOVERED_DELETE_BUTTON, ClassName.SELECTED_CELL, ClassName.COLUMN_SELECTED, ClassName.HOVERED_CELL, tableBorderDeleteColor(props), ClassName.SELECTED_CELL, tableCellDeleteColor(props));
|
|
96
|
-
};
|
|
97
|
-
export var disabledCell = function disabledCell(props) {
|
|
98
|
-
return css(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["\n :not(.", ")\n .", ":not(.", ") {\n .", ".", " {\n position: relative;\n border: 1px solid ", ";\n }\n .", ".", "::after {\n border: 1px solid ", ";\n }\n }\n"])), ClassName.IS_RESIZING, ClassName.TABLE_CONTAINER, ClassName.HOVERED_DELETE_BUTTON, ClassName.HOVERED_CELL, ClassName.HOVERED_DISABLED_CELL, tableCellDisabledColor, ClassName.HOVERED_CELL, ClassName.HOVERED_DISABLED_CELL, tableCellDisabledColor);
|
|
95
|
+
return css(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["\n .", ".", " {\n .", ",\n .", ",\n .", " {\n border: 1px solid ", ";\n }\n .", "::after {\n background: ", ";\n }\n\n .", " > table {\n td.", "::after {\n background: ", ";\n border: 1px solid ", ";\n }\n th.", " {\n background-color: unset;\n }\n th.", "::after {\n background: ", ";\n border: 1px solid ", ";\n }\n }\n }\n"])), ClassName.TABLE_CONTAINER, ClassName.HOVERED_DELETE_BUTTON, ClassName.SELECTED_CELL, ClassName.COLUMN_SELECTED, ClassName.HOVERED_CELL, tableBorderDeleteColor(props), ClassName.SELECTED_CELL, tableCellDeleteColor(props), ClassName.TABLE_NODE_WRAPPER, ClassName.HOVERED_NO_HIGHLIGHT, tableCellDeleteColor(props), tableBorderDeleteColor(props), ClassName.HOVERED_NO_HIGHLIGHT, ClassName.HOVERED_NO_HIGHLIGHT, tableCellDeleteColor(props), tableBorderDeleteColor(props));
|
|
99
96
|
};
|
|
100
97
|
export var hoveredCell = function hoveredCell(props) {
|
|
101
|
-
return css(
|
|
98
|
+
return css(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["\n :not(.", ")\n .", ":not(.", ") {\n .", " {\n position: relative;\n border: 1px solid ", ";\n }\n .", ".", " {\n position: relative;\n border: 1px solid ", ";\n }\n }\n"])), ClassName.IS_RESIZING, ClassName.TABLE_CONTAINER, ClassName.HOVERED_DELETE_BUTTON, ClassName.HOVERED_CELL, tableBorderSelectedColor(props), ClassName.HOVERED_CELL, ClassName.HOVERED_NO_HIGHLIGHT, tableBorderColor(props));
|
|
102
99
|
};
|
|
103
|
-
export var hoveredWarningCell = css(
|
|
100
|
+
export var hoveredWarningCell = css(_templateObject29 || (_templateObject29 = _taggedTemplateLiteral(["\n :not(.", ")\n .", ":not(.", ") {\n td.", " {\n background-color: ", " !important; // We need to override the background-color added to the cell\n border: 1px solid ", ";\n }\n }\n"])), ClassName.IS_RESIZING, ClassName.TABLE_CONTAINER, ClassName.HOVERED_DELETE_BUTTON, ClassName.HOVERED_CELL_WARNING, "var(--ds-background-warning, ".concat(Y50, ")"), "var(--ds-border-warning, ".concat(Y200, ")"));
|
|
104
101
|
|
|
105
102
|
// move the resize handle zone completely inside the table cell to avoid overflow
|
|
106
103
|
var getLastColumnResizerOverrides = function getLastColumnResizerOverrides() {
|
|
107
|
-
return getBooleanFF('platform.editor.custom-table-width') ? css(
|
|
104
|
+
return getBooleanFF('platform.editor.custom-table-width') ? css(_templateObject30 || (_templateObject30 = _taggedTemplateLiteral(["\n tr\n th:last-child\n .", ",\n tr\n td:last-child\n .", " {\n background-color: transparent;\n position: absolute;\n width: ", "px;\n height: 100%;\n top: 0;\n right: 0;\n cursor: col-resize;\n z-index: ", ";\n }\n "])), ClassName.RESIZE_HANDLE_DECORATION, ClassName.RESIZE_HANDLE_DECORATION, resizeHandlerAreaWidth / 2, resizeHandlerZIndex) : '';
|
|
108
105
|
};
|
|
109
106
|
var resizeHandleOverrides = function resizeHandleOverrides(props) {
|
|
110
107
|
if (getBooleanFF('platform.editor.table.drag-and-drop')) {
|
|
111
|
-
return css(
|
|
108
|
+
return css(_templateObject31 || (_templateObject31 = _taggedTemplateLiteral(["\n th.", "::before,\n td.", "::before {\n content: ' ';\n position: absolute;\n left: ", ";\n top: -1px;\n width: ", "px;\n height: calc(100% + 2px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before,\n td.", "::before {\n content: ' ';\n position: absolute;\n right: -1px;\n top: -1px;\n width: ", "px;\n height: calc(100% + 2px);\n background-color: ", ";\n z-index: ", ";\n }\n "])), ClassName.WITH_RESIZE_LINE, ClassName.WITH_RESIZE_LINE, "var(--ds-space-negative-025, -2px)", resizeLineWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, ClassName.WITH_RESIZE_LINE_LAST_COLUMN, ClassName.WITH_RESIZE_LINE_LAST_COLUMN, resizeLineWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2);
|
|
112
109
|
}
|
|
113
|
-
return css(
|
|
110
|
+
return css(_templateObject32 || (_templateObject32 = _taggedTemplateLiteral(["\n td.", "::before {\n content: ' ';\n position: absolute;\n left: ", ";\n top: -1px;\n width: ", "px;\n height: calc(100% + 2px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before {\n content: ' ';\n left: ", ";\n position: absolute;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n top: -", "px;\n }\n\n td.", "::before {\n content: ' ';\n position: absolute;\n right: -1px;\n top: -1px;\n width: ", "px;\n height: calc(100% + 2px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before {\n content: ' ';\n right: -1px;\n position: absolute;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n top: -", "px;\n }\n "])), ClassName.WITH_RESIZE_LINE, "var(--ds-space-negative-025, -2px)", resizeLineWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, ClassName.WITH_RESIZE_LINE, "var(--ds-space-negative-025, -2px)", resizeLineWidth, tableToolbarSize + tableCellBorderWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, tableToolbarSize + tableCellBorderWidth, ClassName.WITH_RESIZE_LINE_LAST_COLUMN, resizeLineWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, ClassName.WITH_RESIZE_LINE_LAST_COLUMN, resizeLineWidth, tableToolbarSize + tableCellBorderWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, tableToolbarSize + tableCellBorderWidth);
|
|
114
111
|
};
|
|
115
112
|
export var resizeHandle = function resizeHandle(props) {
|
|
116
|
-
return css(
|
|
113
|
+
return css(_templateObject33 || (_templateObject33 = _taggedTemplateLiteral(["\n .", " {\n .", " {\n background-color: transparent;\n position: absolute;\n width: ", "px;\n height: 100%;\n top: 0;\n right: -", "px;\n cursor: col-resize;\n z-index: ", ";\n }\n\n ", "\n\n ", "\n\n table\n tr:first-of-type\n th.", "\n .", "::after,\n table\n tr:first-of-type\n td.", "\n .", "::after {\n top: -", "px;\n height: calc(100% + ", "px);\n }\n }\n"])), ClassName.TABLE_CONTAINER, ClassName.RESIZE_HANDLE_DECORATION, resizeHandlerAreaWidth, resizeHandlerAreaWidth / 2, resizeHandlerZIndex, getLastColumnResizerOverrides(), resizeHandleOverrides(props), ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, tableToolbarSize + tableCellBorderWidth, tableToolbarSize + tableCellBorderWidth);
|
|
117
114
|
};
|
|
118
115
|
|
|
119
116
|
// Drag and Drop: drop target insert line
|
|
120
117
|
export var insertLine = function insertLine(props) {
|
|
121
|
-
return css(
|
|
118
|
+
return css(_templateObject34 || (_templateObject34 = _taggedTemplateLiteral(["\n .", " {\n td.", "::before {\n content: ' ';\n position: absolute;\n left: -1px;\n top: -1px;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before {\n content: ' ';\n left: -1px;\n position: absolute;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n top: -", "px;\n }\n\n td.", "::before {\n content: ' ';\n position: absolute;\n left: ", ";\n top: -1px;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before {\n content: ' ';\n left: ", ";\n position: absolute;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n top: -", "px;\n }\n\n td.", "::before {\n content: ' ';\n position: absolute;\n right: -1px;\n top: -1px;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before {\n content: ' ';\n right: -1px;\n position: absolute;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n top: -", "px;\n }\n\n td.", "::before {\n content: ' ';\n position: absolute;\n left: ", ";\n top: -1px;\n height: ", "px;\n width: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before {\n content: ' ';\n left: ", ";\n position: absolute;\n height: ", "px;\n width: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n top: -1px;\n }\n\n td.", "::before {\n content: ' ';\n position: absolute;\n left: ", ";\n bottom: 0;\n height: ", "px;\n width: calc(100% + 2px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before {\n content: ' ';\n left: ", ";\n bottom: 0;\n position: absolute;\n height: ", "px;\n width: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n }\n }\n"])), ClassName.TABLE_CONTAINER, ClassName.WITH_FIRST_COLUMN_INSERT_LINE, insertLineWidth, tableCellBorderWidth * 2, tableBorderSelectedColor(props), columnControlsZIndex * 2, ClassName.WITH_FIRST_COLUMN_INSERT_LINE, insertLineWidth, tableCellBorderWidth * 2, tableBorderSelectedColor(props), columnControlsZIndex * 2, tableCellBorderWidth, ClassName.WITH_COLUMN_INSERT_LINE, "var(--ds-space-negative-025, -2px)", insertLineWidth, tableCellBorderWidth * 2, tableBorderSelectedColor(props), columnControlsZIndex * 2, ClassName.WITH_COLUMN_INSERT_LINE, "var(--ds-space-negative-025, -2px)", insertLineWidth, tableCellBorderWidth * 2, tableBorderSelectedColor(props), columnControlsZIndex * 2, tableCellBorderWidth, ClassName.WITH_LAST_COLUMN_INSERT_LINE, insertLineWidth, tableCellBorderWidth * 2, tableBorderSelectedColor(props), columnControlsZIndex * 2, ClassName.WITH_LAST_COLUMN_INSERT_LINE, insertLineWidth, tableCellBorderWidth * 2, tableBorderSelectedColor(props), columnControlsZIndex * 2, tableCellBorderWidth, ClassName.WITH_ROW_INSERT_LINE, "var(--ds-space-negative-025, -2px)", insertLineWidth, tableCellBorderWidth * 2, tableBorderSelectedColor(props), columnControlsZIndex * 2, ClassName.WITH_ROW_INSERT_LINE, "var(--ds-space-negative-025, -2px)", insertLineWidth, tableCellBorderWidth * 2, tableBorderSelectedColor(props), columnControlsZIndex * 2, ClassName.WITH_LAST_ROW_INSERT_LINE, "var(--ds-space-negative-025, -2px)", insertLineWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, ClassName.WITH_LAST_ROW_INSERT_LINE, "var(--ds-space-negative-025, -2px)", insertLineWidth, tableCellBorderWidth * 2, tableBorderSelectedColor(props), columnControlsZIndex * 2);
|
|
122
119
|
};
|
|
@@ -12,7 +12,6 @@ import { findTable, getCellsInRow, getSelectionRect } from '@atlaskit/editor-tab
|
|
|
12
12
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
13
13
|
import { TableCssClassName as ClassName, TableDecorations } from '../types';
|
|
14
14
|
import { ColumnResizeWidget } from '../ui/ColumnResizeWidget';
|
|
15
|
-
import { hasMergedCellsInColumn, hasMergedCellsInRow } from './merged-cells';
|
|
16
15
|
var filterDecorationByKey = function filterDecorationByKey(key, decorationSet) {
|
|
17
16
|
return decorationSet.find(undefined, undefined, function (spec) {
|
|
18
17
|
return spec.key.indexOf(key) > -1;
|
|
@@ -60,8 +59,6 @@ export var createControlsHoverDecoration = function createControlsHoverDecoratio
|
|
|
60
59
|
var updatedCells = cells.map(function (x) {
|
|
61
60
|
return x.pos;
|
|
62
61
|
});
|
|
63
|
-
var hasMergedCells = type === 'row' ? hasMergedCellsInRow(hoveredIndexes[0])(tr.selection) : hasMergedCellsInColumn(hoveredIndexes[0])(tr.selection);
|
|
64
|
-
var disabled = hasMergedCells;
|
|
65
62
|
|
|
66
63
|
// ED-15246 fixed trello card table overflow issue
|
|
67
64
|
// If columns / rows have been merged the hovered selection is different to the actual selection
|
|
@@ -112,10 +109,14 @@ export var createControlsHoverDecoration = function createControlsHoverDecoratio
|
|
|
112
109
|
if (selected) {
|
|
113
110
|
classes.push(ClassName.SELECTED_CELL);
|
|
114
111
|
}
|
|
115
|
-
if (isDragAndDropEnable
|
|
116
|
-
|
|
112
|
+
if (isDragAndDropEnable) {
|
|
113
|
+
if (type === 'column' || type === 'row') {
|
|
114
|
+
classes.pop();
|
|
115
|
+
classes.push(ClassName.HOVERED_NO_HIGHLIGHT);
|
|
116
|
+
}
|
|
117
|
+
} else {
|
|
118
|
+
classes.push(type === 'column' ? ClassName.HOVERED_COLUMN : type === 'row' ? ClassName.HOVERED_ROW : ClassName.HOVERED_TABLE);
|
|
117
119
|
}
|
|
118
|
-
classes.push(type === 'column' ? ClassName.HOVERED_COLUMN : type === 'row' ? ClassName.HOVERED_ROW : ClassName.HOVERED_TABLE);
|
|
119
120
|
var key;
|
|
120
121
|
switch (type) {
|
|
121
122
|
case 'row':
|
|
@@ -306,8 +306,8 @@ export declare const TableCssClassName: {
|
|
|
306
306
|
HOVERED_COLUMN: string;
|
|
307
307
|
HOVERED_ROW: string;
|
|
308
308
|
HOVERED_TABLE: string;
|
|
309
|
+
HOVERED_NO_HIGHLIGHT: string;
|
|
309
310
|
HOVERED_CELL: string;
|
|
310
|
-
HOVERED_DISABLED_CELL: string;
|
|
311
311
|
HOVERED_CELL_IN_DANGER: string;
|
|
312
312
|
HOVERED_CELL_ACTIVE: string;
|
|
313
313
|
HOVERED_CELL_WARNING: string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type HandleIconProps = {
|
|
3
|
+
hasMergedCells: boolean;
|
|
4
|
+
direction: 'row' | 'column';
|
|
5
|
+
isDragMenuOpen: boolean | undefined;
|
|
6
|
+
isRowHandleHovered: boolean;
|
|
7
|
+
isColumnHandleHovered: boolean;
|
|
8
|
+
isCurrentRowSelected: boolean;
|
|
9
|
+
isCurrentColumnSelected: boolean;
|
|
10
|
+
dragMenuDirection: 'row' | 'column' | undefined;
|
|
11
|
+
};
|
|
12
|
+
export declare const HandleIconComponent: (props: HandleIconProps) => JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -13,7 +13,6 @@ export declare const tableBorderSelectedColor: import("@atlaskit/theme").ThemedV
|
|
|
13
13
|
export declare const tableCellSelectedDeleteIconColor: import("@atlaskit/theme").ThemedValue<"var(--ds-icon-subtle)">;
|
|
14
14
|
export declare const tableCellSelectedDeleteIconBackground: import("@atlaskit/theme").ThemedValue<"var(--ds-background-accent-gray-subtlest)">;
|
|
15
15
|
export declare const tableCellDeleteColor: import("@atlaskit/theme").ThemedValue<"var(--ds-blanket-danger)">;
|
|
16
|
-
export declare const tableCellDisabledColor: "var(--ds-background-accent-gray-subtler-hovered)";
|
|
17
16
|
export declare const tableBorderDeleteColor: import("@atlaskit/theme").ThemedValue<"var(--ds-border-danger)">;
|
|
18
17
|
export declare const tableToolbarDeleteColor: import("@atlaskit/theme").ThemedValue<"var(--ds-background-danger-pressed)">;
|
|
19
18
|
export declare const tableCellHoverDeleteIconColor: import("@atlaskit/theme").ThemedValue<"var(--ds-icon-inverse)">;
|
|
@@ -14,7 +14,6 @@ export declare const floatingColumnControls: (props: ThemeProps) => import("@emo
|
|
|
14
14
|
export declare const rowControlsWrapperDotStyle: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
15
15
|
export declare const columnControlsDecoration: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
16
16
|
export declare const hoveredDeleteButton: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
17
|
-
export declare const disabledCell: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
18
17
|
export declare const hoveredCell: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
19
18
|
export declare const hoveredWarningCell: import("@emotion/react").SerializedStyles;
|
|
20
19
|
export declare const resizeHandle: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
@@ -306,8 +306,8 @@ export declare const TableCssClassName: {
|
|
|
306
306
|
HOVERED_COLUMN: string;
|
|
307
307
|
HOVERED_ROW: string;
|
|
308
308
|
HOVERED_TABLE: string;
|
|
309
|
+
HOVERED_NO_HIGHLIGHT: string;
|
|
309
310
|
HOVERED_CELL: string;
|
|
310
|
-
HOVERED_DISABLED_CELL: string;
|
|
311
311
|
HOVERED_CELL_IN_DANGER: string;
|
|
312
312
|
HOVERED_CELL_ACTIVE: string;
|
|
313
313
|
HOVERED_CELL_WARNING: string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type HandleIconProps = {
|
|
3
|
+
hasMergedCells: boolean;
|
|
4
|
+
direction: 'row' | 'column';
|
|
5
|
+
isDragMenuOpen: boolean | undefined;
|
|
6
|
+
isRowHandleHovered: boolean;
|
|
7
|
+
isColumnHandleHovered: boolean;
|
|
8
|
+
isCurrentRowSelected: boolean;
|
|
9
|
+
isCurrentColumnSelected: boolean;
|
|
10
|
+
dragMenuDirection: 'row' | 'column' | undefined;
|
|
11
|
+
};
|
|
12
|
+
export declare const HandleIconComponent: (props: HandleIconProps) => JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -13,7 +13,6 @@ export declare const tableBorderSelectedColor: import("@atlaskit/theme").ThemedV
|
|
|
13
13
|
export declare const tableCellSelectedDeleteIconColor: import("@atlaskit/theme").ThemedValue<"var(--ds-icon-subtle)">;
|
|
14
14
|
export declare const tableCellSelectedDeleteIconBackground: import("@atlaskit/theme").ThemedValue<"var(--ds-background-accent-gray-subtlest)">;
|
|
15
15
|
export declare const tableCellDeleteColor: import("@atlaskit/theme").ThemedValue<"var(--ds-blanket-danger)">;
|
|
16
|
-
export declare const tableCellDisabledColor: "var(--ds-background-accent-gray-subtler-hovered)";
|
|
17
16
|
export declare const tableBorderDeleteColor: import("@atlaskit/theme").ThemedValue<"var(--ds-border-danger)">;
|
|
18
17
|
export declare const tableToolbarDeleteColor: import("@atlaskit/theme").ThemedValue<"var(--ds-background-danger-pressed)">;
|
|
19
18
|
export declare const tableCellHoverDeleteIconColor: import("@atlaskit/theme").ThemedValue<"var(--ds-icon-inverse)">;
|
|
@@ -14,7 +14,6 @@ export declare const floatingColumnControls: (props: ThemeProps) => import("@emo
|
|
|
14
14
|
export declare const rowControlsWrapperDotStyle: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
15
15
|
export declare const columnControlsDecoration: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
16
16
|
export declare const hoveredDeleteButton: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
17
|
-
export declare const disabledCell: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
18
17
|
export declare const hoveredCell: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
19
18
|
export declare const hoveredWarningCell: import("@emotion/react").SerializedStyles;
|
|
20
19
|
export declare const resizeHandle: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.5",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"releaseModel": "continuous"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@atlaskit/adf-schema": "^34.0.
|
|
31
|
-
"@atlaskit/custom-steps": "^0.0.
|
|
30
|
+
"@atlaskit/adf-schema": "^34.0.1",
|
|
31
|
+
"@atlaskit/custom-steps": "^0.0.5",
|
|
32
32
|
"@atlaskit/editor-common": "^76.23.0",
|
|
33
33
|
"@atlaskit/editor-palette": "1.5.2",
|
|
34
34
|
"@atlaskit/editor-plugin-analytics": "^0.3.0",
|
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
import sendKeyToPm from '@atlaskit/editor-test-helpers/send-key-to-pm';
|
|
32
32
|
import { B50 } from '@atlaskit/theme/colors';
|
|
33
33
|
|
|
34
|
+
import tablePlugin from '../../plugins/table-plugin';
|
|
34
35
|
import {
|
|
35
36
|
deleteColumnsWithAnalytics,
|
|
36
37
|
deleteRowsWithAnalytics,
|
|
@@ -51,7 +52,6 @@ import { handleCut } from '../../plugins/table/event-handlers';
|
|
|
51
52
|
import { pluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
52
53
|
import { replaceSelectedTable } from '../../plugins/table/transforms';
|
|
53
54
|
import type { PluginConfig } from '../../plugins/table/types';
|
|
54
|
-
import tablePlugin from '../../plugins/table-plugin';
|
|
55
55
|
|
|
56
56
|
const defaultTableDoc = doc(
|
|
57
57
|
table()(
|
|
@@ -24,10 +24,10 @@ import {
|
|
|
24
24
|
tr,
|
|
25
25
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
26
26
|
|
|
27
|
+
import tablePlugin from '../../plugins/table-plugin';
|
|
27
28
|
import { pluginKey as tablePluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
28
29
|
import { setResizeHandlePos } from '../../plugins/table/pm-plugins/table-resizing/commands';
|
|
29
30
|
import type { PluginConfig } from '../../plugins/table/types';
|
|
30
|
-
import tablePlugin from '../../plugins/table-plugin';
|
|
31
31
|
|
|
32
32
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
33
33
|
|
|
@@ -24,8 +24,8 @@ import {
|
|
|
24
24
|
tr,
|
|
25
25
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
26
26
|
|
|
27
|
-
import { sortByColumn } from '../../../plugins/table/commands/sort';
|
|
28
27
|
import tablePlugin from '../../../plugins/table-plugin';
|
|
28
|
+
import { sortByColumn } from '../../../plugins/table/commands/sort';
|
|
29
29
|
|
|
30
30
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
31
31
|
|
|
@@ -53,6 +53,7 @@ import {
|
|
|
53
53
|
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
54
54
|
import defaultSchema from '@atlaskit/editor-test-helpers/schema';
|
|
55
55
|
|
|
56
|
+
import tablePlugin from '../../plugins/table-plugin';
|
|
56
57
|
import { pluginKey as tablePluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
57
58
|
import type { PluginConfig, TablePluginState } from '../../plugins/table/types';
|
|
58
59
|
import {
|
|
@@ -62,7 +63,6 @@ import {
|
|
|
62
63
|
transformSliceToRemoveOpenTable,
|
|
63
64
|
unwrapContentFromTable,
|
|
64
65
|
} from '../../plugins/table/utils/paste';
|
|
65
|
-
import tablePlugin from '../../plugins/table-plugin';
|
|
66
66
|
|
|
67
67
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
68
68
|
const array = (...args: any): Node[] => args.map((i: any) => i(defaultSchema));
|
|
@@ -23,11 +23,11 @@ import {
|
|
|
23
23
|
tr,
|
|
24
24
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
25
25
|
|
|
26
|
+
import tablePlugin from '../../../plugins/table-plugin';
|
|
26
27
|
import { whenTableInFocus } from '../../../plugins/table/event-handlers';
|
|
27
28
|
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
28
29
|
import { setDragging } from '../../../plugins/table/pm-plugins/table-resizing/commands';
|
|
29
30
|
import type { TablePluginState } from '../../../plugins/table/types';
|
|
30
|
-
import tablePlugin from '../../../plugins/table-plugin';
|
|
31
31
|
|
|
32
32
|
describe('event-handlers', () => {
|
|
33
33
|
let editor: any;
|
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
29
29
|
import { ffTest } from '@atlassian/feature-flags-test-utils';
|
|
30
30
|
|
|
31
|
+
import tablePlugin from '../../plugins/table-plugin';
|
|
31
32
|
import {
|
|
32
33
|
addResizeHandleDecorations,
|
|
33
34
|
showInsertColumnButton,
|
|
@@ -42,7 +43,6 @@ import {
|
|
|
42
43
|
import { getPluginState } from '../../plugins/table/pm-plugins/plugin-factory';
|
|
43
44
|
import { pluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
44
45
|
import { TableCssClassName as ClassName } from '../../plugins/table/types';
|
|
45
|
-
import tablePlugin from '../../plugins/table-plugin';
|
|
46
46
|
|
|
47
47
|
describe('table plugin: decorations', () => {
|
|
48
48
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -23,9 +23,9 @@ import {
|
|
|
23
23
|
tr,
|
|
24
24
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
25
25
|
|
|
26
|
+
import tablePlugin from '../../plugins/table-plugin';
|
|
26
27
|
import { pluginKey as tablePluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
27
28
|
import type { PluginConfig } from '../../plugins/table/types';
|
|
28
|
-
import tablePlugin from '../../plugins/table-plugin';
|
|
29
29
|
|
|
30
30
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
31
31
|
|
|
@@ -23,11 +23,11 @@ import {
|
|
|
23
23
|
tr,
|
|
24
24
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
25
25
|
|
|
26
|
+
import tablePlugin from '../../plugins/table-plugin';
|
|
26
27
|
import { handleDocOrSelectionChanged } from '../../plugins/table/handlers';
|
|
27
28
|
import { defaultTableSelection } from '../../plugins/table/pm-plugins/default-table-selection';
|
|
28
29
|
import { pluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
29
30
|
import type { TablePluginState } from '../../plugins/table/types';
|
|
30
|
-
import tablePlugin from '../../plugins/table-plugin';
|
|
31
31
|
|
|
32
32
|
describe('table action handlers', () => {
|
|
33
33
|
let editor: any;
|
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
32
32
|
import { selectColumns } from '@atlaskit/editor-test-helpers/table';
|
|
33
33
|
|
|
34
|
+
import tablePlugin from '../../plugins/table-plugin';
|
|
34
35
|
import {
|
|
35
36
|
clearHoverSelection,
|
|
36
37
|
hoverColumns,
|
|
@@ -41,7 +42,6 @@ import { getDecorations } from '../../plugins/table/pm-plugins/decorations/plugi
|
|
|
41
42
|
import { pluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
42
43
|
import type { TablePluginState } from '../../plugins/table/types';
|
|
43
44
|
import { TableDecorations } from '../../plugins/table/types';
|
|
44
|
-
import tablePlugin from '../../plugins/table-plugin';
|
|
45
45
|
|
|
46
46
|
describe('table hover selection plugin', () => {
|
|
47
47
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -45,6 +45,7 @@ import {
|
|
|
45
45
|
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
46
46
|
import sendKeyToPm from '@atlaskit/editor-test-helpers/send-key-to-pm';
|
|
47
47
|
|
|
48
|
+
import tablePlugin from '../../plugins/table-plugin';
|
|
48
49
|
import {
|
|
49
50
|
createTable,
|
|
50
51
|
insertColumn,
|
|
@@ -61,7 +62,6 @@ import {
|
|
|
61
62
|
checkIfHeaderRowEnabled,
|
|
62
63
|
checkIfNumberColumnEnabled,
|
|
63
64
|
} from '../../plugins/table/utils';
|
|
64
|
-
import tablePlugin from '../../plugins/table-plugin';
|
|
65
65
|
|
|
66
66
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
67
67
|
|
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
tr,
|
|
26
26
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
27
27
|
|
|
28
|
+
import tablePlugin from '../../plugins/table-plugin';
|
|
28
29
|
import { toggleTableLayout } from '../../plugins/table/commands';
|
|
29
30
|
import { getPluginState } from '../../plugins/table/pm-plugins/plugin-factory';
|
|
30
31
|
import { pluginKey as tablePluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
@@ -32,7 +33,6 @@ import type {
|
|
|
32
33
|
PermittedLayoutsDescriptor,
|
|
33
34
|
TablePluginState,
|
|
34
35
|
} from '../../plugins/table/types';
|
|
35
|
-
import tablePlugin from '../../plugins/table-plugin';
|
|
36
36
|
|
|
37
37
|
describe('table toolbar', () => {
|
|
38
38
|
const tableOptions = {
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
tr,
|
|
28
28
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
29
29
|
|
|
30
|
+
import tablePlugin from '../../../plugins/table-plugin';
|
|
30
31
|
import * as commands from '../../../plugins/table/commands';
|
|
31
32
|
import {
|
|
32
33
|
hoverTable,
|
|
@@ -36,7 +37,6 @@ import TableComponent from '../../../plugins/table/nodeviews/TableComponent';
|
|
|
36
37
|
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
37
38
|
import type { TablePluginState } from '../../../plugins/table/types';
|
|
38
39
|
import { TableCssClassName as ClassName } from '../../../plugins/table/types';
|
|
39
|
-
import tablePlugin from '../../../plugins/table-plugin';
|
|
40
40
|
|
|
41
41
|
jest.mock('../../../plugins/table/utils/nodes', () =>
|
|
42
42
|
Object.assign({}, jest.requireActual('../../../plugins/table/utils/nodes'), {
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
tr,
|
|
24
24
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
25
25
|
|
|
26
|
+
import tablePlugin from '../../../plugins/table-plugin';
|
|
26
27
|
import {
|
|
27
28
|
ResizableTableContainer,
|
|
28
29
|
TableContainer,
|
|
@@ -30,7 +31,6 @@ import {
|
|
|
30
31
|
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
31
32
|
import { pluginKey as tableResizingPluginKey } from '../../../plugins/table/pm-plugins/table-width';
|
|
32
33
|
import type { TablePluginState } from '../../../plugins/table/types';
|
|
33
|
-
import tablePlugin from '../../../plugins/table-plugin';
|
|
34
34
|
|
|
35
35
|
const mockStartMeasure = jest.fn();
|
|
36
36
|
const mockEndMeasure = jest.fn(() => {
|
|
@@ -32,10 +32,10 @@ import {
|
|
|
32
32
|
tr,
|
|
33
33
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
34
34
|
|
|
35
|
+
import tablePlugin from '../../../plugins/table-plugin';
|
|
35
36
|
import TableCell from '../../../plugins/table/nodeviews/TableCell';
|
|
36
37
|
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
37
38
|
import type { PluginConfig } from '../../../plugins/table/types';
|
|
38
|
-
import tablePlugin from '../../../plugins/table-plugin';
|
|
39
39
|
|
|
40
40
|
jest.mock('@atlaskit/editor-common/utils', () => ({
|
|
41
41
|
...jest.requireActual<Object>('@atlaskit/editor-common/utils'),
|
|
@@ -22,8 +22,8 @@ import {
|
|
|
22
22
|
tr,
|
|
23
23
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
24
24
|
|
|
25
|
-
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
26
25
|
import tablePlugin from '../../../plugins/table-plugin';
|
|
26
|
+
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
27
27
|
|
|
28
28
|
describe('table/safari-delete-composition-text-issue-workaround', () => {
|
|
29
29
|
let editor: any;
|
|
@@ -25,8 +25,8 @@ import {
|
|
|
25
25
|
tr,
|
|
26
26
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
27
27
|
|
|
28
|
-
import { pluginKey as tablePluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
29
28
|
import tablePlugin from '../../../plugins/table-plugin';
|
|
29
|
+
import { pluginKey as tablePluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
30
30
|
|
|
31
31
|
const createDoc = (attrs: any) =>
|
|
32
32
|
doc(
|
|
@@ -26,13 +26,13 @@ import {
|
|
|
26
26
|
tr,
|
|
27
27
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
28
28
|
|
|
29
|
+
import tablePlugin from '../../plugins/table-plugin';
|
|
29
30
|
import { sortByColumn } from '../../plugins/table/commands';
|
|
30
31
|
import { pluginKey as tablePluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
31
32
|
import type {
|
|
32
33
|
PermittedLayoutsDescriptor,
|
|
33
34
|
TablePluginState,
|
|
34
35
|
} from '../../plugins/table/types';
|
|
35
|
-
import tablePlugin from '../../plugins/table-plugin';
|
|
36
36
|
|
|
37
37
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
38
38
|
|
|
@@ -29,10 +29,10 @@ import {
|
|
|
29
29
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
30
30
|
import { ffTest } from '@atlassian/feature-flags-test-utils';
|
|
31
31
|
|
|
32
|
+
import tablePlugin from '../../../plugins/table-plugin';
|
|
32
33
|
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
33
34
|
import { deleteColumns } from '../../../plugins/table/transforms';
|
|
34
35
|
import type { TablePluginState } from '../../../plugins/table/types';
|
|
35
|
-
import tablePlugin from '../../../plugins/table-plugin';
|
|
36
36
|
|
|
37
37
|
const colsToRect = (cols: Array<number>, noOfRows: number): Rect => ({
|
|
38
38
|
left: Math.min(...cols),
|
|
@@ -29,10 +29,10 @@ import {
|
|
|
29
29
|
tr,
|
|
30
30
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
31
31
|
|
|
32
|
+
import tablePlugin from '../../../plugins/table-plugin';
|
|
32
33
|
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
33
34
|
import { deleteRows } from '../../../plugins/table/transforms';
|
|
34
35
|
import type { TablePluginState } from '../../../plugins/table/types';
|
|
35
|
-
import tablePlugin from '../../../plugins/table-plugin';
|
|
36
36
|
|
|
37
37
|
const rowsToRect = (rows: Array<number>, noOfColumns: number): Rect => ({
|
|
38
38
|
left: 0,
|
|
@@ -25,10 +25,10 @@ import {
|
|
|
25
25
|
tr,
|
|
26
26
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
27
27
|
|
|
28
|
+
import tablePlugin from '../../../plugins/table-plugin';
|
|
28
29
|
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
29
30
|
import { mergeCells } from '../../../plugins/table/transforms';
|
|
30
31
|
import type { TablePluginState } from '../../../plugins/table/types';
|
|
31
|
-
import tablePlugin from '../../../plugins/table-plugin';
|
|
32
32
|
|
|
33
33
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
34
34
|
|
|
@@ -29,8 +29,8 @@ import {
|
|
|
29
29
|
tr,
|
|
30
30
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
31
31
|
|
|
32
|
-
import { ContextualMenu } from '../../../plugins/table/ui/FloatingContextualMenu/ContextualMenu';
|
|
33
32
|
import tablePlugin from '../../../plugins/table-plugin';
|
|
33
|
+
import { ContextualMenu } from '../../../plugins/table/ui/FloatingContextualMenu/ContextualMenu';
|
|
34
34
|
|
|
35
35
|
describe('ContextualMenu', () => {
|
|
36
36
|
const getEditorContainerWidth = () => ({ width: 500 });
|
|
@@ -27,10 +27,10 @@ import {
|
|
|
27
27
|
tr,
|
|
28
28
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
29
29
|
|
|
30
|
+
import tablePlugin from '../../../plugins/table-plugin';
|
|
30
31
|
import { getPluginState } from '../../../plugins/table/pm-plugins/plugin-factory';
|
|
31
32
|
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
32
33
|
import { CornerControls } from '../../../plugins/table/ui/TableFloatingControls/CornerControls';
|
|
33
|
-
import tablePlugin from '../../../plugins/table-plugin';
|
|
34
34
|
|
|
35
35
|
describe('CornerControls', () => {
|
|
36
36
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -32,9 +32,9 @@ import {
|
|
|
32
32
|
tr,
|
|
33
33
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
34
34
|
|
|
35
|
+
import tablePlugin from '../../../plugins/table-plugin';
|
|
35
36
|
import type { Props as FloatingContextualButtonProps } from '../../../plugins/table/ui/FloatingContextualButton';
|
|
36
37
|
import FloatingContextualButton from '../../../plugins/table/ui/FloatingContextualButton';
|
|
37
|
-
import tablePlugin from '../../../plugins/table-plugin';
|
|
38
38
|
|
|
39
39
|
jest.mock('@atlaskit/editor-prosemirror/utils', () => {
|
|
40
40
|
// Unblock prosemirror bump:
|
|
@@ -29,9 +29,9 @@ import {
|
|
|
29
29
|
tr,
|
|
30
30
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
31
31
|
|
|
32
|
+
import tablePlugin from '../../../plugins/table-plugin';
|
|
32
33
|
import { getPluginState } from '../../../plugins/table/pm-plugins/plugin-factory';
|
|
33
34
|
import FloatingContextualMenu from '../../../plugins/table/ui/FloatingContextualMenu';
|
|
34
|
-
import tablePlugin from '../../../plugins/table-plugin';
|
|
35
35
|
|
|
36
36
|
describe('FloatingContextualMenu', () => {
|
|
37
37
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -20,13 +20,13 @@ import {
|
|
|
20
20
|
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
21
21
|
import { selectColumns, selectRows } from '@atlaskit/editor-test-helpers/table';
|
|
22
22
|
|
|
23
|
+
import tablePlugin from '../../../plugins/table-plugin';
|
|
23
24
|
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
24
25
|
import type { TablePluginState } from '../../../plugins/table/types';
|
|
25
26
|
import { TableCssClassName } from '../../../plugins/table/types';
|
|
26
27
|
import type { Props as FloatingDeleteButtonProps } from '../../../plugins/table/ui/FloatingDeleteButton';
|
|
27
28
|
import FloatingDeleteButton from '../../../plugins/table/ui/FloatingDeleteButton';
|
|
28
29
|
import * as tableColumnControlsUtils from '../../../plugins/table/utils/column-controls';
|
|
29
|
-
import tablePlugin from '../../../plugins/table-plugin';
|
|
30
30
|
|
|
31
31
|
describe('Floating Delete Button', () => {
|
|
32
32
|
const createEditor = createEditorFactory<TablePluginState>();
|