@atlaskit/editor-plugin-table 5.3.11 → 5.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/commands.js +5 -2
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/commands.js +6 -3
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/commands.js +6 -3
- package/package.json +2 -2
- package/src/plugins/table/pm-plugins/drag-and-drop/commands.ts +11 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 5.3.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#42109](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42109) [`d25ae495fed`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d25ae495fed) - [ux] Adds a fix to keep selection on a dropped row or column.
|
|
8
|
+
|
|
3
9
|
## 5.3.11
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -76,7 +76,10 @@ var moveSource = exports.moveSource = function moveSource(sourceType, sourceInde
|
|
|
76
76
|
if (sourceIndex === targetIndex) {
|
|
77
77
|
return tr.setMeta('addToHistory', false);
|
|
78
78
|
}
|
|
79
|
-
var
|
|
80
|
-
|
|
79
|
+
var isTableRow = sourceType === 'table-row';
|
|
80
|
+
var move = isTableRow ? _utils.moveRow : _utils.moveColumn;
|
|
81
|
+
var newTr = move(sourceIndex, targetIndex)(tr);
|
|
82
|
+
var select = isTableRow ? _utils.selectRow : _utils.selectColumn;
|
|
83
|
+
return select(targetIndex)(newTr);
|
|
81
84
|
});
|
|
82
85
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
-
import { moveColumn, moveRow } from '@atlaskit/editor-tables/utils';
|
|
2
|
+
import { moveColumn, moveRow, selectColumn, selectRow } from '@atlaskit/editor-tables/utils';
|
|
3
3
|
import { TableDecorations } from '../../types';
|
|
4
4
|
import { createColumnInsertLine, createRowInsertLine, updateDecorations } from '../../utils';
|
|
5
5
|
import { DragAndDropActionType } from './actions';
|
|
@@ -62,6 +62,9 @@ export const moveSource = (sourceType, sourceIndex, targetIndex) => createComman
|
|
|
62
62
|
if (sourceIndex === targetIndex) {
|
|
63
63
|
return tr.setMeta('addToHistory', false);
|
|
64
64
|
}
|
|
65
|
-
const
|
|
66
|
-
|
|
65
|
+
const isTableRow = sourceType === 'table-row';
|
|
66
|
+
const move = isTableRow ? moveRow : moveColumn;
|
|
67
|
+
const newTr = move(sourceIndex, targetIndex)(tr);
|
|
68
|
+
const select = isTableRow ? selectRow : selectColumn;
|
|
69
|
+
return select(targetIndex)(newTr);
|
|
67
70
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
-
import { moveColumn, moveRow } from '@atlaskit/editor-tables/utils';
|
|
2
|
+
import { moveColumn, moveRow, selectColumn, selectRow } from '@atlaskit/editor-tables/utils';
|
|
3
3
|
import { TableDecorations } from '../../types';
|
|
4
4
|
import { createColumnInsertLine, createRowInsertLine, updateDecorations } from '../../utils';
|
|
5
5
|
import { DragAndDropActionType } from './actions';
|
|
@@ -71,7 +71,10 @@ export var moveSource = function moveSource(sourceType, sourceIndex, targetIndex
|
|
|
71
71
|
if (sourceIndex === targetIndex) {
|
|
72
72
|
return tr.setMeta('addToHistory', false);
|
|
73
73
|
}
|
|
74
|
-
var
|
|
75
|
-
|
|
74
|
+
var isTableRow = sourceType === 'table-row';
|
|
75
|
+
var move = isTableRow ? moveRow : moveColumn;
|
|
76
|
+
var newTr = move(sourceIndex, targetIndex)(tr);
|
|
77
|
+
var select = isTableRow ? selectRow : selectColumn;
|
|
78
|
+
return select(targetIndex)(newTr);
|
|
76
79
|
});
|
|
77
80
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.12",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@atlaskit/adf-schema": "^32.0.0",
|
|
31
31
|
"@atlaskit/custom-steps": "^0.0.2",
|
|
32
|
-
"@atlaskit/editor-common": "^76.
|
|
32
|
+
"@atlaskit/editor-common": "^76.15.0",
|
|
33
33
|
"@atlaskit/editor-palette": "1.5.1",
|
|
34
34
|
"@atlaskit/editor-plugin-analytics": "^0.2.0",
|
|
35
35
|
"@atlaskit/editor-plugin-content-insertion": "^0.1.0",
|
|
@@ -4,7 +4,12 @@ import type {
|
|
|
4
4
|
} from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import type { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
moveColumn,
|
|
9
|
+
moveRow,
|
|
10
|
+
selectColumn,
|
|
11
|
+
selectRow,
|
|
12
|
+
} from '@atlaskit/editor-tables/utils';
|
|
8
13
|
|
|
9
14
|
import type { DraggableType } from '../../types';
|
|
10
15
|
import { TableDecorations } from '../../types';
|
|
@@ -109,7 +114,10 @@ export const moveSource = (
|
|
|
109
114
|
return tr.setMeta('addToHistory', false);
|
|
110
115
|
}
|
|
111
116
|
|
|
112
|
-
const
|
|
113
|
-
|
|
117
|
+
const isTableRow = sourceType === 'table-row';
|
|
118
|
+
const move = isTableRow ? moveRow : moveColumn;
|
|
119
|
+
const newTr = move(sourceIndex, targetIndex)(tr);
|
|
120
|
+
const select = isTableRow ? selectRow : selectColumn;
|
|
121
|
+
return select(targetIndex)(newTr);
|
|
114
122
|
},
|
|
115
123
|
);
|