@atlaskit/editor-plugin-table 5.3.13 → 5.3.15
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 +16 -0
- package/dist/cjs/plugins/table/event-handlers.js +6 -3
- package/dist/cjs/plugins/table/index.js +6 -4
- package/dist/cjs/plugins/table/pm-plugins/decorations/plugin.js +3 -7
- package/dist/cjs/plugins/table/pm-plugins/decorations/utils/column-controls.js +1 -3
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/plugin.js +11 -0
- package/dist/cjs/plugins/table/types.js +9 -2
- package/dist/cjs/plugins/table/ui/FloatingDragMenu/DragMenu.js +49 -11
- package/dist/cjs/plugins/table/ui/FloatingDragMenu/index.js +10 -5
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/InsertButton.js +57 -9
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/getPopupOptions.js +9 -7
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +13 -4
- package/dist/cjs/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.js +44 -5
- package/dist/cjs/plugins/table/ui/TableFloatingColumnControls/index.js +6 -4
- package/dist/cjs/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +35 -13
- package/dist/cjs/plugins/table/ui/TableFloatingControls/index.js +2 -0
- package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
- package/dist/cjs/plugins/table/ui/icons/AddColLeftIcon.js +44 -0
- package/dist/cjs/plugins/table/ui/icons/AddColRightIcon.js +44 -0
- package/dist/cjs/plugins/table/ui/icons/AddRowAboveIcon.js +45 -0
- package/dist/cjs/plugins/table/ui/icons/AddRowBelowIcon.js +40 -0
- package/dist/cjs/plugins/table/ui/icons/index.js +29 -1
- package/dist/cjs/plugins/table/ui/ui-styles.js +27 -24
- package/dist/cjs/plugins/table/utils/dom.js +12 -4
- package/dist/cjs/plugins/table/utils/drag-menu.js +122 -10
- package/dist/cjs/plugins/table/utils/index.js +12 -0
- package/dist/es2019/plugins/table/event-handlers.js +5 -4
- package/dist/es2019/plugins/table/index.js +6 -4
- package/dist/es2019/plugins/table/pm-plugins/decorations/plugin.js +3 -7
- package/dist/es2019/plugins/table/pm-plugins/decorations/utils/column-controls.js +1 -3
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/plugin.js +12 -0
- package/dist/es2019/plugins/table/types.js +9 -2
- package/dist/es2019/plugins/table/ui/FloatingDragMenu/DragMenu.js +52 -8
- package/dist/es2019/plugins/table/ui/FloatingDragMenu/index.js +10 -5
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/InsertButton.js +58 -7
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/getPopupOptions.js +9 -7
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +10 -4
- package/dist/es2019/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.js +46 -6
- package/dist/es2019/plugins/table/ui/TableFloatingColumnControls/index.js +7 -5
- package/dist/es2019/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +35 -14
- package/dist/es2019/plugins/table/ui/TableFloatingControls/index.js +2 -0
- package/dist/es2019/plugins/table/ui/common-styles.js +51 -3
- package/dist/es2019/plugins/table/ui/icons/AddColLeftIcon.js +35 -0
- package/dist/es2019/plugins/table/ui/icons/AddColRightIcon.js +35 -0
- package/dist/es2019/plugins/table/ui/icons/AddRowAboveIcon.js +36 -0
- package/dist/es2019/plugins/table/ui/icons/AddRowBelowIcon.js +31 -0
- package/dist/es2019/plugins/table/ui/icons/index.js +5 -1
- package/dist/es2019/plugins/table/ui/ui-styles.js +23 -1
- package/dist/es2019/plugins/table/utils/dom.js +5 -1
- package/dist/es2019/plugins/table/utils/drag-menu.js +118 -8
- package/dist/es2019/plugins/table/utils/index.js +1 -1
- package/dist/esm/plugins/table/event-handlers.js +7 -4
- package/dist/esm/plugins/table/index.js +6 -4
- package/dist/esm/plugins/table/pm-plugins/decorations/plugin.js +3 -7
- package/dist/esm/plugins/table/pm-plugins/decorations/utils/column-controls.js +1 -3
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/plugin.js +11 -0
- package/dist/esm/plugins/table/types.js +9 -2
- package/dist/esm/plugins/table/ui/FloatingDragMenu/DragMenu.js +46 -8
- package/dist/esm/plugins/table/ui/FloatingDragMenu/index.js +10 -5
- package/dist/esm/plugins/table/ui/FloatingInsertButton/InsertButton.js +56 -8
- package/dist/esm/plugins/table/ui/FloatingInsertButton/getPopupOptions.js +9 -7
- package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +10 -4
- package/dist/esm/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.js +45 -6
- package/dist/esm/plugins/table/ui/TableFloatingColumnControls/index.js +7 -5
- package/dist/esm/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +36 -14
- package/dist/esm/plugins/table/ui/TableFloatingControls/index.js +2 -0
- package/dist/esm/plugins/table/ui/common-styles.js +2 -2
- package/dist/esm/plugins/table/ui/icons/AddColLeftIcon.js +37 -0
- package/dist/esm/plugins/table/ui/icons/AddColRightIcon.js +37 -0
- package/dist/esm/plugins/table/ui/icons/AddRowAboveIcon.js +38 -0
- package/dist/esm/plugins/table/ui/icons/AddRowBelowIcon.js +33 -0
- package/dist/esm/plugins/table/ui/icons/index.js +5 -1
- package/dist/esm/plugins/table/ui/ui-styles.js +26 -23
- package/dist/esm/plugins/table/utils/dom.js +11 -3
- package/dist/esm/plugins/table/utils/drag-menu.js +120 -8
- package/dist/esm/plugins/table/utils/index.js +1 -1
- package/dist/types/plugins/table/types.d.ts +9 -2
- package/dist/types/plugins/table/ui/FloatingDragMenu/DragMenu.d.ts +5 -2
- package/dist/types/plugins/table/ui/FloatingDragMenu/index.d.ts +3 -1
- package/dist/types/plugins/table/ui/FloatingInsertButton/InsertButton.d.ts +5 -1
- package/dist/types/plugins/table/ui/FloatingInsertButton/getPopupOptions.d.ts +1 -1
- package/dist/types/plugins/table/ui/FloatingInsertButton/index.d.ts +1 -0
- package/dist/types/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -1
- package/dist/types/plugins/table/ui/TableFloatingControls/RowControls/DragControls.d.ts +2 -0
- package/dist/types/plugins/table/ui/icons/AddColLeftIcon.d.ts +2 -0
- package/dist/types/plugins/table/ui/icons/AddColRightIcon.d.ts +2 -0
- package/dist/types/plugins/table/ui/icons/AddRowAboveIcon.d.ts +2 -0
- package/dist/types/plugins/table/ui/icons/AddRowBelowIcon.d.ts +2 -0
- package/dist/types/plugins/table/ui/icons/index.d.ts +4 -0
- package/dist/types/plugins/table/ui/ui-styles.d.ts +1 -0
- package/dist/types/plugins/table/utils/dom.d.ts +4 -1
- package/dist/types/plugins/table/utils/drag-menu.d.ts +6 -3
- package/dist/types/plugins/table/utils/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/types.d.ts +9 -2
- package/dist/types-ts4.5/plugins/table/ui/FloatingDragMenu/DragMenu.d.ts +5 -2
- package/dist/types-ts4.5/plugins/table/ui/FloatingDragMenu/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/InsertButton.d.ts +5 -1
- package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/getPopupOptions.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/index.d.ts +1 -0
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -1
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/RowControls/DragControls.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/ui/icons/AddColLeftIcon.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/ui/icons/AddColRightIcon.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/ui/icons/AddRowAboveIcon.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/ui/icons/AddRowBelowIcon.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/ui/icons/index.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/ui/ui-styles.d.ts +1 -0
- package/dist/types-ts4.5/plugins/table/utils/dom.d.ts +4 -1
- package/dist/types-ts4.5/plugins/table/utils/drag-menu.d.ts +6 -3
- package/dist/types-ts4.5/plugins/table/utils/index.d.ts +1 -1
- package/package.json +2 -1
- package/src/__tests__/unit/pm-plugins/decorations/plugin.ts +40 -194
- package/src/__tests__/unit/ui/RowDragControls.tsx +9 -11
- package/src/plugins/table/event-handlers.ts +15 -3
- package/src/plugins/table/index.tsx +4 -2
- package/src/plugins/table/pm-plugins/decorations/plugin.ts +2 -9
- package/src/plugins/table/pm-plugins/decorations/utils/column-controls.ts +1 -3
- package/src/plugins/table/pm-plugins/drag-and-drop/plugin.ts +9 -0
- package/src/plugins/table/types.ts +12 -2
- package/src/plugins/table/ui/FloatingDragMenu/DragMenu.tsx +73 -6
- package/src/plugins/table/ui/FloatingDragMenu/index.tsx +15 -3
- package/src/plugins/table/ui/FloatingInsertButton/InsertButton.tsx +82 -8
- package/src/plugins/table/ui/FloatingInsertButton/getPopupOptions.ts +28 -5
- package/src/plugins/table/ui/FloatingInsertButton/index.tsx +19 -7
- package/src/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.tsx +47 -3
- package/src/plugins/table/ui/TableFloatingColumnControls/index.tsx +11 -4
- package/src/plugins/table/ui/TableFloatingControls/RowControls/DragControls.tsx +49 -18
- package/src/plugins/table/ui/TableFloatingControls/index.tsx +2 -0
- package/src/plugins/table/ui/common-styles.ts +57 -2
- package/src/plugins/table/ui/icons/AddColLeftIcon.tsx +43 -0
- package/src/plugins/table/ui/icons/AddColRightIcon.tsx +43 -0
- package/src/plugins/table/ui/icons/AddRowAboveIcon.tsx +42 -0
- package/src/plugins/table/ui/icons/AddRowBelowIcon.tsx +36 -0
- package/src/plugins/table/ui/icons/index.ts +4 -0
- package/src/plugins/table/ui/ui-styles.ts +27 -1
- package/src/plugins/table/utils/dom.ts +11 -4
- package/src/plugins/table/utils/drag-menu.ts +158 -5
- package/src/plugins/table/utils/index.ts +2 -0
- package/tsconfig.app.json +3 -0
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import { TableSortOrder as SortOrder } from '@atlaskit/custom-steps';
|
|
3
|
+
import { addColumnAfter, addColumnBefore, addRowAfter, addRowBefore, backspace, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
4
|
+
import ArrowDownIcon from '@atlaskit/icon/glyph/arrow-down';
|
|
5
|
+
import ArrowLeftIcon from '@atlaskit/icon/glyph/arrow-left';
|
|
6
|
+
import ArrowRightIcon from '@atlaskit/icon/glyph/arrow-right';
|
|
7
|
+
import ArrowUpIcon from '@atlaskit/icon/glyph/arrow-up';
|
|
8
|
+
import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';
|
|
9
|
+
import EditorLayoutThreeEqualIcon from '@atlaskit/icon/glyph/editor/layout-three-equal';
|
|
10
|
+
import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
11
|
+
import HipchatChevronDoubleDownIcon from '@atlaskit/icon/glyph/hipchat/chevron-double-down';
|
|
12
|
+
import HipchatChevronDoubleUpIcon from '@atlaskit/icon/glyph/hipchat/chevron-double-up';
|
|
13
|
+
import { clearMultipleCells, insertColumn, insertRow, sortByColumn } from '../commands';
|
|
14
|
+
import { deleteColumnsCommand } from '../commands/delete';
|
|
2
15
|
import { moveSource } from '../pm-plugins/drag-and-drop/commands';
|
|
16
|
+
import { deleteRows } from '../transforms';
|
|
17
|
+
import { AddColLeftIcon, AddColRightIcon, AddRowAboveIcon, AddRowBelowIcon } from '../ui/icons';
|
|
3
18
|
var canDecrease = function canDecrease(index) {
|
|
4
19
|
var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
5
20
|
return index !== undefined && index > min;
|
|
@@ -8,38 +23,122 @@ var canIncrease = function canIncrease(index) {
|
|
|
8
23
|
var max = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
9
24
|
return index !== undefined && index < max;
|
|
10
25
|
};
|
|
11
|
-
export var getDragMenuConfig = function getDragMenuConfig(direction, tableMap, index) {
|
|
26
|
+
export var getDragMenuConfig = function getDragMenuConfig(direction, getEditorContainerWidth, tableMap, index, targetCellPosition, selectionRect) {
|
|
27
|
+
var addOptions = direction === 'row' ? [{
|
|
28
|
+
label: 'above',
|
|
29
|
+
offset: 0,
|
|
30
|
+
icon: AddRowAboveIcon,
|
|
31
|
+
keymap: addRowBefore
|
|
32
|
+
}, {
|
|
33
|
+
label: 'below',
|
|
34
|
+
offset: 1,
|
|
35
|
+
icon: AddRowBelowIcon,
|
|
36
|
+
keymap: addRowAfter
|
|
37
|
+
}] : [{
|
|
38
|
+
label: 'left',
|
|
39
|
+
offset: 0,
|
|
40
|
+
icon: AddColLeftIcon,
|
|
41
|
+
keymap: addColumnBefore
|
|
42
|
+
}, {
|
|
43
|
+
label: 'right',
|
|
44
|
+
offset: 1,
|
|
45
|
+
icon: AddColRightIcon,
|
|
46
|
+
keymap: addColumnAfter
|
|
47
|
+
}];
|
|
12
48
|
var moveOptions = direction === 'row' ? [{
|
|
13
49
|
label: 'up',
|
|
14
50
|
offset: -1,
|
|
15
|
-
canMove: canDecrease
|
|
51
|
+
canMove: canDecrease,
|
|
52
|
+
icon: ArrowUpIcon
|
|
16
53
|
}, {
|
|
17
54
|
label: 'down',
|
|
18
55
|
offset: 1,
|
|
19
56
|
canMove: function canMove(index) {
|
|
20
57
|
var _tableMap$height;
|
|
21
58
|
return canIncrease(index, ((_tableMap$height = tableMap === null || tableMap === void 0 ? void 0 : tableMap.height) !== null && _tableMap$height !== void 0 ? _tableMap$height : 0) - 1);
|
|
22
|
-
}
|
|
59
|
+
},
|
|
60
|
+
icon: ArrowDownIcon
|
|
23
61
|
}] : [{
|
|
24
62
|
label: 'left',
|
|
25
63
|
offset: -1,
|
|
26
|
-
canMove: canDecrease
|
|
64
|
+
canMove: canDecrease,
|
|
65
|
+
icon: ArrowLeftIcon
|
|
27
66
|
}, {
|
|
28
67
|
label: 'right',
|
|
29
68
|
offset: 1,
|
|
30
69
|
canMove: function canMove(index) {
|
|
31
70
|
var _tableMap$width;
|
|
32
71
|
return canIncrease(index, ((_tableMap$width = tableMap === null || tableMap === void 0 ? void 0 : tableMap.width) !== null && _tableMap$width !== void 0 ? _tableMap$width : 0) - 1);
|
|
33
|
-
}
|
|
72
|
+
},
|
|
73
|
+
icon: ArrowRightIcon
|
|
34
74
|
}];
|
|
35
|
-
|
|
75
|
+
var sortOptions = direction === 'column' ? [{
|
|
76
|
+
label: 'increasing',
|
|
77
|
+
order: SortOrder.ASC,
|
|
78
|
+
icon: HipchatChevronDoubleUpIcon
|
|
79
|
+
}, {
|
|
80
|
+
label: 'decreasing',
|
|
81
|
+
order: SortOrder.DESC,
|
|
82
|
+
icon: HipchatChevronDoubleDownIcon
|
|
83
|
+
}] : [];
|
|
84
|
+
return [].concat(_toConsumableArray(addOptions.map(function (_ref) {
|
|
36
85
|
var label = _ref.label,
|
|
37
86
|
offset = _ref.offset,
|
|
38
|
-
|
|
87
|
+
icon = _ref.icon,
|
|
88
|
+
keymap = _ref.keymap;
|
|
89
|
+
return {
|
|
90
|
+
id: "add_".concat(direction, "_").concat(label),
|
|
91
|
+
title: "Add ".concat(direction, " ").concat(label),
|
|
92
|
+
icon: icon,
|
|
93
|
+
onClick: function onClick(state, dispatch) {
|
|
94
|
+
if (direction === 'row') {
|
|
95
|
+
insertRow(index + offset, true)(state, dispatch);
|
|
96
|
+
} else {
|
|
97
|
+
insertColumn(getEditorContainerWidth)(index + offset)(state, dispatch);
|
|
98
|
+
}
|
|
99
|
+
return true;
|
|
100
|
+
},
|
|
101
|
+
keymap: keymap && tooltip(keymap)
|
|
102
|
+
};
|
|
103
|
+
})), [direction === 'column' ? {
|
|
104
|
+
id: 'distribute_columns',
|
|
105
|
+
title: 'Distribute columns',
|
|
106
|
+
disabled: true,
|
|
107
|
+
onClick: function onClick() {
|
|
108
|
+
return false;
|
|
109
|
+
},
|
|
110
|
+
icon: EditorLayoutThreeEqualIcon
|
|
111
|
+
} : undefined, {
|
|
112
|
+
id: 'clear_cells',
|
|
113
|
+
title: 'Clear cells',
|
|
114
|
+
onClick: function onClick(state, dispatch) {
|
|
115
|
+
clearMultipleCells(targetCellPosition)(state, dispatch);
|
|
116
|
+
return true;
|
|
117
|
+
},
|
|
118
|
+
icon: CrossCircleIcon,
|
|
119
|
+
keymap: tooltip(backspace)
|
|
120
|
+
}, {
|
|
121
|
+
id: "delete_".concat(direction),
|
|
122
|
+
title: "Delete ".concat(direction),
|
|
123
|
+
onClick: function onClick(state, dispatch) {
|
|
124
|
+
if (direction === 'row') {
|
|
125
|
+
dispatch === null || dispatch === void 0 || dispatch(deleteRows(selectionRect, false)(state.tr));
|
|
126
|
+
} else {
|
|
127
|
+
deleteColumnsCommand(selectionRect)(state, dispatch);
|
|
128
|
+
}
|
|
129
|
+
return true;
|
|
130
|
+
},
|
|
131
|
+
icon: RemoveIcon
|
|
132
|
+
}], _toConsumableArray(moveOptions.map(function (_ref2) {
|
|
133
|
+
var label = _ref2.label,
|
|
134
|
+
offset = _ref2.offset,
|
|
135
|
+
canMove = _ref2.canMove,
|
|
136
|
+
icon = _ref2.icon;
|
|
39
137
|
return {
|
|
40
138
|
id: "move_".concat(direction, "_").concat(label),
|
|
41
139
|
title: "Move ".concat(direction, " ").concat(label),
|
|
42
140
|
disabled: !canMove(index),
|
|
141
|
+
icon: icon,
|
|
43
142
|
onClick: function onClick(state, dispatch) {
|
|
44
143
|
if (canMove(index)) {
|
|
45
144
|
moveSource("table-".concat(direction), index, index + offset)(state, dispatch);
|
|
@@ -48,5 +147,18 @@ export var getDragMenuConfig = function getDragMenuConfig(direction, tableMap, i
|
|
|
48
147
|
return false;
|
|
49
148
|
}
|
|
50
149
|
};
|
|
51
|
-
}))
|
|
150
|
+
})), _toConsumableArray(sortOptions.map(function (_ref3) {
|
|
151
|
+
var label = _ref3.label,
|
|
152
|
+
order = _ref3.order,
|
|
153
|
+
icon = _ref3.icon;
|
|
154
|
+
return {
|
|
155
|
+
id: "sort_column_".concat(order),
|
|
156
|
+
title: "Sort ".concat(label),
|
|
157
|
+
icon: icon,
|
|
158
|
+
onClick: function onClick(state, dispatch) {
|
|
159
|
+
sortByColumn(index, order)(state, dispatch);
|
|
160
|
+
return true;
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
}))).filter(Boolean);
|
|
52
164
|
};
|
|
@@ -2,7 +2,7 @@ export { getSelectedColumnIndexes, getSelectedRowIndexes, normalizeSelection, is
|
|
|
2
2
|
export { findControlsHoverDecoration, createControlsHoverDecoration, createColumnControlsDecoration, createColumnSelectedDecoration, createCellHoverDecoration, updateDecorations, createResizeHandleDecoration, createColumnInsertLine, createColumnLineResize, createRowInsertLine } from './decoration';
|
|
3
3
|
export { isIsolating, containsHeaderColumn, containsHeaderRow, checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled, isLayoutSupported, getTableWidth, tablesHaveDifferentColumnWidths, tablesHaveDifferentNoOfColumns, isTableNested, anyChildCellMergedAcrossRow, supportedHeaderRow } from './nodes';
|
|
4
4
|
export { unwrapContentFromTable, removeTableFromFirstChild, removeTableFromLastChild, transformSliceToRemoveOpenTable, transformSliceToCorrectEmptyTableCells, transformSliceToFixHardBreakProblemOnCopyFromCell } from './paste';
|
|
5
|
-
export { isCell, isCornerButton, isInsertRowButton, isColumnControlsDecorations, isTableControlsButton, isTableContainerOrWrapper, isRowDragControlsButton, isRowControlsButton, getColumnOrRowIndex, getMousePositionHorizontalRelativeByElement, getMousePositionVerticalRelativeByElement, updateResizeHandles, isResizeHandleDecoration, hasResizeHandler } from './dom';
|
|
5
|
+
export { isCell, isCornerButton, isInsertRowButton, isColumnControlsDecorations, isTableControlsButton, isTableContainerOrWrapper, isRowDragControlsButton, isRowControlsButton, isDragColumnFloatingInsertDot, isDragRowFloatingInsertDot, getColumnOrRowIndex, getMousePositionHorizontalRelativeByElement, getMousePositionVerticalRelativeByElement, updateResizeHandles, isResizeHandleDecoration, hasResizeHandler } from './dom';
|
|
6
6
|
export { getColumnsWidths, isColumnDeleteButtonVisible, getColumnDeleteButtonParams, getColumnClassNames } from './column-controls';
|
|
7
7
|
export { getRowHeights, isRowDeleteButtonVisible, getRowDeleteButtonParams, getRowsParams, getRowClassNames, copyPreviousRow } from './row-controls';
|
|
8
8
|
export { getSelectedTableInfo, getSelectedCellInfo } from './analytics';
|
|
@@ -269,6 +269,9 @@ export declare const TableCssClassName: {
|
|
|
269
269
|
CONTROLS_INSERT_LINE: string;
|
|
270
270
|
CONTROLS_BUTTON_OVERLAY: string;
|
|
271
271
|
LAYOUT_BUTTON: string;
|
|
272
|
+
DRAG_CONTROLS_INSERT_BUTTON: string;
|
|
273
|
+
DRAG_CONTROLS_INSERT_BUTTON_INNER: string;
|
|
274
|
+
DRAG_CONTROLS_INSERT_BUTTON_WRAP: string;
|
|
272
275
|
CONTROLS_INSERT_MARKER: string;
|
|
273
276
|
CONTROLS_INSERT_COLUMN: string;
|
|
274
277
|
CONTROLS_INSERT_ROW: string;
|
|
@@ -281,8 +284,12 @@ export declare const TableCssClassName: {
|
|
|
281
284
|
CORNER_CONTROLS_INSERT_COLUMN_MARKER: string;
|
|
282
285
|
CONTROLS_CORNER_BUTTON: string;
|
|
283
286
|
/** Controls with drag handle */
|
|
284
|
-
|
|
285
|
-
|
|
287
|
+
DRAG_ROW_CONTROLS: string;
|
|
288
|
+
DRAG_ROW_FLOATING_INSERT_DOT_WRAPPER: string;
|
|
289
|
+
DRAG_ROW_FLOATING_INSERT_DOT: string;
|
|
290
|
+
DRAG_COLUMN_CONTROLS: string;
|
|
291
|
+
DRAG_COLUMN_FLOATING_INSERT_DOT_WRAPPER: string;
|
|
292
|
+
DRAG_COLUMN_FLOATING_INSERT_DOT: string;
|
|
286
293
|
DRAG_HANDLE_BUTTON_CONTAINER: string;
|
|
287
294
|
/** Other classes */
|
|
288
295
|
NUMBERED_COLUMN: string;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
2
4
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
6
|
import type { PluginConfig, TableDirection } from '../../types';
|
|
@@ -14,6 +16,7 @@ type DragMenuProps = {
|
|
|
14
16
|
boundariesElement?: HTMLElement;
|
|
15
17
|
scrollableElement?: HTMLElement;
|
|
16
18
|
pluginConfig?: PluginConfig;
|
|
19
|
+
getEditorContainerWidth: GetEditorContainerWidth;
|
|
17
20
|
};
|
|
18
|
-
export declare const DragMenu: ({ direction, index, isOpen, editorView, tableNode, mountPoint, boundariesElement, scrollableElement, }: DragMenuProps) => JSX.Element | null;
|
|
21
|
+
export declare const DragMenu: ({ direction, index, isOpen, editorView, tableNode, mountPoint, boundariesElement, scrollableElement, targetCellPosition, getEditorContainerWidth, }: DragMenuProps) => jsx.JSX.Element | null;
|
|
19
22
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
2
3
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
5
|
import type { TableDirection } from '../../types';
|
|
@@ -13,9 +14,10 @@ export interface Props {
|
|
|
13
14
|
direction?: TableDirection;
|
|
14
15
|
index?: number;
|
|
15
16
|
targetCellPosition?: number;
|
|
17
|
+
getEditorContainerWidth: GetEditorContainerWidth;
|
|
16
18
|
}
|
|
17
19
|
declare const FloatingDragMenu: {
|
|
18
|
-
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, tableRef, tableNode, direction, index, targetCellPosition, }: Props): JSX.Element | null;
|
|
20
|
+
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, tableRef, tableNode, direction, index, targetCellPosition, getEditorContainerWidth, }: Props): JSX.Element | null;
|
|
19
21
|
displayName: string;
|
|
20
22
|
};
|
|
21
23
|
export default FloatingDragMenu;
|
|
@@ -3,11 +3,15 @@ import React from 'react';
|
|
|
3
3
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
4
4
|
import type { TableDirection } from '../../types';
|
|
5
5
|
export interface ButtonProps {
|
|
6
|
-
|
|
6
|
+
type: TableDirection;
|
|
7
7
|
tableRef: HTMLElement;
|
|
8
8
|
onMouseDown: (event: SyntheticEvent<HTMLButtonElement>) => void;
|
|
9
9
|
hasStickyHeaders: boolean;
|
|
10
10
|
}
|
|
11
|
+
export declare const InsertButtonForDragAndDrop: ({ onMouseDown, tableRef, type, intl: { formatMessage }, hasStickyHeaders, }: ButtonProps & WrappedComponentProps) => JSX.Element;
|
|
12
|
+
export declare const DragAndDropInsertButton: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps<"intl">>> & {
|
|
13
|
+
WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps<"intl">>;
|
|
14
|
+
};
|
|
11
15
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps<"intl">>> & {
|
|
12
16
|
WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps<"intl">>;
|
|
13
17
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { PopupProps } from '@atlaskit/editor-common/ui';
|
|
2
2
|
import type { TableDirection } from '../../types';
|
|
3
|
-
declare function getPopupOptions(direction: TableDirection, index: number, hasNumberedColumns: boolean, tableContainer: HTMLElement | null): Partial<PopupProps>;
|
|
3
|
+
declare function getPopupOptions(direction: TableDirection, index: number, hasNumberedColumns: boolean, isDragAndDropEnabled: boolean, tableContainer: HTMLElement | null): Partial<PopupProps>;
|
|
4
4
|
export default getPopupOptions;
|
|
@@ -13,6 +13,7 @@ export interface Props {
|
|
|
13
13
|
insertRowButtonIndex?: number;
|
|
14
14
|
isHeaderColumnEnabled?: boolean;
|
|
15
15
|
isHeaderRowEnabled?: boolean;
|
|
16
|
+
isDragAndDropEnabled?: boolean;
|
|
16
17
|
mountPoint?: HTMLElement;
|
|
17
18
|
boundariesElement?: HTMLElement;
|
|
18
19
|
scrollableElement?: HTMLElement;
|
|
@@ -12,6 +12,7 @@ export interface ColumnControlsProps {
|
|
|
12
12
|
localId?: string;
|
|
13
13
|
rowHeights?: number[];
|
|
14
14
|
colWidths?: (number | undefined)[];
|
|
15
|
+
hasHeaderColumn?: boolean;
|
|
15
16
|
}
|
|
16
|
-
export declare const ColumnControls: ({ editorView, tableActive, tableRef, hoveredCell, isResizing, stickyTop, localId, isInDanger, rowHeights, colWidths, }: ColumnControlsProps) => JSX.Element;
|
|
17
|
+
export declare const ColumnControls: ({ editorView, tableActive, tableRef, hoveredCell, isResizing, stickyTop, localId, isInDanger, rowHeights, colWidths, hasHeaderColumn, }: ColumnControlsProps) => JSX.Element;
|
|
17
18
|
export default ColumnControls;
|
|
@@ -10,6 +10,8 @@ type DragControlsProps = {
|
|
|
10
10
|
tableActive?: boolean;
|
|
11
11
|
hoveredCell?: CellHoverMeta;
|
|
12
12
|
isInDanger?: boolean;
|
|
13
|
+
isResizing?: boolean;
|
|
14
|
+
hasHeaderRow?: boolean;
|
|
13
15
|
hoverRows: (rows: number[], danger?: boolean) => void;
|
|
14
16
|
selectRow: (row: number, expand: boolean) => void;
|
|
15
17
|
updateCellHoverLocation: (rowIndex: number) => void;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
export { DragHandleIcon } from './DragHandleIcon';
|
|
2
2
|
export { DragInMotionIcon } from './DragInMotionIcon';
|
|
3
|
+
export { AddRowAboveIcon } from './AddRowAboveIcon';
|
|
4
|
+
export { AddRowBelowIcon } from './AddRowBelowIcon';
|
|
5
|
+
export { AddColLeftIcon } from './AddColLeftIcon';
|
|
6
|
+
export { AddColRightIcon } from './AddColRightIcon';
|
|
@@ -3,6 +3,7 @@ export declare const InsertMarker: (props: ThemeProps, cssString?: string) => im
|
|
|
3
3
|
export declare const HeaderButton: (props: ThemeProps, cssString?: string) => import("@emotion/react").SerializedStyles;
|
|
4
4
|
export declare const HeaderButtonHover: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
5
5
|
export declare const HeaderButtonDanger: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
6
|
+
export declare const dragInsertButtonWrapper: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
6
7
|
export declare const insertColumnButtonWrapper: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
7
8
|
export declare const insertRowButtonWrapper: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
8
9
|
export declare const columnControlsLineMarker: () => import("@emotion/react").SerializedStyles;
|
|
@@ -5,10 +5,13 @@ export declare const isInsertRowButton: (node: HTMLElement | null) => boolean |
|
|
|
5
5
|
export declare const getColumnOrRowIndex: (target: HTMLElement) => [number, number];
|
|
6
6
|
export declare const isColumnControlsDecorations: (node: HTMLElement | null) => boolean;
|
|
7
7
|
export declare const isRowControlsButton: (node: HTMLElement | null) => boolean;
|
|
8
|
-
export declare const isRowDragControlsButton: (node: HTMLElement | null) => true | HTMLElement | null;
|
|
9
8
|
export declare const isResizeHandleDecoration: (node: HTMLElement | null) => boolean;
|
|
10
9
|
export declare const isTableControlsButton: (node: HTMLElement | null) => boolean;
|
|
11
10
|
export declare const isTableContainerOrWrapper: (node: HTMLElement | null) => boolean;
|
|
11
|
+
/** drag-and-drop classes */
|
|
12
|
+
export declare const isRowDragControlsButton: (node: HTMLElement | null) => true | HTMLElement | null;
|
|
13
|
+
export declare const isDragRowFloatingInsertDot: (node: HTMLElement | null) => boolean;
|
|
14
|
+
export declare const isDragColumnFloatingInsertDot: (node: HTMLElement | null) => boolean;
|
|
12
15
|
export declare const getMousePositionHorizontalRelativeByElement: (mouseEvent: MouseEvent, elementContentRects?: ElementContentRects, gapInPixels?: number) => 'left' | 'right' | null;
|
|
13
16
|
export declare const getMousePositionVerticalRelativeByElement: (mouseEvent: MouseEvent) => 'top' | 'bottom' | null;
|
|
14
17
|
export declare const updateResizeHandles: (tableRef?: HTMLElement) => void;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import type {
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Command, DropdownOptionT, GetEditorContainerWidth, IconProps } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { Rect, TableMap } from '@atlaskit/editor-tables/table-map';
|
|
3
4
|
import type { TableDirection } from '../types';
|
|
4
5
|
export interface DragMenuConfig extends DropdownOptionT<Command> {
|
|
5
6
|
id: string;
|
|
7
|
+
icon?: React.ComponentType<IconProps>;
|
|
8
|
+
keymap?: string;
|
|
6
9
|
}
|
|
7
|
-
export declare const getDragMenuConfig: (direction: TableDirection, tableMap?: TableMap, index?: number) => DragMenuConfig[];
|
|
10
|
+
export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect) => DragMenuConfig[];
|
|
@@ -2,7 +2,7 @@ export { getSelectedColumnIndexes, getSelectedRowIndexes, normalizeSelection, is
|
|
|
2
2
|
export { findControlsHoverDecoration, createControlsHoverDecoration, createColumnControlsDecoration, createColumnSelectedDecoration, createCellHoverDecoration, updateDecorations, createResizeHandleDecoration, createColumnInsertLine, createColumnLineResize, createRowInsertLine, } from './decoration';
|
|
3
3
|
export { isIsolating, containsHeaderColumn, containsHeaderRow, checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled, isLayoutSupported, getTableWidth, tablesHaveDifferentColumnWidths, tablesHaveDifferentNoOfColumns, isTableNested, anyChildCellMergedAcrossRow, supportedHeaderRow, } from './nodes';
|
|
4
4
|
export { unwrapContentFromTable, removeTableFromFirstChild, removeTableFromLastChild, transformSliceToRemoveOpenTable, transformSliceToCorrectEmptyTableCells, transformSliceToFixHardBreakProblemOnCopyFromCell, } from './paste';
|
|
5
|
-
export { isCell, isCornerButton, isInsertRowButton, isColumnControlsDecorations, isTableControlsButton, isTableContainerOrWrapper, isRowDragControlsButton, isRowControlsButton, getColumnOrRowIndex, getMousePositionHorizontalRelativeByElement, getMousePositionVerticalRelativeByElement, updateResizeHandles, isResizeHandleDecoration, hasResizeHandler, } from './dom';
|
|
5
|
+
export { isCell, isCornerButton, isInsertRowButton, isColumnControlsDecorations, isTableControlsButton, isTableContainerOrWrapper, isRowDragControlsButton, isRowControlsButton, isDragColumnFloatingInsertDot, isDragRowFloatingInsertDot, getColumnOrRowIndex, getMousePositionHorizontalRelativeByElement, getMousePositionVerticalRelativeByElement, updateResizeHandles, isResizeHandleDecoration, hasResizeHandler, } from './dom';
|
|
6
6
|
export { getColumnsWidths, isColumnDeleteButtonVisible, getColumnDeleteButtonParams, getColumnClassNames, } from './column-controls';
|
|
7
7
|
export { getRowHeights, isRowDeleteButtonVisible, getRowDeleteButtonParams, getRowsParams, getRowClassNames, copyPreviousRow, } from './row-controls';
|
|
8
8
|
export type { RowParams } from './row-controls';
|
|
@@ -269,6 +269,9 @@ export declare const TableCssClassName: {
|
|
|
269
269
|
CONTROLS_INSERT_LINE: string;
|
|
270
270
|
CONTROLS_BUTTON_OVERLAY: string;
|
|
271
271
|
LAYOUT_BUTTON: string;
|
|
272
|
+
DRAG_CONTROLS_INSERT_BUTTON: string;
|
|
273
|
+
DRAG_CONTROLS_INSERT_BUTTON_INNER: string;
|
|
274
|
+
DRAG_CONTROLS_INSERT_BUTTON_WRAP: string;
|
|
272
275
|
CONTROLS_INSERT_MARKER: string;
|
|
273
276
|
CONTROLS_INSERT_COLUMN: string;
|
|
274
277
|
CONTROLS_INSERT_ROW: string;
|
|
@@ -281,8 +284,12 @@ export declare const TableCssClassName: {
|
|
|
281
284
|
CORNER_CONTROLS_INSERT_COLUMN_MARKER: string;
|
|
282
285
|
CONTROLS_CORNER_BUTTON: string;
|
|
283
286
|
/** Controls with drag handle */
|
|
284
|
-
|
|
285
|
-
|
|
287
|
+
DRAG_ROW_CONTROLS: string;
|
|
288
|
+
DRAG_ROW_FLOATING_INSERT_DOT_WRAPPER: string;
|
|
289
|
+
DRAG_ROW_FLOATING_INSERT_DOT: string;
|
|
290
|
+
DRAG_COLUMN_CONTROLS: string;
|
|
291
|
+
DRAG_COLUMN_FLOATING_INSERT_DOT_WRAPPER: string;
|
|
292
|
+
DRAG_COLUMN_FLOATING_INSERT_DOT: string;
|
|
286
293
|
DRAG_HANDLE_BUTTON_CONTAINER: string;
|
|
287
294
|
/** Other classes */
|
|
288
295
|
NUMBERED_COLUMN: string;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
2
4
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
6
|
import type { PluginConfig, TableDirection } from '../../types';
|
|
@@ -14,6 +16,7 @@ type DragMenuProps = {
|
|
|
14
16
|
boundariesElement?: HTMLElement;
|
|
15
17
|
scrollableElement?: HTMLElement;
|
|
16
18
|
pluginConfig?: PluginConfig;
|
|
19
|
+
getEditorContainerWidth: GetEditorContainerWidth;
|
|
17
20
|
};
|
|
18
|
-
export declare const DragMenu: ({ direction, index, isOpen, editorView, tableNode, mountPoint, boundariesElement, scrollableElement, }: DragMenuProps) => JSX.Element | null;
|
|
21
|
+
export declare const DragMenu: ({ direction, index, isOpen, editorView, tableNode, mountPoint, boundariesElement, scrollableElement, targetCellPosition, getEditorContainerWidth, }: DragMenuProps) => jsx.JSX.Element | null;
|
|
19
22
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
2
3
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
5
|
import type { TableDirection } from '../../types';
|
|
@@ -13,9 +14,10 @@ export interface Props {
|
|
|
13
14
|
direction?: TableDirection;
|
|
14
15
|
index?: number;
|
|
15
16
|
targetCellPosition?: number;
|
|
17
|
+
getEditorContainerWidth: GetEditorContainerWidth;
|
|
16
18
|
}
|
|
17
19
|
declare const FloatingDragMenu: {
|
|
18
|
-
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, tableRef, tableNode, direction, index, targetCellPosition, }: Props): JSX.Element | null;
|
|
20
|
+
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, tableRef, tableNode, direction, index, targetCellPosition, getEditorContainerWidth, }: Props): JSX.Element | null;
|
|
19
21
|
displayName: string;
|
|
20
22
|
};
|
|
21
23
|
export default FloatingDragMenu;
|
|
@@ -3,11 +3,15 @@ import React from 'react';
|
|
|
3
3
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
4
4
|
import type { TableDirection } from '../../types';
|
|
5
5
|
export interface ButtonProps {
|
|
6
|
-
|
|
6
|
+
type: TableDirection;
|
|
7
7
|
tableRef: HTMLElement;
|
|
8
8
|
onMouseDown: (event: SyntheticEvent<HTMLButtonElement>) => void;
|
|
9
9
|
hasStickyHeaders: boolean;
|
|
10
10
|
}
|
|
11
|
+
export declare const InsertButtonForDragAndDrop: ({ onMouseDown, tableRef, type, intl: { formatMessage }, hasStickyHeaders, }: ButtonProps & WrappedComponentProps) => JSX.Element;
|
|
12
|
+
export declare const DragAndDropInsertButton: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps<"intl">>> & {
|
|
13
|
+
WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps<"intl">>;
|
|
14
|
+
};
|
|
11
15
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps<"intl">>> & {
|
|
12
16
|
WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps<"intl">>;
|
|
13
17
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { PopupProps } from '@atlaskit/editor-common/ui';
|
|
2
2
|
import type { TableDirection } from '../../types';
|
|
3
|
-
declare function getPopupOptions(direction: TableDirection, index: number, hasNumberedColumns: boolean, tableContainer: HTMLElement | null): Partial<PopupProps>;
|
|
3
|
+
declare function getPopupOptions(direction: TableDirection, index: number, hasNumberedColumns: boolean, isDragAndDropEnabled: boolean, tableContainer: HTMLElement | null): Partial<PopupProps>;
|
|
4
4
|
export default getPopupOptions;
|
|
@@ -13,6 +13,7 @@ export interface Props {
|
|
|
13
13
|
insertRowButtonIndex?: number;
|
|
14
14
|
isHeaderColumnEnabled?: boolean;
|
|
15
15
|
isHeaderRowEnabled?: boolean;
|
|
16
|
+
isDragAndDropEnabled?: boolean;
|
|
16
17
|
mountPoint?: HTMLElement;
|
|
17
18
|
boundariesElement?: HTMLElement;
|
|
18
19
|
scrollableElement?: HTMLElement;
|
package/dist/types-ts4.5/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export interface ColumnControlsProps {
|
|
|
12
12
|
localId?: string;
|
|
13
13
|
rowHeights?: number[];
|
|
14
14
|
colWidths?: (number | undefined)[];
|
|
15
|
+
hasHeaderColumn?: boolean;
|
|
15
16
|
}
|
|
16
|
-
export declare const ColumnControls: ({ editorView, tableActive, tableRef, hoveredCell, isResizing, stickyTop, localId, isInDanger, rowHeights, colWidths, }: ColumnControlsProps) => JSX.Element;
|
|
17
|
+
export declare const ColumnControls: ({ editorView, tableActive, tableRef, hoveredCell, isResizing, stickyTop, localId, isInDanger, rowHeights, colWidths, hasHeaderColumn, }: ColumnControlsProps) => JSX.Element;
|
|
17
18
|
export default ColumnControls;
|
package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/RowControls/DragControls.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ type DragControlsProps = {
|
|
|
10
10
|
tableActive?: boolean;
|
|
11
11
|
hoveredCell?: CellHoverMeta;
|
|
12
12
|
isInDanger?: boolean;
|
|
13
|
+
isResizing?: boolean;
|
|
14
|
+
hasHeaderRow?: boolean;
|
|
13
15
|
hoverRows: (rows: number[], danger?: boolean) => void;
|
|
14
16
|
selectRow: (row: number, expand: boolean) => void;
|
|
15
17
|
updateCellHoverLocation: (rowIndex: number) => void;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
export { DragHandleIcon } from './DragHandleIcon';
|
|
2
2
|
export { DragInMotionIcon } from './DragInMotionIcon';
|
|
3
|
+
export { AddRowAboveIcon } from './AddRowAboveIcon';
|
|
4
|
+
export { AddRowBelowIcon } from './AddRowBelowIcon';
|
|
5
|
+
export { AddColLeftIcon } from './AddColLeftIcon';
|
|
6
|
+
export { AddColRightIcon } from './AddColRightIcon';
|
|
@@ -3,6 +3,7 @@ export declare const InsertMarker: (props: ThemeProps, cssString?: string) => im
|
|
|
3
3
|
export declare const HeaderButton: (props: ThemeProps, cssString?: string) => import("@emotion/react").SerializedStyles;
|
|
4
4
|
export declare const HeaderButtonHover: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
5
5
|
export declare const HeaderButtonDanger: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
6
|
+
export declare const dragInsertButtonWrapper: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
6
7
|
export declare const insertColumnButtonWrapper: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
7
8
|
export declare const insertRowButtonWrapper: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
8
9
|
export declare const columnControlsLineMarker: () => import("@emotion/react").SerializedStyles;
|
|
@@ -8,10 +8,13 @@ export declare const getColumnOrRowIndex: (target: HTMLElement) => [
|
|
|
8
8
|
];
|
|
9
9
|
export declare const isColumnControlsDecorations: (node: HTMLElement | null) => boolean;
|
|
10
10
|
export declare const isRowControlsButton: (node: HTMLElement | null) => boolean;
|
|
11
|
-
export declare const isRowDragControlsButton: (node: HTMLElement | null) => true | HTMLElement | null;
|
|
12
11
|
export declare const isResizeHandleDecoration: (node: HTMLElement | null) => boolean;
|
|
13
12
|
export declare const isTableControlsButton: (node: HTMLElement | null) => boolean;
|
|
14
13
|
export declare const isTableContainerOrWrapper: (node: HTMLElement | null) => boolean;
|
|
14
|
+
/** drag-and-drop classes */
|
|
15
|
+
export declare const isRowDragControlsButton: (node: HTMLElement | null) => true | HTMLElement | null;
|
|
16
|
+
export declare const isDragRowFloatingInsertDot: (node: HTMLElement | null) => boolean;
|
|
17
|
+
export declare const isDragColumnFloatingInsertDot: (node: HTMLElement | null) => boolean;
|
|
15
18
|
export declare const getMousePositionHorizontalRelativeByElement: (mouseEvent: MouseEvent, elementContentRects?: ElementContentRects, gapInPixels?: number) => 'left' | 'right' | null;
|
|
16
19
|
export declare const getMousePositionVerticalRelativeByElement: (mouseEvent: MouseEvent) => 'top' | 'bottom' | null;
|
|
17
20
|
export declare const updateResizeHandles: (tableRef?: HTMLElement) => void;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import type {
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Command, DropdownOptionT, GetEditorContainerWidth, IconProps } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { Rect, TableMap } from '@atlaskit/editor-tables/table-map';
|
|
3
4
|
import type { TableDirection } from '../types';
|
|
4
5
|
export interface DragMenuConfig extends DropdownOptionT<Command> {
|
|
5
6
|
id: string;
|
|
7
|
+
icon?: React.ComponentType<IconProps>;
|
|
8
|
+
keymap?: string;
|
|
6
9
|
}
|
|
7
|
-
export declare const getDragMenuConfig: (direction: TableDirection, tableMap?: TableMap, index?: number) => DragMenuConfig[];
|
|
10
|
+
export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect) => DragMenuConfig[];
|
|
@@ -2,7 +2,7 @@ export { getSelectedColumnIndexes, getSelectedRowIndexes, normalizeSelection, is
|
|
|
2
2
|
export { findControlsHoverDecoration, createControlsHoverDecoration, createColumnControlsDecoration, createColumnSelectedDecoration, createCellHoverDecoration, updateDecorations, createResizeHandleDecoration, createColumnInsertLine, createColumnLineResize, createRowInsertLine, } from './decoration';
|
|
3
3
|
export { isIsolating, containsHeaderColumn, containsHeaderRow, checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled, isLayoutSupported, getTableWidth, tablesHaveDifferentColumnWidths, tablesHaveDifferentNoOfColumns, isTableNested, anyChildCellMergedAcrossRow, supportedHeaderRow, } from './nodes';
|
|
4
4
|
export { unwrapContentFromTable, removeTableFromFirstChild, removeTableFromLastChild, transformSliceToRemoveOpenTable, transformSliceToCorrectEmptyTableCells, transformSliceToFixHardBreakProblemOnCopyFromCell, } from './paste';
|
|
5
|
-
export { isCell, isCornerButton, isInsertRowButton, isColumnControlsDecorations, isTableControlsButton, isTableContainerOrWrapper, isRowDragControlsButton, isRowControlsButton, getColumnOrRowIndex, getMousePositionHorizontalRelativeByElement, getMousePositionVerticalRelativeByElement, updateResizeHandles, isResizeHandleDecoration, hasResizeHandler, } from './dom';
|
|
5
|
+
export { isCell, isCornerButton, isInsertRowButton, isColumnControlsDecorations, isTableControlsButton, isTableContainerOrWrapper, isRowDragControlsButton, isRowControlsButton, isDragColumnFloatingInsertDot, isDragRowFloatingInsertDot, getColumnOrRowIndex, getMousePositionHorizontalRelativeByElement, getMousePositionVerticalRelativeByElement, updateResizeHandles, isResizeHandleDecoration, hasResizeHandler, } from './dom';
|
|
6
6
|
export { getColumnsWidths, isColumnDeleteButtonVisible, getColumnDeleteButtonParams, getColumnClassNames, } from './column-controls';
|
|
7
7
|
export { getRowHeights, isRowDeleteButtonVisible, getRowDeleteButtonParams, getRowsParams, getRowClassNames, copyPreviousRow, } from './row-controls';
|
|
8
8
|
export type { RowParams } from './row-controls';
|
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.15",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"@atlaskit/platform-feature-flags": "^0.2.1",
|
|
41
41
|
"@atlaskit/pragmatic-drag-and-drop": "^0.23.0",
|
|
42
42
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^0.11.8",
|
|
43
|
+
"@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll": "^0.6.4",
|
|
43
44
|
"@atlaskit/primitives": "^1.7.0",
|
|
44
45
|
"@atlaskit/theme": "^12.6.0",
|
|
45
46
|
"@atlaskit/tokens": "^1.28.0",
|