@atlaskit/editor-plugin-table 16.4.4 → 17.0.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 +17 -0
- package/dist/cjs/pm-plugins/commands/misc.js +10 -4
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +2 -0
- package/dist/es2019/pm-plugins/commands/misc.js +10 -4
- package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +2 -0
- package/dist/esm/pm-plugins/commands/misc.js +10 -4
- package/dist/esm/ui/FloatingDragMenu/DragMenu.js +2 -0
- package/dist/types/types/index.d.ts +0 -1
- package/dist/types-ts4.5/types/index.d.ts +0 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 17.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`2bd7dcf49bbf2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2bd7dcf49bbf2) -
|
|
8
|
+
[ux] [EDITOR-4452] remove the selection change after setting the background color on multiple
|
|
9
|
+
table cells behind platform_editor_table_cell_colour_change
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 17.0.0
|
|
13
|
+
|
|
14
|
+
### Major Changes
|
|
15
|
+
|
|
16
|
+
- [`c774e8b6231c2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c774e8b6231c2) -
|
|
17
|
+
EDITOR-4549 Removing allowCellOptionsInFloatingToolbar as a prop as the functionality has been
|
|
18
|
+
removed and changing this prop doesn't do anything
|
|
19
|
+
|
|
3
20
|
## 16.4.4
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -14,6 +14,7 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
14
14
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
15
15
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
16
16
|
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
17
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
17
18
|
var _types = require("../../types");
|
|
18
19
|
var _plugin = require("../decorations/plugin");
|
|
19
20
|
var _columnResizing = require("../decorations/utils/column-resizing");
|
|
@@ -224,7 +225,7 @@ var getTableElementMoveTypeBySlice = exports.getTableElementMoveTypeBySlice = fu
|
|
|
224
225
|
var map = _tableMap.TableMap.get(currentTable.node);
|
|
225
226
|
var slicedMap = _tableMap.TableMap.get(slice.content.firstChild);
|
|
226
227
|
return map.width === slicedMap.width ? 'row' : map.height === slicedMap.height ? 'column' : undefined;
|
|
227
|
-
} catch (
|
|
228
|
+
} catch (_unused) {
|
|
228
229
|
return undefined;
|
|
229
230
|
}
|
|
230
231
|
};
|
|
@@ -361,11 +362,16 @@ var setMultipleCellAttrs = exports.setMultipleCellAttrs = function setMultipleCe
|
|
|
361
362
|
}
|
|
362
363
|
if (tr.docChanged && cursorPos !== undefined) {
|
|
363
364
|
if (dispatch) {
|
|
364
|
-
if (
|
|
365
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_table_cell_colour_change', 'isEnabled', true)) {
|
|
365
366
|
editorView === null || editorView === void 0 || editorView.focus();
|
|
366
|
-
|
|
367
|
+
dispatch(tr);
|
|
368
|
+
} else {
|
|
369
|
+
if (cursorPos !== undefined) {
|
|
370
|
+
editorView === null || editorView === void 0 || editorView.focus();
|
|
371
|
+
tr.setSelection(new _state.TextSelection(tr.doc.resolve(cursorPos)));
|
|
372
|
+
}
|
|
373
|
+
dispatch(tr);
|
|
367
374
|
}
|
|
368
|
-
dispatch(tr);
|
|
369
375
|
}
|
|
370
376
|
return true;
|
|
371
377
|
}
|
|
@@ -472,6 +472,8 @@ var DragMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
472
472
|
if (shouldCloseMenu(state)) {
|
|
473
473
|
if (target && focusTarget === 'handle') {
|
|
474
474
|
target === null || target === void 0 || target.focus();
|
|
475
|
+
} else if ((0, _expValEquals.expValEquals)('platform_editor_table_cell_colour_change', 'isEnabled', true)) {
|
|
476
|
+
editorView.focus();
|
|
475
477
|
} else {
|
|
476
478
|
editorView.dom.focus();
|
|
477
479
|
}
|
|
@@ -5,6 +5,7 @@ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
5
5
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
6
6
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
7
7
|
import { findCellClosestToPos, findTable, getCellsInColumn, getCellsInRow, getSelectionRect, isSelectionType, isTableSelected, removeTable, selectColumns as selectColumnsTransform, selectColumn as selectColumnTransform, selectionCell, selectRows as selectRowsTransform, selectRow as selectRowTransform, setCellAttrs } from '@atlaskit/editor-tables/utils';
|
|
8
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
9
|
import { TableCssClassName as ClassName, TableDecorations } from '../../types';
|
|
9
10
|
import { getDecorations } from '../decorations/plugin';
|
|
10
11
|
import { buildColumnResizingDecorations, clearColumnResizingDecorations } from '../decorations/utils/column-resizing';
|
|
@@ -233,7 +234,7 @@ export const getTableElementMoveTypeBySlice = (slice, state) => {
|
|
|
233
234
|
const map = TableMap.get(currentTable.node);
|
|
234
235
|
const slicedMap = TableMap.get(slice.content.firstChild);
|
|
235
236
|
return map.width === slicedMap.width ? 'row' : map.height === slicedMap.height ? 'column' : undefined;
|
|
236
|
-
} catch
|
|
237
|
+
} catch {
|
|
237
238
|
return undefined;
|
|
238
239
|
}
|
|
239
240
|
};
|
|
@@ -373,11 +374,16 @@ export const setMultipleCellAttrs = (attrs, editorView) => (state, dispatch) =>
|
|
|
373
374
|
}
|
|
374
375
|
if (tr.docChanged && cursorPos !== undefined) {
|
|
375
376
|
if (dispatch) {
|
|
376
|
-
if (
|
|
377
|
+
if (expValEquals('platform_editor_table_cell_colour_change', 'isEnabled', true)) {
|
|
377
378
|
editorView === null || editorView === void 0 ? void 0 : editorView.focus();
|
|
378
|
-
|
|
379
|
+
dispatch(tr);
|
|
380
|
+
} else {
|
|
381
|
+
if (cursorPos !== undefined) {
|
|
382
|
+
editorView === null || editorView === void 0 ? void 0 : editorView.focus();
|
|
383
|
+
tr.setSelection(new TextSelection(tr.doc.resolve(cursorPos)));
|
|
384
|
+
}
|
|
385
|
+
dispatch(tr);
|
|
379
386
|
}
|
|
380
|
-
dispatch(tr);
|
|
381
387
|
}
|
|
382
388
|
return true;
|
|
383
389
|
}
|
|
@@ -462,6 +462,8 @@ const DragMenu = /*#__PURE__*/React.memo(({
|
|
|
462
462
|
if (shouldCloseMenu(state)) {
|
|
463
463
|
if (target && focusTarget === 'handle') {
|
|
464
464
|
target === null || target === void 0 ? void 0 : target.focus();
|
|
465
|
+
} else if (expValEquals('platform_editor_table_cell_colour_change', 'isEnabled', true)) {
|
|
466
|
+
editorView.focus();
|
|
465
467
|
} else {
|
|
466
468
|
editorView.dom.focus();
|
|
467
469
|
}
|
|
@@ -9,6 +9,7 @@ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
9
9
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
10
10
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
11
11
|
import { findCellClosestToPos, findTable, getCellsInColumn, getCellsInRow, getSelectionRect, isSelectionType, isTableSelected, removeTable, selectColumns as selectColumnsTransform, selectColumn as selectColumnTransform, selectionCell, selectRows as selectRowsTransform, selectRow as selectRowTransform, setCellAttrs } from '@atlaskit/editor-tables/utils';
|
|
12
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
12
13
|
import { TableCssClassName as ClassName, TableDecorations } from '../../types';
|
|
13
14
|
import { getDecorations } from '../decorations/plugin';
|
|
14
15
|
import { buildColumnResizingDecorations, clearColumnResizingDecorations } from '../decorations/utils/column-resizing';
|
|
@@ -217,7 +218,7 @@ export var getTableElementMoveTypeBySlice = function getTableElementMoveTypeBySl
|
|
|
217
218
|
var map = TableMap.get(currentTable.node);
|
|
218
219
|
var slicedMap = TableMap.get(slice.content.firstChild);
|
|
219
220
|
return map.width === slicedMap.width ? 'row' : map.height === slicedMap.height ? 'column' : undefined;
|
|
220
|
-
} catch (
|
|
221
|
+
} catch (_unused) {
|
|
221
222
|
return undefined;
|
|
222
223
|
}
|
|
223
224
|
};
|
|
@@ -354,11 +355,16 @@ export var setMultipleCellAttrs = function setMultipleCellAttrs(attrs, editorVie
|
|
|
354
355
|
}
|
|
355
356
|
if (tr.docChanged && cursorPos !== undefined) {
|
|
356
357
|
if (dispatch) {
|
|
357
|
-
if (
|
|
358
|
+
if (expValEquals('platform_editor_table_cell_colour_change', 'isEnabled', true)) {
|
|
358
359
|
editorView === null || editorView === void 0 || editorView.focus();
|
|
359
|
-
|
|
360
|
+
dispatch(tr);
|
|
361
|
+
} else {
|
|
362
|
+
if (cursorPos !== undefined) {
|
|
363
|
+
editorView === null || editorView === void 0 || editorView.focus();
|
|
364
|
+
tr.setSelection(new TextSelection(tr.doc.resolve(cursorPos)));
|
|
365
|
+
}
|
|
366
|
+
dispatch(tr);
|
|
360
367
|
}
|
|
361
|
-
dispatch(tr);
|
|
362
368
|
}
|
|
363
369
|
return true;
|
|
364
370
|
}
|
|
@@ -461,6 +461,8 @@ var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
461
461
|
if (shouldCloseMenu(state)) {
|
|
462
462
|
if (target && focusTarget === 'handle') {
|
|
463
463
|
target === null || target === void 0 || target.focus();
|
|
464
|
+
} else if (expValEquals('platform_editor_table_cell_colour_change', 'isEnabled', true)) {
|
|
465
|
+
editorView.focus();
|
|
464
466
|
} else {
|
|
465
467
|
editorView.dom.focus();
|
|
466
468
|
}
|
|
@@ -55,7 +55,6 @@ export interface PluginConfig {
|
|
|
55
55
|
advanced?: boolean;
|
|
56
56
|
allowAddColumnWithCustomStep?: boolean;
|
|
57
57
|
allowBackgroundColor?: boolean;
|
|
58
|
-
allowCellOptionsInFloatingToolbar?: boolean;
|
|
59
58
|
allowCollapse?: boolean;
|
|
60
59
|
allowColumnResizing?: boolean;
|
|
61
60
|
allowColumnSorting?: boolean;
|
|
@@ -55,7 +55,6 @@ export interface PluginConfig {
|
|
|
55
55
|
advanced?: boolean;
|
|
56
56
|
allowAddColumnWithCustomStep?: boolean;
|
|
57
57
|
allowBackgroundColor?: boolean;
|
|
58
|
-
allowCellOptionsInFloatingToolbar?: boolean;
|
|
59
58
|
allowCollapse?: boolean;
|
|
60
59
|
allowColumnResizing?: boolean;
|
|
61
60
|
allowColumnSorting?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "17.0.1",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@atlaskit/editor-plugin-selection": "^7.0.0",
|
|
45
45
|
"@atlaskit/editor-plugin-toolbar": "^4.1.0",
|
|
46
46
|
"@atlaskit/editor-plugin-user-intent": "^5.0.0",
|
|
47
|
-
"@atlaskit/editor-plugin-width": "^8.
|
|
47
|
+
"@atlaskit/editor-plugin-width": "^8.1.0",
|
|
48
48
|
"@atlaskit/editor-prosemirror": "^7.2.0",
|
|
49
49
|
"@atlaskit/editor-shared-styles": "^3.10.0",
|
|
50
50
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
|
|
58
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.34.0",
|
|
61
61
|
"@atlaskit/toggle": "^15.2.0",
|
|
62
62
|
"@atlaskit/tokens": "^10.1.0",
|
|
63
63
|
"@atlaskit/tooltip": "^20.14.0",
|
|
@@ -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.9.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"
|