@atlaskit/editor-plugin-table 7.0.3 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/pm-plugins/drag-and-drop/commands.js +1 -1
- package/dist/cjs/pm-plugins/keymap.js +1 -1
- package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +1 -1
- package/dist/cjs/ui/icons/AddRowAboveIcon.js +8 -12
- package/dist/cjs/ui/icons/AddRowBelowIcon.js +19 -15
- package/dist/es2019/pm-plugins/drag-and-drop/commands.js +1 -1
- package/dist/es2019/pm-plugins/keymap.js +2 -2
- package/dist/es2019/ui/TableFloatingControls/RowControls/DragControls.js +1 -1
- package/dist/es2019/ui/icons/AddRowAboveIcon.js +8 -12
- package/dist/es2019/ui/icons/AddRowBelowIcon.js +19 -15
- package/dist/esm/pm-plugins/drag-and-drop/commands.js +1 -1
- package/dist/esm/pm-plugins/keymap.js +2 -2
- package/dist/esm/ui/TableFloatingControls/RowControls/DragControls.js +1 -1
- package/dist/esm/ui/icons/AddRowAboveIcon.js +8 -12
- package/dist/esm/ui/icons/AddRowBelowIcon.js +19 -15
- package/dist/types/index.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/package.json +5 -5
- package/src/index.ts +1 -1
- package/src/pm-plugins/drag-and-drop/commands.ts +1 -1
- package/src/pm-plugins/keymap.ts +2 -7
- package/src/ui/TableFloatingControls/RowControls/DragControls.tsx +1 -0
- package/src/ui/icons/AddRowAboveIcon.tsx +2 -16
- package/src/ui/icons/AddRowBelowIcon.tsx +21 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 7.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#69232](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69232) [`93c8f231aa82`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/93c8f231aa82) - Optimized the table move column logic to perform individual insert/deletes per row
|
|
8
|
+
- [#68790](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68790) [`c6d8affc52d1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c6d8affc52d1) - Support maybeAdd plugins in usePreset. Add typing support for universal preset.
|
|
9
|
+
|
|
10
|
+
Now when using the editor API with the universal preset
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#68693](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68693) [`f664d35cc135`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f664d35cc135) - Fix incorrect drag handle position after deleting row in table
|
|
15
|
+
- [#68011](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68011) [`f19b64a46694`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f19b64a46694) - Remove check for header for column insert keyboard shortcut
|
|
16
|
+
- [#68926](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68926) [`fceb32f94798`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fceb32f94798) - [ux] update drag menu's insert row's icons
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 7.0.3
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -87,7 +87,7 @@ var moveSource = exports.moveSource = function moveSource(sourceType, sourceInde
|
|
|
87
87
|
if (isTableRow) {
|
|
88
88
|
return (0, _transforms.combineTransforms)([(0, _utils.moveRow)(state, sourceIndexes, targetIndex), selectStartOfTable, (0, _utils.selectRow)(targetIndex)], nextTr);
|
|
89
89
|
}
|
|
90
|
-
return (0, _transforms.combineTransforms)([(0, _utils.moveColumn)(sourceIndexes, targetIndex), selectStartOfTable, (0, _utils.selectColumn)(targetIndex)], nextTr);
|
|
90
|
+
return (0, _transforms.combineTransforms)([(0, _utils.moveColumn)(state, sourceIndexes, targetIndex), selectStartOfTable, (0, _utils.selectColumn)(targetIndex)], nextTr);
|
|
91
91
|
});
|
|
92
92
|
};
|
|
93
93
|
var toggleDragMenu = exports.toggleDragMenu = function toggleDragMenu(isDragMenuOpen, direction, index) {
|
|
@@ -38,7 +38,7 @@ function keymapPlugin(getEditorContainerWidth, editorAnalyticsAPI, dragAndDropEn
|
|
|
38
38
|
// Add row/column shortcuts
|
|
39
39
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addRowBefore.common, (0, _commandsWithAnalytics.addRowAroundSelection)(editorAnalyticsAPI)('TOP'), list);
|
|
40
40
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addRowAfter.common, (0, _commandsWithAnalytics.addRowAroundSelection)(editorAnalyticsAPI)('BOTTOM'), list);
|
|
41
|
-
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addColumnBefore.common, (0,
|
|
41
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addColumnBefore.common, (0, _insert.addColumnBefore)(getEditorContainerWidth), list);
|
|
42
42
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addColumnAfter.common, (0, _insert.addColumnAfter)(getEditorContainerWidth), list);
|
|
43
43
|
if (dragAndDropEnabled) {
|
|
44
44
|
// Move row/column shortcuts
|
|
@@ -128,7 +128,7 @@ var DragControlsComponent = function DragControlsComponent(_ref) {
|
|
|
128
128
|
}
|
|
129
129
|
var isHover = type === 'hover';
|
|
130
130
|
var isRowsSelected = selectedRowIndexes.length > 0;
|
|
131
|
-
var showCondition = isHover ? isRowsSelected && !selectedRowIndexes.includes(rowIndex) && Number.isFinite(hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.colIndex) : selectedRowIndexes.length < rowHeights.length && Number.isFinite(hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.colIndex);
|
|
131
|
+
var showCondition = isHover ? isRowsSelected && !selectedRowIndexes.includes(rowIndex) && Number.isFinite(hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.colIndex) : selectedRowIndexes.length < rowHeights.length && rowIndex < rowHeights.length && Number.isFinite(hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.colIndex);
|
|
132
132
|
if (!showCondition) {
|
|
133
133
|
return null;
|
|
134
134
|
}
|
|
@@ -18,24 +18,20 @@ var AddRowAboveIcon = exports.AddRowAboveIcon = function AddRowAboveIcon() {
|
|
|
18
18
|
height: "24",
|
|
19
19
|
fill: "var(--ds-border-inverse, #FFFFFF)",
|
|
20
20
|
fillOpacity: "0.01"
|
|
21
|
-
}), /*#__PURE__*/_react.default.createElement("
|
|
22
|
-
id: "path-1-inside-1_896_17822",
|
|
23
|
-
fill: "var(--ds-border-inverse, #FFFFFF)"
|
|
24
|
-
}, /*#__PURE__*/_react.default.createElement("rect", {
|
|
21
|
+
}), /*#__PURE__*/_react.default.createElement("rect", {
|
|
25
22
|
x: "6",
|
|
26
23
|
y: "12",
|
|
27
24
|
width: "12",
|
|
28
|
-
height: "
|
|
29
|
-
rx: "0.5"
|
|
30
|
-
|
|
25
|
+
height: "3",
|
|
26
|
+
rx: "0.5",
|
|
27
|
+
fill: "currentColor"
|
|
28
|
+
}), /*#__PURE__*/_react.default.createElement("rect", {
|
|
31
29
|
x: "6",
|
|
32
|
-
y: "
|
|
30
|
+
y: "16",
|
|
33
31
|
width: "12",
|
|
34
|
-
height: "
|
|
32
|
+
height: "3",
|
|
35
33
|
rx: "0.5",
|
|
36
|
-
|
|
37
|
-
strokeWidth: "4",
|
|
38
|
-
mask: "url(#path-1-inside-1_896_17822)"
|
|
34
|
+
fill: "currentColor"
|
|
39
35
|
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
40
36
|
fillRule: "evenodd",
|
|
41
37
|
clipRule: "evenodd",
|
|
@@ -13,28 +13,32 @@ var AddRowBelowIcon = exports.AddRowBelowIcon = function AddRowBelowIcon() {
|
|
|
13
13
|
viewBox: "0 0 24 24",
|
|
14
14
|
fill: "none",
|
|
15
15
|
xmlns: "http://www.w3.org/2000/svg"
|
|
16
|
-
}, /*#__PURE__*/_react.default.createElement("mask", {
|
|
17
|
-
id: "path-1-inside-1_920_47112",
|
|
18
|
-
fill: "var(--ds-border-inverse, #FFFFFF)"
|
|
19
16
|
}, /*#__PURE__*/_react.default.createElement("rect", {
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
width: "24",
|
|
18
|
+
height: "24",
|
|
19
|
+
transform: "matrix(-1 0 0 -1 24 24)",
|
|
20
|
+
fill: "var(--ds-border-inverse, #FFFFFF)",
|
|
21
|
+
fillOpacity: "0.01"
|
|
22
|
+
}), /*#__PURE__*/_react.default.createElement("rect", {
|
|
23
|
+
x: "18",
|
|
24
|
+
y: "12",
|
|
22
25
|
width: "12",
|
|
23
|
-
height: "
|
|
24
|
-
rx: "0.5"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
height: "3",
|
|
27
|
+
rx: "0.5",
|
|
28
|
+
transform: "rotate(-180 18 12)",
|
|
29
|
+
fill: "currentColor"
|
|
30
|
+
}), /*#__PURE__*/_react.default.createElement("rect", {
|
|
31
|
+
x: "18",
|
|
32
|
+
y: "8",
|
|
28
33
|
width: "12",
|
|
29
|
-
height: "
|
|
34
|
+
height: "3",
|
|
30
35
|
rx: "0.5",
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
mask: "url(#path-1-inside-1_920_47112)"
|
|
36
|
+
transform: "rotate(-180 18 8)",
|
|
37
|
+
fill: "currentColor"
|
|
34
38
|
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
35
39
|
fillRule: "evenodd",
|
|
36
40
|
clipRule: "evenodd",
|
|
37
|
-
d: "
|
|
41
|
+
d: "M11 17V18.01C11.0026 18.2735 11.1092 18.5253 11.2964 18.7107C11.4837 18.896 11.7365 19 12 19C12.556 19 13 18.556 13 18.01V17H14C14.2652 17 14.5196 16.8946 14.7071 16.7071C14.8946 16.5196 15 16.2652 15 16C15 15.7348 14.8946 15.4804 14.7071 15.2929C14.5196 15.1054 14.2652 15 14 15H13V13.99C12.9974 13.7265 12.8908 13.4747 12.7036 13.2893C12.5163 13.104 12.2635 13 12 13C11.444 13 11 13.444 11 13.99V15H10C9.73478 15 9.48043 15.1054 9.29289 15.2929C9.10536 15.4804 9 15.7348 9 16C9 16.2652 9.10536 16.5196 9.29289 16.7071C9.48043 16.8946 9.73478 17 10 17H11Z",
|
|
38
42
|
fill: "currentColor"
|
|
39
43
|
}));
|
|
40
44
|
};
|
|
@@ -71,7 +71,7 @@ export const moveSource = (sourceType, sourceIndexes, targetIndex, tr) => create
|
|
|
71
71
|
if (isTableRow) {
|
|
72
72
|
return combineTransforms([moveRow(state, sourceIndexes, targetIndex), selectStartOfTable, selectRow(targetIndex)], nextTr);
|
|
73
73
|
}
|
|
74
|
-
return combineTransforms([moveColumn(sourceIndexes, targetIndex), selectStartOfTable, selectColumn(targetIndex)], nextTr);
|
|
74
|
+
return combineTransforms([moveColumn(state, sourceIndexes, targetIndex), selectStartOfTable, selectColumn(targetIndex)], nextTr);
|
|
75
75
|
});
|
|
76
76
|
export const toggleDragMenu = (isDragMenuOpen, direction, index) => createCommand(state => {
|
|
77
77
|
let {
|
|
@@ -3,7 +3,7 @@ import { addColumnAfter, addColumnBefore, addRowAfter, addRowBefore, backspace,
|
|
|
3
3
|
import { chainCommands } from '@atlaskit/editor-prosemirror/commands';
|
|
4
4
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
5
5
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
|
-
import { createTable, goToNextCell, moveCursorBackward
|
|
6
|
+
import { createTable, goToNextCell, moveCursorBackward } from '../commands';
|
|
7
7
|
import { addRowAroundSelection, deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut, deleteTableIfSelectedWithAnalytics, emptyMultipleCellsWithAnalytics } from '../commands-with-analytics';
|
|
8
8
|
import { activateNextResizeArea, changeColumnWidthByStep, initiateKeyboardColumnResizing } from '../commands/column-resize';
|
|
9
9
|
import { addColumnAfter as addColumnAfterCommand, addColumnBefore as addColumnBeforeCommand } from '../commands/insert';
|
|
@@ -29,7 +29,7 @@ export function keymapPlugin(getEditorContainerWidth, editorAnalyticsAPI, dragAn
|
|
|
29
29
|
// Add row/column shortcuts
|
|
30
30
|
bindKeymapWithCommand(addRowBefore.common, addRowAroundSelection(editorAnalyticsAPI)('TOP'), list);
|
|
31
31
|
bindKeymapWithCommand(addRowAfter.common, addRowAroundSelection(editorAnalyticsAPI)('BOTTOM'), list);
|
|
32
|
-
bindKeymapWithCommand(addColumnBefore.common,
|
|
32
|
+
bindKeymapWithCommand(addColumnBefore.common, addColumnBeforeCommand(getEditorContainerWidth), list);
|
|
33
33
|
bindKeymapWithCommand(addColumnAfter.common, addColumnAfterCommand(getEditorContainerWidth), list);
|
|
34
34
|
if (dragAndDropEnabled) {
|
|
35
35
|
// Move row/column shortcuts
|
|
@@ -118,7 +118,7 @@ const DragControlsComponent = ({
|
|
|
118
118
|
}
|
|
119
119
|
const isHover = type === 'hover';
|
|
120
120
|
const isRowsSelected = selectedRowIndexes.length > 0;
|
|
121
|
-
const showCondition = isHover ? isRowsSelected && !selectedRowIndexes.includes(rowIndex) && Number.isFinite(hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.colIndex) : selectedRowIndexes.length < rowHeights.length && Number.isFinite(hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.colIndex);
|
|
121
|
+
const showCondition = isHover ? isRowsSelected && !selectedRowIndexes.includes(rowIndex) && Number.isFinite(hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.colIndex) : selectedRowIndexes.length < rowHeights.length && rowIndex < rowHeights.length && Number.isFinite(hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.colIndex);
|
|
122
122
|
if (!showCondition) {
|
|
123
123
|
return null;
|
|
124
124
|
}
|
|
@@ -10,24 +10,20 @@ export const AddRowAboveIcon = () => /*#__PURE__*/React.createElement("svg", {
|
|
|
10
10
|
height: "24",
|
|
11
11
|
fill: "var(--ds-border-inverse, #FFFFFF)",
|
|
12
12
|
fillOpacity: "0.01"
|
|
13
|
-
}), /*#__PURE__*/React.createElement("
|
|
14
|
-
id: "path-1-inside-1_896_17822",
|
|
15
|
-
fill: "var(--ds-border-inverse, #FFFFFF)"
|
|
16
|
-
}, /*#__PURE__*/React.createElement("rect", {
|
|
13
|
+
}), /*#__PURE__*/React.createElement("rect", {
|
|
17
14
|
x: "6",
|
|
18
15
|
y: "12",
|
|
19
16
|
width: "12",
|
|
20
|
-
height: "
|
|
21
|
-
rx: "0.5"
|
|
22
|
-
|
|
17
|
+
height: "3",
|
|
18
|
+
rx: "0.5",
|
|
19
|
+
fill: "currentColor"
|
|
20
|
+
}), /*#__PURE__*/React.createElement("rect", {
|
|
23
21
|
x: "6",
|
|
24
|
-
y: "
|
|
22
|
+
y: "16",
|
|
25
23
|
width: "12",
|
|
26
|
-
height: "
|
|
24
|
+
height: "3",
|
|
27
25
|
rx: "0.5",
|
|
28
|
-
|
|
29
|
-
strokeWidth: "4",
|
|
30
|
-
mask: "url(#path-1-inside-1_896_17822)"
|
|
26
|
+
fill: "currentColor"
|
|
31
27
|
}), /*#__PURE__*/React.createElement("path", {
|
|
32
28
|
fillRule: "evenodd",
|
|
33
29
|
clipRule: "evenodd",
|
|
@@ -5,27 +5,31 @@ export const AddRowBelowIcon = () => /*#__PURE__*/React.createElement("svg", {
|
|
|
5
5
|
viewBox: "0 0 24 24",
|
|
6
6
|
fill: "none",
|
|
7
7
|
xmlns: "http://www.w3.org/2000/svg"
|
|
8
|
-
}, /*#__PURE__*/React.createElement("mask", {
|
|
9
|
-
id: "path-1-inside-1_920_47112",
|
|
10
|
-
fill: "var(--ds-border-inverse, #FFFFFF)"
|
|
11
8
|
}, /*#__PURE__*/React.createElement("rect", {
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
width: "24",
|
|
10
|
+
height: "24",
|
|
11
|
+
transform: "matrix(-1 0 0 -1 24 24)",
|
|
12
|
+
fill: "var(--ds-border-inverse, #FFFFFF)",
|
|
13
|
+
fillOpacity: "0.01"
|
|
14
|
+
}), /*#__PURE__*/React.createElement("rect", {
|
|
15
|
+
x: "18",
|
|
16
|
+
y: "12",
|
|
14
17
|
width: "12",
|
|
15
|
-
height: "
|
|
16
|
-
rx: "0.5"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
height: "3",
|
|
19
|
+
rx: "0.5",
|
|
20
|
+
transform: "rotate(-180 18 12)",
|
|
21
|
+
fill: "currentColor"
|
|
22
|
+
}), /*#__PURE__*/React.createElement("rect", {
|
|
23
|
+
x: "18",
|
|
24
|
+
y: "8",
|
|
20
25
|
width: "12",
|
|
21
|
-
height: "
|
|
26
|
+
height: "3",
|
|
22
27
|
rx: "0.5",
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
mask: "url(#path-1-inside-1_920_47112)"
|
|
28
|
+
transform: "rotate(-180 18 8)",
|
|
29
|
+
fill: "currentColor"
|
|
26
30
|
}), /*#__PURE__*/React.createElement("path", {
|
|
27
31
|
fillRule: "evenodd",
|
|
28
32
|
clipRule: "evenodd",
|
|
29
|
-
d: "
|
|
33
|
+
d: "M11 17V18.01C11.0026 18.2735 11.1092 18.5253 11.2964 18.7107C11.4837 18.896 11.7365 19 12 19C12.556 19 13 18.556 13 18.01V17H14C14.2652 17 14.5196 16.8946 14.7071 16.7071C14.8946 16.5196 15 16.2652 15 16C15 15.7348 14.8946 15.4804 14.7071 15.2929C14.5196 15.1054 14.2652 15 14 15H13V13.99C12.9974 13.7265 12.8908 13.4747 12.7036 13.2893C12.5163 13.104 12.2635 13 12 13C11.444 13 11 13.444 11 13.99V15H10C9.73478 15 9.48043 15.1054 9.29289 15.2929C9.10536 15.4804 9 15.7348 9 16C9 16.2652 9.10536 16.5196 9.29289 16.7071C9.48043 16.8946 9.73478 17 10 17H11Z",
|
|
30
34
|
fill: "currentColor"
|
|
31
35
|
}));
|
|
@@ -82,7 +82,7 @@ export var moveSource = function moveSource(sourceType, sourceIndexes, targetInd
|
|
|
82
82
|
if (isTableRow) {
|
|
83
83
|
return combineTransforms([moveRow(state, sourceIndexes, targetIndex), selectStartOfTable, selectRow(targetIndex)], nextTr);
|
|
84
84
|
}
|
|
85
|
-
return combineTransforms([moveColumn(sourceIndexes, targetIndex), selectStartOfTable, selectColumn(targetIndex)], nextTr);
|
|
85
|
+
return combineTransforms([moveColumn(state, sourceIndexes, targetIndex), selectStartOfTable, selectColumn(targetIndex)], nextTr);
|
|
86
86
|
});
|
|
87
87
|
};
|
|
88
88
|
export var toggleDragMenu = function toggleDragMenu(isDragMenuOpen, direction, index) {
|
|
@@ -3,7 +3,7 @@ import { addColumnAfter, addColumnBefore, addRowAfter, addRowBefore, backspace,
|
|
|
3
3
|
import { chainCommands } from '@atlaskit/editor-prosemirror/commands';
|
|
4
4
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
5
5
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
|
-
import { createTable, goToNextCell, moveCursorBackward
|
|
6
|
+
import { createTable, goToNextCell, moveCursorBackward } from '../commands';
|
|
7
7
|
import { addRowAroundSelection, deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut, deleteTableIfSelectedWithAnalytics, emptyMultipleCellsWithAnalytics } from '../commands-with-analytics';
|
|
8
8
|
import { activateNextResizeArea, changeColumnWidthByStep, initiateKeyboardColumnResizing } from '../commands/column-resize';
|
|
9
9
|
import { addColumnAfter as addColumnAfterCommand, addColumnBefore as addColumnBeforeCommand } from '../commands/insert';
|
|
@@ -31,7 +31,7 @@ export function keymapPlugin(getEditorContainerWidth, editorAnalyticsAPI, dragAn
|
|
|
31
31
|
// Add row/column shortcuts
|
|
32
32
|
bindKeymapWithCommand(addRowBefore.common, addRowAroundSelection(editorAnalyticsAPI)('TOP'), list);
|
|
33
33
|
bindKeymapWithCommand(addRowAfter.common, addRowAroundSelection(editorAnalyticsAPI)('BOTTOM'), list);
|
|
34
|
-
bindKeymapWithCommand(addColumnBefore.common,
|
|
34
|
+
bindKeymapWithCommand(addColumnBefore.common, addColumnBeforeCommand(getEditorContainerWidth), list);
|
|
35
35
|
bindKeymapWithCommand(addColumnAfter.common, addColumnAfterCommand(getEditorContainerWidth), list);
|
|
36
36
|
if (dragAndDropEnabled) {
|
|
37
37
|
// Move row/column shortcuts
|
|
@@ -118,7 +118,7 @@ var DragControlsComponent = function DragControlsComponent(_ref) {
|
|
|
118
118
|
}
|
|
119
119
|
var isHover = type === 'hover';
|
|
120
120
|
var isRowsSelected = selectedRowIndexes.length > 0;
|
|
121
|
-
var showCondition = isHover ? isRowsSelected && !selectedRowIndexes.includes(rowIndex) && Number.isFinite(hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.colIndex) : selectedRowIndexes.length < rowHeights.length && Number.isFinite(hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.colIndex);
|
|
121
|
+
var showCondition = isHover ? isRowsSelected && !selectedRowIndexes.includes(rowIndex) && Number.isFinite(hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.colIndex) : selectedRowIndexes.length < rowHeights.length && rowIndex < rowHeights.length && Number.isFinite(hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.colIndex);
|
|
122
122
|
if (!showCondition) {
|
|
123
123
|
return null;
|
|
124
124
|
}
|
|
@@ -11,24 +11,20 @@ export var AddRowAboveIcon = function AddRowAboveIcon() {
|
|
|
11
11
|
height: "24",
|
|
12
12
|
fill: "var(--ds-border-inverse, #FFFFFF)",
|
|
13
13
|
fillOpacity: "0.01"
|
|
14
|
-
}), /*#__PURE__*/React.createElement("
|
|
15
|
-
id: "path-1-inside-1_896_17822",
|
|
16
|
-
fill: "var(--ds-border-inverse, #FFFFFF)"
|
|
17
|
-
}, /*#__PURE__*/React.createElement("rect", {
|
|
14
|
+
}), /*#__PURE__*/React.createElement("rect", {
|
|
18
15
|
x: "6",
|
|
19
16
|
y: "12",
|
|
20
17
|
width: "12",
|
|
21
|
-
height: "
|
|
22
|
-
rx: "0.5"
|
|
23
|
-
|
|
18
|
+
height: "3",
|
|
19
|
+
rx: "0.5",
|
|
20
|
+
fill: "currentColor"
|
|
21
|
+
}), /*#__PURE__*/React.createElement("rect", {
|
|
24
22
|
x: "6",
|
|
25
|
-
y: "
|
|
23
|
+
y: "16",
|
|
26
24
|
width: "12",
|
|
27
|
-
height: "
|
|
25
|
+
height: "3",
|
|
28
26
|
rx: "0.5",
|
|
29
|
-
|
|
30
|
-
strokeWidth: "4",
|
|
31
|
-
mask: "url(#path-1-inside-1_896_17822)"
|
|
27
|
+
fill: "currentColor"
|
|
32
28
|
}), /*#__PURE__*/React.createElement("path", {
|
|
33
29
|
fillRule: "evenodd",
|
|
34
30
|
clipRule: "evenodd",
|
|
@@ -6,28 +6,32 @@ export var AddRowBelowIcon = function AddRowBelowIcon() {
|
|
|
6
6
|
viewBox: "0 0 24 24",
|
|
7
7
|
fill: "none",
|
|
8
8
|
xmlns: "http://www.w3.org/2000/svg"
|
|
9
|
-
}, /*#__PURE__*/React.createElement("mask", {
|
|
10
|
-
id: "path-1-inside-1_920_47112",
|
|
11
|
-
fill: "var(--ds-border-inverse, #FFFFFF)"
|
|
12
9
|
}, /*#__PURE__*/React.createElement("rect", {
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
width: "24",
|
|
11
|
+
height: "24",
|
|
12
|
+
transform: "matrix(-1 0 0 -1 24 24)",
|
|
13
|
+
fill: "var(--ds-border-inverse, #FFFFFF)",
|
|
14
|
+
fillOpacity: "0.01"
|
|
15
|
+
}), /*#__PURE__*/React.createElement("rect", {
|
|
16
|
+
x: "18",
|
|
17
|
+
y: "12",
|
|
15
18
|
width: "12",
|
|
16
|
-
height: "
|
|
17
|
-
rx: "0.5"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
height: "3",
|
|
20
|
+
rx: "0.5",
|
|
21
|
+
transform: "rotate(-180 18 12)",
|
|
22
|
+
fill: "currentColor"
|
|
23
|
+
}), /*#__PURE__*/React.createElement("rect", {
|
|
24
|
+
x: "18",
|
|
25
|
+
y: "8",
|
|
21
26
|
width: "12",
|
|
22
|
-
height: "
|
|
27
|
+
height: "3",
|
|
23
28
|
rx: "0.5",
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
mask: "url(#path-1-inside-1_920_47112)"
|
|
29
|
+
transform: "rotate(-180 18 8)",
|
|
30
|
+
fill: "currentColor"
|
|
27
31
|
}), /*#__PURE__*/React.createElement("path", {
|
|
28
32
|
fillRule: "evenodd",
|
|
29
33
|
clipRule: "evenodd",
|
|
30
|
-
d: "
|
|
34
|
+
d: "M11 17V18.01C11.0026 18.2735 11.1092 18.5253 11.2964 18.7107C11.4837 18.896 11.7365 19 12 19C12.556 19 13 18.556 13 18.01V17H14C14.2652 17 14.5196 16.8946 14.7071 16.7071C14.8946 16.5196 15 16.2652 15 16C15 15.7348 14.8946 15.4804 14.7071 15.2929C14.5196 15.1054 14.2652 15 14 15H13V13.99C12.9974 13.7265 12.8908 13.4747 12.7036 13.2893C12.5163 13.104 12.2635 13 12 13C11.444 13 11 13.444 11 13.99V15H10C9.73478 15 9.48043 15.1054 9.29289 15.2929C9.10536 15.4804 9 15.7348 9 16C9 16.2652 9.10536 16.5196 9.29289 16.7071C9.48043 16.8946 9.73478 17 10 17H11Z",
|
|
31
35
|
fill: "currentColor"
|
|
32
36
|
}));
|
|
33
37
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as tablesPlugin } from './plugin';
|
|
2
|
-
export type { TablePlugin } from './plugin';
|
|
2
|
+
export type { TablePlugin, TablePluginOptions } from './plugin';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as tablesPlugin } from './plugin';
|
|
2
|
-
export type { TablePlugin } from './plugin';
|
|
2
|
+
export type { TablePlugin, TablePluginOptions } from './plugin';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "7.0
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@atlaskit/adf-schema": "^35.3.0",
|
|
32
32
|
"@atlaskit/custom-steps": "^0.0.11",
|
|
33
|
-
"@atlaskit/editor-common": "^77.
|
|
33
|
+
"@atlaskit/editor-common": "^77.1.0",
|
|
34
34
|
"@atlaskit/editor-palette": "1.5.2",
|
|
35
35
|
"@atlaskit/editor-plugin-analytics": "^0.4.0",
|
|
36
36
|
"@atlaskit/editor-plugin-content-insertion": "^0.1.0",
|
|
@@ -39,16 +39,16 @@
|
|
|
39
39
|
"@atlaskit/editor-plugin-width": "^0.2.0",
|
|
40
40
|
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
41
41
|
"@atlaskit/editor-shared-styles": "^2.9.0",
|
|
42
|
-
"@atlaskit/editor-tables": "^2.
|
|
42
|
+
"@atlaskit/editor-tables": "^2.5.0",
|
|
43
43
|
"@atlaskit/icon": "^22.0.0",
|
|
44
44
|
"@atlaskit/platform-feature-flags": "^0.2.1",
|
|
45
45
|
"@atlaskit/pragmatic-drag-and-drop": "^0.25.0",
|
|
46
46
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^0.8.0",
|
|
47
47
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^0.12.0",
|
|
48
|
-
"@atlaskit/primitives": "^1.
|
|
48
|
+
"@atlaskit/primitives": "^1.20.0",
|
|
49
49
|
"@atlaskit/theme": "^12.6.0",
|
|
50
50
|
"@atlaskit/toggle": "^13.0.0",
|
|
51
|
-
"@atlaskit/tokens": "^1.
|
|
51
|
+
"@atlaskit/tokens": "^1.35.0",
|
|
52
52
|
"@atlaskit/tooltip": "^18.1.0",
|
|
53
53
|
"@babel/runtime": "^7.0.0",
|
|
54
54
|
"@emotion/react": "^11.7.1",
|
package/src/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as tablesPlugin } from './plugin';
|
|
2
|
-
export type { TablePlugin } from './plugin';
|
|
2
|
+
export type { TablePlugin, TablePluginOptions } from './plugin';
|
package/src/pm-plugins/keymap.ts
CHANGED
|
@@ -34,12 +34,7 @@ import { chainCommands } from '@atlaskit/editor-prosemirror/commands';
|
|
|
34
34
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
35
35
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
36
36
|
|
|
37
|
-
import {
|
|
38
|
-
createTable,
|
|
39
|
-
goToNextCell,
|
|
40
|
-
moveCursorBackward,
|
|
41
|
-
triggerUnlessTableHeader,
|
|
42
|
-
} from '../commands';
|
|
37
|
+
import { createTable, goToNextCell, moveCursorBackward } from '../commands';
|
|
43
38
|
import {
|
|
44
39
|
addRowAroundSelection,
|
|
45
40
|
deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut,
|
|
@@ -120,7 +115,7 @@ export function keymapPlugin(
|
|
|
120
115
|
|
|
121
116
|
bindKeymapWithCommand(
|
|
122
117
|
addColumnBefore.common!,
|
|
123
|
-
|
|
118
|
+
addColumnBeforeCommand(getEditorContainerWidth),
|
|
124
119
|
list,
|
|
125
120
|
);
|
|
126
121
|
|
|
@@ -194,6 +194,7 @@ const DragControlsComponent = ({
|
|
|
194
194
|
!selectedRowIndexes.includes(rowIndex!) &&
|
|
195
195
|
Number.isFinite(hoveredCell?.colIndex)
|
|
196
196
|
: selectedRowIndexes.length < rowHeights.length &&
|
|
197
|
+
rowIndex! < rowHeights.length &&
|
|
197
198
|
Number.isFinite(hoveredCell?.colIndex);
|
|
198
199
|
|
|
199
200
|
if (!showCondition) {
|
|
@@ -16,22 +16,8 @@ export const AddRowAboveIcon = () => (
|
|
|
16
16
|
fill={token('color.border.inverse', '#FFFFFF')}
|
|
17
17
|
fillOpacity="0.01"
|
|
18
18
|
/>
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
fill={token('color.border.inverse', '#FFFFFF')}
|
|
22
|
-
>
|
|
23
|
-
<rect x="6" y="12" width="12" height="8" rx="0.5" />
|
|
24
|
-
</mask>
|
|
25
|
-
<rect
|
|
26
|
-
x="6"
|
|
27
|
-
y="12"
|
|
28
|
-
width="12"
|
|
29
|
-
height="8"
|
|
30
|
-
rx="0.5"
|
|
31
|
-
stroke="currentColor"
|
|
32
|
-
strokeWidth="4"
|
|
33
|
-
mask="url(#path-1-inside-1_896_17822)"
|
|
34
|
-
/>
|
|
19
|
+
<rect x="6" y="12" width="12" height="3" rx="0.5" fill="currentColor" />
|
|
20
|
+
<rect x="6" y="16" width="12" height="3" rx="0.5" fill="currentColor" />
|
|
35
21
|
<path
|
|
36
22
|
fillRule="evenodd"
|
|
37
23
|
clipRule="evenodd"
|
|
@@ -10,26 +10,35 @@ export const AddRowBelowIcon = () => (
|
|
|
10
10
|
fill="none"
|
|
11
11
|
xmlns="http://www.w3.org/2000/svg"
|
|
12
12
|
>
|
|
13
|
-
<
|
|
14
|
-
|
|
13
|
+
<rect
|
|
14
|
+
width="24"
|
|
15
|
+
height="24"
|
|
16
|
+
transform="matrix(-1 0 0 -1 24 24)"
|
|
15
17
|
fill={token('color.border.inverse', '#FFFFFF')}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
fillOpacity="0.01"
|
|
19
|
+
/>
|
|
20
|
+
<rect
|
|
21
|
+
x="18"
|
|
22
|
+
y="12"
|
|
23
|
+
width="12"
|
|
24
|
+
height="3"
|
|
25
|
+
rx="0.5"
|
|
26
|
+
transform="rotate(-180 18 12)"
|
|
27
|
+
fill="currentColor"
|
|
28
|
+
/>
|
|
19
29
|
<rect
|
|
20
|
-
x="
|
|
21
|
-
y="
|
|
30
|
+
x="18"
|
|
31
|
+
y="8"
|
|
22
32
|
width="12"
|
|
23
|
-
height="
|
|
33
|
+
height="3"
|
|
24
34
|
rx="0.5"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
mask="url(#path-1-inside-1_920_47112)"
|
|
35
|
+
transform="rotate(-180 18 8)"
|
|
36
|
+
fill="currentColor"
|
|
28
37
|
/>
|
|
29
38
|
<path
|
|
30
39
|
fillRule="evenodd"
|
|
31
40
|
clipRule="evenodd"
|
|
32
|
-
d="
|
|
41
|
+
d="M11 17V18.01C11.0026 18.2735 11.1092 18.5253 11.2964 18.7107C11.4837 18.896 11.7365 19 12 19C12.556 19 13 18.556 13 18.01V17H14C14.2652 17 14.5196 16.8946 14.7071 16.7071C14.8946 16.5196 15 16.2652 15 16C15 15.7348 14.8946 15.4804 14.7071 15.2929C14.5196 15.1054 14.2652 15 14 15H13V13.99C12.9974 13.7265 12.8908 13.4747 12.7036 13.2893C12.5163 13.104 12.2635 13 12 13C11.444 13 11 13.444 11 13.99V15H10C9.73478 15 9.48043 15.1054 9.29289 15.2929C9.10536 15.4804 9 15.7348 9 16C9 16.2652 9.10536 16.5196 9.29289 16.7071C9.48043 16.8946 9.73478 17 10 17H11Z"
|
|
33
42
|
fill="currentColor"
|
|
34
43
|
/>
|
|
35
44
|
</svg>
|