@atlaskit/editor-plugin-table 16.2.0 → 16.3.1
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 +18 -0
- package/dist/cjs/pm-plugins/utils/drag-menu.js +6 -2
- package/dist/cjs/tablePlugin.js +6 -2
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +2 -2
- package/dist/es2019/pm-plugins/utils/drag-menu.js +6 -3
- package/dist/es2019/tablePlugin.js +7 -2
- package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +2 -2
- package/dist/esm/pm-plugins/utils/drag-menu.js +6 -2
- package/dist/esm/tablePlugin.js +6 -2
- package/dist/esm/ui/FloatingDragMenu/DragMenu.js +2 -2
- package/dist/types/pm-plugins/utils/drag-menu.d.ts +1 -1
- package/dist/types/tablePluginType.d.ts +5 -0
- package/dist/types-ts4.5/pm-plugins/utils/drag-menu.d.ts +1 -1
- package/dist/types-ts4.5/tablePluginType.d.ts +5 -0
- package/package.json +8 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 16.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`d668a11849163`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d668a11849163) -
|
|
8
|
+
[ux] EDITOR-4411 Enable sorting by default in column drag menu
|
|
9
|
+
|
|
10
|
+
## 16.3.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- [`814909b91111b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/814909b91111b) -
|
|
15
|
+
[ux] EDITOR-4459 Set dragAndDropEnabled by default in tablesPlugin
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 16.2.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
|
@@ -24,6 +24,7 @@ var _tableRowAddBelow = _interopRequireDefault(require("@atlaskit/icon/core/tabl
|
|
|
24
24
|
var _tableRowDelete = _interopRequireDefault(require("@atlaskit/icon/core/table-row-delete"));
|
|
25
25
|
var _tableRowMoveDown = _interopRequireDefault(require("@atlaskit/icon/core/table-row-move-down"));
|
|
26
26
|
var _tableRowMoveUp = _interopRequireDefault(require("@atlaskit/icon/core/table-row-move-up"));
|
|
27
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
27
28
|
var _toolbar = require("../../ui/toolbar");
|
|
28
29
|
var _commandsWithAnalytics = require("../commands/commands-with-analytics");
|
|
29
30
|
var _commandsWithAnalytics2 = require("../drag-and-drop/commands-with-analytics");
|
|
@@ -80,6 +81,7 @@ var getDragMenuConfig = exports.getDragMenuConfig = function getDragMenuConfig(d
|
|
|
80
81
|
var shouldUseIncreasedScalingPercent = arguments.length > 13 && arguments[13] !== undefined ? arguments[13] : false;
|
|
81
82
|
var ariaNotifyPlugin = arguments.length > 14 ? arguments[14] : undefined;
|
|
82
83
|
var isCommentEditor = arguments.length > 15 && arguments[15] !== undefined ? arguments[15] : false;
|
|
84
|
+
var isColumnSortingEnabled = arguments.length > 16 && arguments[16] !== undefined ? arguments[16] : true;
|
|
83
85
|
var selection = editorView.state.selection;
|
|
84
86
|
var _getTablePluginState = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
85
87
|
getIntl = _getTablePluginState.getIntl;
|
|
@@ -308,7 +310,7 @@ var getDragMenuConfig = exports.getDragMenuConfig = function getDragMenuConfig(d
|
|
|
308
310
|
title: "Move ".concat(direction, " ").concat(label),
|
|
309
311
|
disabled: !canMove,
|
|
310
312
|
icon: icon,
|
|
311
|
-
onClick: function onClick(
|
|
313
|
+
onClick: function onClick(_state, _dispatch) {
|
|
312
314
|
if (canMove) {
|
|
313
315
|
requestAnimationFrame(function () {
|
|
314
316
|
(0, _commandsWithAnalytics2.moveSourceWithAnalytics)(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(_analytics.INPUT_METHOD.TABLE_CONTEXT_MENU, "table-".concat(direction),
|
|
@@ -327,6 +329,8 @@ var getDragMenuConfig = exports.getDragMenuConfig = function getDragMenuConfig(d
|
|
|
327
329
|
};
|
|
328
330
|
})));
|
|
329
331
|
var allConfigs = (0, _toConsumableArray2.default)(restConfigs);
|
|
330
|
-
|
|
332
|
+
if (isColumnSortingEnabled && (0, _platformFeatureFlags.fg)('platform_editor_enable_table_dnd') || !(0, _platformFeatureFlags.fg)('platform_editor_enable_table_dnd')) {
|
|
333
|
+
allConfigs.unshift.apply(allConfigs, (0, _toConsumableArray2.default)(sortConfigs));
|
|
334
|
+
}
|
|
331
335
|
return allConfigs.filter(Boolean);
|
|
332
336
|
};
|
package/dist/cjs/tablePlugin.js
CHANGED
|
@@ -67,12 +67,16 @@ var TABLE_WIDTH_INFO_TIMEOUT = 10000;
|
|
|
67
67
|
* from `@atlaskit/editor-core`.
|
|
68
68
|
*/
|
|
69
69
|
var tablePlugin = function tablePlugin(_ref) {
|
|
70
|
-
var _api$analytics, _options$getEditorFea, _options$getEditorFea2;
|
|
71
|
-
var
|
|
70
|
+
var _config$tableOptions, _fg, _api$analytics, _options$getEditorFea, _options$getEditorFea2;
|
|
71
|
+
var config = _ref.config,
|
|
72
72
|
api = _ref.api;
|
|
73
73
|
var editorViewRef = {
|
|
74
74
|
current: null
|
|
75
75
|
};
|
|
76
|
+
var options = _objectSpread(_objectSpread({}, config), {}, {
|
|
77
|
+
tableOptions: (_config$tableOptions = config === null || config === void 0 ? void 0 : config.tableOptions) !== null && _config$tableOptions !== void 0 ? _config$tableOptions : {},
|
|
78
|
+
dragAndDropEnabled: (_fg = (0, _platformFeatureFlags.fg)('platform_editor_enable_table_dnd')) !== null && _fg !== void 0 ? _fg : config === null || config === void 0 ? void 0 : config.dragAndDropEnabled
|
|
79
|
+
});
|
|
76
80
|
var defaultGetEditorContainerWidth = function defaultGetEditorContainerWidth() {
|
|
77
81
|
var _api$width$sharedStat, _api$width, _document$body$offset, _document;
|
|
78
82
|
return (_api$width$sharedStat = api === null || api === void 0 || (_api$width = api.width) === null || _api$width === void 0 ? void 0 : _api$width.sharedState.currentState()) !== null && _api$width$sharedStat !== void 0 ? _api$width$sharedStat : {
|
|
@@ -194,7 +194,7 @@ var convertToDropdownItems = function convertToDropdownItems(dragMenuConfig, for
|
|
|
194
194
|
};
|
|
195
195
|
};
|
|
196
196
|
var DragMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
197
|
-
var _tableMap$hasMergedCe, _pluginConfig$allowBa;
|
|
197
|
+
var _tableMap$hasMergedCe, _pluginConfig$allowBa, _pluginConfig$allowCo;
|
|
198
198
|
var _ref$direction = _ref.direction,
|
|
199
199
|
direction = _ref$direction === void 0 ? 'row' : _ref$direction,
|
|
200
200
|
index = _ref.index,
|
|
@@ -234,7 +234,7 @@ var DragMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
234
234
|
(0, _utils2.getSelectionRect)(selection) : (0, _utils2.findCellRectClosestToPos)(selection.$from);
|
|
235
235
|
var hasMergedCellsInTable = (_tableMap$hasMergedCe = tableMap === null || tableMap === void 0 ? void 0 : tableMap.hasMergedCells()) !== null && _tableMap$hasMergedCe !== void 0 ? _tableMap$hasMergedCe : false;
|
|
236
236
|
var allowBackgroundColor = (_pluginConfig$allowBa = pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.allowBackgroundColor) !== null && _pluginConfig$allowBa !== void 0 ? _pluginConfig$allowBa : false;
|
|
237
|
-
var dragMenuConfig = (0, _dragMenu.getDragMenuConfig)(direction, getEditorContainerWidth, hasMergedCellsInTable, editorView, api, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.isHeaderRowRequired, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, ariaNotifyPlugin, isCommentEditor);
|
|
237
|
+
var dragMenuConfig = (0, _dragMenu.getDragMenuConfig)(direction, getEditorContainerWidth, hasMergedCellsInTable, editorView, api, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.isHeaderRowRequired, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, ariaNotifyPlugin, isCommentEditor, (_pluginConfig$allowCo = pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.allowColumnSorting) !== null && _pluginConfig$allowCo !== void 0 ? _pluginConfig$allowCo : true);
|
|
238
238
|
var _convertToDropdownIte = convertToDropdownItems(dragMenuConfig, formatMessage, selectionRect),
|
|
239
239
|
menuItems = _convertToDropdownIte.menuItems,
|
|
240
240
|
menuCallback = _convertToDropdownIte.menuCallback;
|
|
@@ -16,6 +16,7 @@ import TableRowAddBelowIcon from '@atlaskit/icon/core/table-row-add-below';
|
|
|
16
16
|
import TableRowDeleteIcon from '@atlaskit/icon/core/table-row-delete';
|
|
17
17
|
import TableRowMoveDownIcon from '@atlaskit/icon/core/table-row-move-down';
|
|
18
18
|
import TableRowMoveUpIcon from '@atlaskit/icon/core/table-row-move-up';
|
|
19
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
19
20
|
import { getClosestSelectionRect } from '../../ui/toolbar';
|
|
20
21
|
import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics, distributeColumnsWidthsWithAnalytics, emptyMultipleCellsWithAnalytics, insertColumnWithAnalytics, insertRowWithAnalytics, sortColumnWithAnalytics } from '../commands/commands-with-analytics';
|
|
21
22
|
import { moveSourceWithAnalytics } from '../drag-and-drop/commands-with-analytics';
|
|
@@ -63,7 +64,7 @@ const defaultSelectionRect = {
|
|
|
63
64
|
right: 0,
|
|
64
65
|
bottom: 0
|
|
65
66
|
};
|
|
66
|
-
export const getDragMenuConfig = (direction, getEditorContainerWidth, hasMergedCellsInTable, editorView, api, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, isHeaderRowRequired, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false, ariaNotifyPlugin, isCommentEditor = false) => {
|
|
67
|
+
export const getDragMenuConfig = (direction, getEditorContainerWidth, hasMergedCellsInTable, editorView, api, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, isHeaderRowRequired, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false, ariaNotifyPlugin, isCommentEditor = false, isColumnSortingEnabled = true) => {
|
|
67
68
|
var _tableMap$height, _tableMap$height2, _tableMap$width, _tableMap$width2;
|
|
68
69
|
const {
|
|
69
70
|
selection
|
|
@@ -258,7 +259,7 @@ export const getDragMenuConfig = (direction, getEditorContainerWidth, hasMergedC
|
|
|
258
259
|
title: `Move ${direction} ${label}`,
|
|
259
260
|
disabled: !canMove,
|
|
260
261
|
icon: icon,
|
|
261
|
-
onClick: (
|
|
262
|
+
onClick: (_state, _dispatch) => {
|
|
262
263
|
if (canMove) {
|
|
263
264
|
requestAnimationFrame(() => {
|
|
264
265
|
moveSourceWithAnalytics(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(INPUT_METHOD.TABLE_CONTEXT_MENU, `table-${direction}`,
|
|
@@ -276,6 +277,8 @@ export const getDragMenuConfig = (direction, getEditorContainerWidth, hasMergedC
|
|
|
276
277
|
keymap: keymap && tooltip(keymap)
|
|
277
278
|
}))];
|
|
278
279
|
const allConfigs = [...restConfigs];
|
|
279
|
-
|
|
280
|
+
if (isColumnSortingEnabled && fg('platform_editor_enable_table_dnd') || !fg('platform_editor_enable_table_dnd')) {
|
|
281
|
+
allConfigs.unshift(...sortConfigs);
|
|
282
|
+
}
|
|
280
283
|
return allConfigs.filter(Boolean);
|
|
281
284
|
};
|
|
@@ -53,13 +53,18 @@ const TABLE_WIDTH_INFO_TIMEOUT = 10000;
|
|
|
53
53
|
* from `@atlaskit/editor-core`.
|
|
54
54
|
*/
|
|
55
55
|
const tablePlugin = ({
|
|
56
|
-
config
|
|
56
|
+
config,
|
|
57
57
|
api
|
|
58
58
|
}) => {
|
|
59
|
-
var _api$analytics, _options$getEditorFea, _options$getEditorFea2;
|
|
59
|
+
var _config$tableOptions, _fg, _api$analytics, _options$getEditorFea, _options$getEditorFea2;
|
|
60
60
|
const editorViewRef = {
|
|
61
61
|
current: null
|
|
62
62
|
};
|
|
63
|
+
const options = {
|
|
64
|
+
...config,
|
|
65
|
+
tableOptions: (_config$tableOptions = config === null || config === void 0 ? void 0 : config.tableOptions) !== null && _config$tableOptions !== void 0 ? _config$tableOptions : {},
|
|
66
|
+
dragAndDropEnabled: (_fg = fg('platform_editor_enable_table_dnd')) !== null && _fg !== void 0 ? _fg : config === null || config === void 0 ? void 0 : config.dragAndDropEnabled
|
|
67
|
+
};
|
|
63
68
|
const defaultGetEditorContainerWidth = () => {
|
|
64
69
|
var _api$width$sharedStat, _api$width, _document$body$offset, _document, _document$body;
|
|
65
70
|
return (_api$width$sharedStat = api === null || api === void 0 ? void 0 : (_api$width = api.width) === null || _api$width === void 0 ? void 0 : _api$width.sharedState.currentState()) !== null && _api$width$sharedStat !== void 0 ? _api$width$sharedStat : {
|
|
@@ -204,7 +204,7 @@ const DragMenu = /*#__PURE__*/React.memo(({
|
|
|
204
204
|
ariaNotifyPlugin,
|
|
205
205
|
isCommentEditor
|
|
206
206
|
}) => {
|
|
207
|
-
var _tableMap$hasMergedCe, _pluginConfig$allowBa;
|
|
207
|
+
var _tableMap$hasMergedCe, _pluginConfig$allowBa, _pluginConfig$allowCo;
|
|
208
208
|
const {
|
|
209
209
|
state,
|
|
210
210
|
dispatch
|
|
@@ -223,7 +223,7 @@ const DragMenu = /*#__PURE__*/React.memo(({
|
|
|
223
223
|
getSelectionRect(selection) : findCellRectClosestToPos(selection.$from);
|
|
224
224
|
const hasMergedCellsInTable = (_tableMap$hasMergedCe = tableMap === null || tableMap === void 0 ? void 0 : tableMap.hasMergedCells()) !== null && _tableMap$hasMergedCe !== void 0 ? _tableMap$hasMergedCe : false;
|
|
225
225
|
const allowBackgroundColor = (_pluginConfig$allowBa = pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.allowBackgroundColor) !== null && _pluginConfig$allowBa !== void 0 ? _pluginConfig$allowBa : false;
|
|
226
|
-
const dragMenuConfig = getDragMenuConfig(direction, getEditorContainerWidth, hasMergedCellsInTable, editorView, api, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.isHeaderRowRequired, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, ariaNotifyPlugin, isCommentEditor);
|
|
226
|
+
const dragMenuConfig = getDragMenuConfig(direction, getEditorContainerWidth, hasMergedCellsInTable, editorView, api, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.isHeaderRowRequired, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, ariaNotifyPlugin, isCommentEditor, (_pluginConfig$allowCo = pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.allowColumnSorting) !== null && _pluginConfig$allowCo !== void 0 ? _pluginConfig$allowCo : true);
|
|
227
227
|
const {
|
|
228
228
|
menuItems,
|
|
229
229
|
menuCallback
|
|
@@ -17,6 +17,7 @@ import TableRowAddBelowIcon from '@atlaskit/icon/core/table-row-add-below';
|
|
|
17
17
|
import TableRowDeleteIcon from '@atlaskit/icon/core/table-row-delete';
|
|
18
18
|
import TableRowMoveDownIcon from '@atlaskit/icon/core/table-row-move-down';
|
|
19
19
|
import TableRowMoveUpIcon from '@atlaskit/icon/core/table-row-move-up';
|
|
20
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
20
21
|
import { getClosestSelectionRect } from '../../ui/toolbar';
|
|
21
22
|
import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics, distributeColumnsWidthsWithAnalytics, emptyMultipleCellsWithAnalytics, insertColumnWithAnalytics, insertRowWithAnalytics, sortColumnWithAnalytics } from '../commands/commands-with-analytics';
|
|
22
23
|
import { moveSourceWithAnalytics } from '../drag-and-drop/commands-with-analytics';
|
|
@@ -73,6 +74,7 @@ export var getDragMenuConfig = function getDragMenuConfig(direction, getEditorCo
|
|
|
73
74
|
var shouldUseIncreasedScalingPercent = arguments.length > 13 && arguments[13] !== undefined ? arguments[13] : false;
|
|
74
75
|
var ariaNotifyPlugin = arguments.length > 14 ? arguments[14] : undefined;
|
|
75
76
|
var isCommentEditor = arguments.length > 15 && arguments[15] !== undefined ? arguments[15] : false;
|
|
77
|
+
var isColumnSortingEnabled = arguments.length > 16 && arguments[16] !== undefined ? arguments[16] : true;
|
|
76
78
|
var selection = editorView.state.selection;
|
|
77
79
|
var _getTablePluginState = getTablePluginState(editorView.state),
|
|
78
80
|
getIntl = _getTablePluginState.getIntl;
|
|
@@ -301,7 +303,7 @@ export var getDragMenuConfig = function getDragMenuConfig(direction, getEditorCo
|
|
|
301
303
|
title: "Move ".concat(direction, " ").concat(label),
|
|
302
304
|
disabled: !canMove,
|
|
303
305
|
icon: icon,
|
|
304
|
-
onClick: function onClick(
|
|
306
|
+
onClick: function onClick(_state, _dispatch) {
|
|
305
307
|
if (canMove) {
|
|
306
308
|
requestAnimationFrame(function () {
|
|
307
309
|
moveSourceWithAnalytics(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(INPUT_METHOD.TABLE_CONTEXT_MENU, "table-".concat(direction),
|
|
@@ -320,6 +322,8 @@ export var getDragMenuConfig = function getDragMenuConfig(direction, getEditorCo
|
|
|
320
322
|
};
|
|
321
323
|
})));
|
|
322
324
|
var allConfigs = _toConsumableArray(restConfigs);
|
|
323
|
-
|
|
325
|
+
if (isColumnSortingEnabled && fg('platform_editor_enable_table_dnd') || !fg('platform_editor_enable_table_dnd')) {
|
|
326
|
+
allConfigs.unshift.apply(allConfigs, _toConsumableArray(sortConfigs));
|
|
327
|
+
}
|
|
324
328
|
return allConfigs.filter(Boolean);
|
|
325
329
|
};
|
package/dist/esm/tablePlugin.js
CHANGED
|
@@ -58,12 +58,16 @@ var TABLE_WIDTH_INFO_TIMEOUT = 10000;
|
|
|
58
58
|
* from `@atlaskit/editor-core`.
|
|
59
59
|
*/
|
|
60
60
|
var tablePlugin = function tablePlugin(_ref) {
|
|
61
|
-
var _api$analytics, _options$getEditorFea, _options$getEditorFea2;
|
|
62
|
-
var
|
|
61
|
+
var _config$tableOptions, _fg, _api$analytics, _options$getEditorFea, _options$getEditorFea2;
|
|
62
|
+
var config = _ref.config,
|
|
63
63
|
api = _ref.api;
|
|
64
64
|
var editorViewRef = {
|
|
65
65
|
current: null
|
|
66
66
|
};
|
|
67
|
+
var options = _objectSpread(_objectSpread({}, config), {}, {
|
|
68
|
+
tableOptions: (_config$tableOptions = config === null || config === void 0 ? void 0 : config.tableOptions) !== null && _config$tableOptions !== void 0 ? _config$tableOptions : {},
|
|
69
|
+
dragAndDropEnabled: (_fg = fg('platform_editor_enable_table_dnd')) !== null && _fg !== void 0 ? _fg : config === null || config === void 0 ? void 0 : config.dragAndDropEnabled
|
|
70
|
+
});
|
|
67
71
|
var defaultGetEditorContainerWidth = function defaultGetEditorContainerWidth() {
|
|
68
72
|
var _api$width$sharedStat, _api$width, _document$body$offset, _document;
|
|
69
73
|
return (_api$width$sharedStat = api === null || api === void 0 || (_api$width = api.width) === null || _api$width === void 0 ? void 0 : _api$width.sharedState.currentState()) !== null && _api$width$sharedStat !== void 0 ? _api$width$sharedStat : {
|
|
@@ -183,7 +183,7 @@ var convertToDropdownItems = function convertToDropdownItems(dragMenuConfig, for
|
|
|
183
183
|
};
|
|
184
184
|
};
|
|
185
185
|
var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
|
|
186
|
-
var _tableMap$hasMergedCe, _pluginConfig$allowBa;
|
|
186
|
+
var _tableMap$hasMergedCe, _pluginConfig$allowBa, _pluginConfig$allowCo;
|
|
187
187
|
var _ref$direction = _ref.direction,
|
|
188
188
|
direction = _ref$direction === void 0 ? 'row' : _ref$direction,
|
|
189
189
|
index = _ref.index,
|
|
@@ -223,7 +223,7 @@ var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
223
223
|
getSelectionRect(selection) : findCellRectClosestToPos(selection.$from);
|
|
224
224
|
var hasMergedCellsInTable = (_tableMap$hasMergedCe = tableMap === null || tableMap === void 0 ? void 0 : tableMap.hasMergedCells()) !== null && _tableMap$hasMergedCe !== void 0 ? _tableMap$hasMergedCe : false;
|
|
225
225
|
var allowBackgroundColor = (_pluginConfig$allowBa = pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.allowBackgroundColor) !== null && _pluginConfig$allowBa !== void 0 ? _pluginConfig$allowBa : false;
|
|
226
|
-
var dragMenuConfig = getDragMenuConfig(direction, getEditorContainerWidth, hasMergedCellsInTable, editorView, api, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.isHeaderRowRequired, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, ariaNotifyPlugin, isCommentEditor);
|
|
226
|
+
var dragMenuConfig = getDragMenuConfig(direction, getEditorContainerWidth, hasMergedCellsInTable, editorView, api, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.isHeaderRowRequired, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, ariaNotifyPlugin, isCommentEditor, (_pluginConfig$allowCo = pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.allowColumnSorting) !== null && _pluginConfig$allowCo !== void 0 ? _pluginConfig$allowCo : true);
|
|
227
227
|
var _convertToDropdownIte = convertToDropdownItems(dragMenuConfig, formatMessage, selectionRect),
|
|
228
228
|
menuItems = _convertToDropdownIte.menuItems,
|
|
229
229
|
menuCallback = _convertToDropdownIte.menuCallback;
|
|
@@ -16,4 +16,4 @@ export interface DragMenuConfig extends Omit<DropdownOptionT<Command>, 'icon'> {
|
|
|
16
16
|
id: DragMenuOptionIdType;
|
|
17
17
|
keymap?: string;
|
|
18
18
|
}
|
|
19
|
-
export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, hasMergedCellsInTable: boolean, editorView: EditorView, api: PluginInjectionAPI | undefined | null, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, ariaNotifyPlugin?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void, isCommentEditor?: boolean) => DragMenuConfig[];
|
|
19
|
+
export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, hasMergedCellsInTable: boolean, editorView: EditorView, api: PluginInjectionAPI | undefined | null, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, ariaNotifyPlugin?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void, isCommentEditor?: boolean, isColumnSortingEnabled?: boolean) => DragMenuConfig[];
|
|
@@ -17,6 +17,11 @@ import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
|
17
17
|
import type { PluginConfig, TableSharedState } from './types';
|
|
18
18
|
export interface TablePluginOptions {
|
|
19
19
|
allowContextualMenu?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-49683 Internal documentation for deprecation (no external access)}
|
|
22
|
+
* Deprecating this prop to enable drag and drop in tables by default.
|
|
23
|
+
* See {@link https://hello.atlassian.net/wiki/spaces/EDITOR/pages/6312469305/Deprecating+legacy+table+controls} for rollout plan
|
|
24
|
+
**/
|
|
20
25
|
dragAndDropEnabled?: boolean;
|
|
21
26
|
fullWidthEnabled?: boolean;
|
|
22
27
|
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
@@ -16,4 +16,4 @@ export interface DragMenuConfig extends Omit<DropdownOptionT<Command>, 'icon'> {
|
|
|
16
16
|
id: DragMenuOptionIdType;
|
|
17
17
|
keymap?: string;
|
|
18
18
|
}
|
|
19
|
-
export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, hasMergedCellsInTable: boolean, editorView: EditorView, api: PluginInjectionAPI | undefined | null, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, ariaNotifyPlugin?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void, isCommentEditor?: boolean) => DragMenuConfig[];
|
|
19
|
+
export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, hasMergedCellsInTable: boolean, editorView: EditorView, api: PluginInjectionAPI | undefined | null, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, ariaNotifyPlugin?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void, isCommentEditor?: boolean, isColumnSortingEnabled?: boolean) => DragMenuConfig[];
|
|
@@ -17,6 +17,11 @@ import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
|
17
17
|
import type { PluginConfig, TableSharedState } from './types';
|
|
18
18
|
export interface TablePluginOptions {
|
|
19
19
|
allowContextualMenu?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-49683 Internal documentation for deprecation (no external access)}
|
|
22
|
+
* Deprecating this prop to enable drag and drop in tables by default.
|
|
23
|
+
* See {@link https://hello.atlassian.net/wiki/spaces/EDITOR/pages/6312469305/Deprecating+legacy+table+controls} for rollout plan
|
|
24
|
+
**/
|
|
20
25
|
dragAndDropEnabled?: boolean;
|
|
21
26
|
fullWidthEnabled?: boolean;
|
|
22
27
|
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.3.1",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -55,12 +55,12 @@
|
|
|
55
55
|
"@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
|
|
56
56
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
|
|
57
57
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
|
|
58
|
-
"@atlaskit/primitives": "^17.
|
|
58
|
+
"@atlaskit/primitives": "^17.1.0",
|
|
59
59
|
"@atlaskit/theme": "^21.0.0",
|
|
60
|
-
"@atlaskit/tmp-editor-statsig": "^16.
|
|
60
|
+
"@atlaskit/tmp-editor-statsig": "^16.23.0",
|
|
61
61
|
"@atlaskit/toggle": "^15.2.0",
|
|
62
62
|
"@atlaskit/tokens": "^9.1.0",
|
|
63
|
-
"@atlaskit/tooltip": "^20.
|
|
63
|
+
"@atlaskit/tooltip": "^20.14.0",
|
|
64
64
|
"@babel/runtime": "^7.0.0",
|
|
65
65
|
"@emotion/react": "^11.7.1",
|
|
66
66
|
"classnames": "^2.2.5",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"uuid": "^3.1.0"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
|
-
"@atlaskit/editor-common": "^111.
|
|
73
|
+
"@atlaskit/editor-common": "^111.8.0",
|
|
74
74
|
"react": "^18.2.0",
|
|
75
75
|
"react-dom": "^18.2.0",
|
|
76
76
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -174,6 +174,9 @@
|
|
|
174
174
|
},
|
|
175
175
|
"platform_editor_table_less_padding_fix": {
|
|
176
176
|
"type": "boolean"
|
|
177
|
+
},
|
|
178
|
+
"platform_editor_enable_table_dnd": {
|
|
179
|
+
"type": "boolean"
|
|
177
180
|
}
|
|
178
181
|
}
|
|
179
182
|
}
|