@atlaskit/editor-plugin-table 7.6.10 → 7.6.11
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/toolbar.js +18 -4
- package/dist/es2019/toolbar.js +18 -4
- package/dist/esm/toolbar.js +18 -4
- package/package.json +4 -1
- package/src/toolbar.tsx +12 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 7.6.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#80728](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/80728) [`aac7ad9bb32d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/aac7ad9bb32d) - [ux] The table's floating toolbar dropdown menu a11y annnouncement.
|
|
8
|
+
|
|
3
9
|
## 7.6.10
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/cjs/toolbar.js
CHANGED
|
@@ -22,6 +22,7 @@ var _utils3 = require("@atlaskit/editor-tables/utils");
|
|
|
22
22
|
var _layoutThreeEqual = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/layout-three-equal"));
|
|
23
23
|
var _remove = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove"));
|
|
24
24
|
var _preferences = _interopRequireDefault(require("@atlaskit/icon/glyph/preferences"));
|
|
25
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
25
26
|
var _commands = require("./commands");
|
|
26
27
|
var _commandsWithAnalytics = require("./commands-with-analytics");
|
|
27
28
|
var _pluginFactory = require("./pm-plugins/plugin-factory");
|
|
@@ -38,31 +39,44 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
38
39
|
|
|
39
40
|
var getToolbarMenuConfig = exports.getToolbarMenuConfig = function getToolbarMenuConfig(config, state, _ref, editorAnalyticsAPI) {
|
|
40
41
|
var formatMessage = _ref.formatMessage;
|
|
42
|
+
var optionItem = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-floating-toolbar-dropdown-menu_zkb33') ? 'item-checkbox' : 'item';
|
|
41
43
|
var options = [{
|
|
42
44
|
id: 'editor.table.headerRow',
|
|
43
45
|
title: formatMessage(_messages.tableMessages.headerRow),
|
|
44
46
|
onClick: (0, _commandsWithAnalytics.toggleHeaderRowWithAnalytics)(editorAnalyticsAPI),
|
|
45
47
|
selected: state.isHeaderRowEnabled,
|
|
46
|
-
hidden: !config.allowHeaderRow
|
|
48
|
+
hidden: !config.allowHeaderRow,
|
|
49
|
+
domItemOptions: {
|
|
50
|
+
type: optionItem
|
|
51
|
+
}
|
|
47
52
|
}, {
|
|
48
53
|
id: 'editor.table.headerColumn',
|
|
49
54
|
title: formatMessage(_messages.tableMessages.headerColumn),
|
|
50
55
|
onClick: (0, _commandsWithAnalytics.toggleHeaderColumnWithAnalytics)(editorAnalyticsAPI),
|
|
51
56
|
selected: state.isHeaderColumnEnabled,
|
|
52
|
-
hidden: !config.allowHeaderColumn
|
|
57
|
+
hidden: !config.allowHeaderColumn,
|
|
58
|
+
domItemOptions: {
|
|
59
|
+
type: optionItem
|
|
60
|
+
}
|
|
53
61
|
}, {
|
|
54
62
|
id: 'editor.table.numberedColumn',
|
|
55
63
|
title: formatMessage(_messages.tableMessages.numberedColumn),
|
|
56
64
|
onClick: (0, _commandsWithAnalytics.toggleNumberColumnWithAnalytics)(editorAnalyticsAPI),
|
|
57
65
|
selected: state.isNumberColumnEnabled,
|
|
58
|
-
hidden: !config.allowNumberColumn
|
|
66
|
+
hidden: !config.allowNumberColumn,
|
|
67
|
+
domItemOptions: {
|
|
68
|
+
type: optionItem
|
|
69
|
+
}
|
|
59
70
|
}, {
|
|
60
71
|
id: 'editor.table.collapseTable',
|
|
61
72
|
title: formatMessage(_messages.tableMessages.collapseTable),
|
|
62
73
|
onClick: (0, _commandsWithAnalytics.wrapTableInExpandWithAnalytics)(editorAnalyticsAPI),
|
|
63
74
|
selected: !!state.isTableCollapsed,
|
|
64
75
|
disabled: !state.canCollapseTable,
|
|
65
|
-
hidden: !config.allowCollapse
|
|
76
|
+
hidden: !config.allowCollapse,
|
|
77
|
+
domItemOptions: {
|
|
78
|
+
type: optionItem
|
|
79
|
+
}
|
|
66
80
|
}];
|
|
67
81
|
if (state.isDragAndDropEnabled) {
|
|
68
82
|
return {
|
package/dist/es2019/toolbar.js
CHANGED
|
@@ -14,6 +14,7 @@ import { findCellRectClosestToPos, findTable, getSelectionRect, isSelectionType,
|
|
|
14
14
|
import DistributeColumnIcon from '@atlaskit/icon/glyph/editor/layout-three-equal';
|
|
15
15
|
import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
16
16
|
import TableOptionsIcon from '@atlaskit/icon/glyph/preferences';
|
|
17
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
17
18
|
import { clearHoverSelection, hoverColumns, hoverMergedCells, hoverRows, hoverTable, removeDescendantNodes } from './commands';
|
|
18
19
|
import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics, deleteTableWithAnalytics, distributeColumnsWidthsWithAnalytics, emptyMultipleCellsWithAnalytics, insertColumnWithAnalytics, insertRowWithAnalytics, mergeCellsWithAnalytics, setColorWithAnalytics, sortColumnWithAnalytics, splitCellWithAnalytics, toggleHeaderColumnWithAnalytics, toggleHeaderRowWithAnalytics, toggleNumberColumnWithAnalytics, wrapTableInExpandWithAnalytics } from './commands-with-analytics';
|
|
19
20
|
import { getPluginState } from './pm-plugins/plugin-factory';
|
|
@@ -27,31 +28,44 @@ import { getMergedCellsPositions, getSelectedColumnIndexes, getSelectedRowIndexe
|
|
|
27
28
|
export const getToolbarMenuConfig = (config, state, {
|
|
28
29
|
formatMessage
|
|
29
30
|
}, editorAnalyticsAPI) => {
|
|
31
|
+
const optionItem = getBooleanFF('platform.editor.a11y-table-floating-toolbar-dropdown-menu_zkb33') ? 'item-checkbox' : 'item';
|
|
30
32
|
const options = [{
|
|
31
33
|
id: 'editor.table.headerRow',
|
|
32
34
|
title: formatMessage(messages.headerRow),
|
|
33
35
|
onClick: toggleHeaderRowWithAnalytics(editorAnalyticsAPI),
|
|
34
36
|
selected: state.isHeaderRowEnabled,
|
|
35
|
-
hidden: !config.allowHeaderRow
|
|
37
|
+
hidden: !config.allowHeaderRow,
|
|
38
|
+
domItemOptions: {
|
|
39
|
+
type: optionItem
|
|
40
|
+
}
|
|
36
41
|
}, {
|
|
37
42
|
id: 'editor.table.headerColumn',
|
|
38
43
|
title: formatMessage(messages.headerColumn),
|
|
39
44
|
onClick: toggleHeaderColumnWithAnalytics(editorAnalyticsAPI),
|
|
40
45
|
selected: state.isHeaderColumnEnabled,
|
|
41
|
-
hidden: !config.allowHeaderColumn
|
|
46
|
+
hidden: !config.allowHeaderColumn,
|
|
47
|
+
domItemOptions: {
|
|
48
|
+
type: optionItem
|
|
49
|
+
}
|
|
42
50
|
}, {
|
|
43
51
|
id: 'editor.table.numberedColumn',
|
|
44
52
|
title: formatMessage(messages.numberedColumn),
|
|
45
53
|
onClick: toggleNumberColumnWithAnalytics(editorAnalyticsAPI),
|
|
46
54
|
selected: state.isNumberColumnEnabled,
|
|
47
|
-
hidden: !config.allowNumberColumn
|
|
55
|
+
hidden: !config.allowNumberColumn,
|
|
56
|
+
domItemOptions: {
|
|
57
|
+
type: optionItem
|
|
58
|
+
}
|
|
48
59
|
}, {
|
|
49
60
|
id: 'editor.table.collapseTable',
|
|
50
61
|
title: formatMessage(messages.collapseTable),
|
|
51
62
|
onClick: wrapTableInExpandWithAnalytics(editorAnalyticsAPI),
|
|
52
63
|
selected: !!state.isTableCollapsed,
|
|
53
64
|
disabled: !state.canCollapseTable,
|
|
54
|
-
hidden: !config.allowCollapse
|
|
65
|
+
hidden: !config.allowCollapse,
|
|
66
|
+
domItemOptions: {
|
|
67
|
+
type: optionItem
|
|
68
|
+
}
|
|
55
69
|
}];
|
|
56
70
|
if (state.isDragAndDropEnabled) {
|
|
57
71
|
return {
|
package/dist/esm/toolbar.js
CHANGED
|
@@ -15,6 +15,7 @@ import { findCellRectClosestToPos, findTable, getSelectionRect, isSelectionType,
|
|
|
15
15
|
import DistributeColumnIcon from '@atlaskit/icon/glyph/editor/layout-three-equal';
|
|
16
16
|
import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
17
17
|
import TableOptionsIcon from '@atlaskit/icon/glyph/preferences';
|
|
18
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
18
19
|
import { clearHoverSelection, hoverColumns, hoverMergedCells, hoverRows, hoverTable, removeDescendantNodes } from './commands';
|
|
19
20
|
import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics, deleteTableWithAnalytics, distributeColumnsWidthsWithAnalytics, emptyMultipleCellsWithAnalytics, insertColumnWithAnalytics, insertRowWithAnalytics, mergeCellsWithAnalytics, setColorWithAnalytics, sortColumnWithAnalytics, splitCellWithAnalytics, toggleHeaderColumnWithAnalytics, toggleHeaderRowWithAnalytics, toggleNumberColumnWithAnalytics, wrapTableInExpandWithAnalytics } from './commands-with-analytics';
|
|
20
21
|
import { getPluginState } from './pm-plugins/plugin-factory';
|
|
@@ -27,31 +28,44 @@ import { FullWidthDisplay } from './ui/TableFullWidthLabel';
|
|
|
27
28
|
import { getMergedCellsPositions, getSelectedColumnIndexes, getSelectedRowIndexes } from './utils';
|
|
28
29
|
export var getToolbarMenuConfig = function getToolbarMenuConfig(config, state, _ref, editorAnalyticsAPI) {
|
|
29
30
|
var formatMessage = _ref.formatMessage;
|
|
31
|
+
var optionItem = getBooleanFF('platform.editor.a11y-table-floating-toolbar-dropdown-menu_zkb33') ? 'item-checkbox' : 'item';
|
|
30
32
|
var options = [{
|
|
31
33
|
id: 'editor.table.headerRow',
|
|
32
34
|
title: formatMessage(messages.headerRow),
|
|
33
35
|
onClick: toggleHeaderRowWithAnalytics(editorAnalyticsAPI),
|
|
34
36
|
selected: state.isHeaderRowEnabled,
|
|
35
|
-
hidden: !config.allowHeaderRow
|
|
37
|
+
hidden: !config.allowHeaderRow,
|
|
38
|
+
domItemOptions: {
|
|
39
|
+
type: optionItem
|
|
40
|
+
}
|
|
36
41
|
}, {
|
|
37
42
|
id: 'editor.table.headerColumn',
|
|
38
43
|
title: formatMessage(messages.headerColumn),
|
|
39
44
|
onClick: toggleHeaderColumnWithAnalytics(editorAnalyticsAPI),
|
|
40
45
|
selected: state.isHeaderColumnEnabled,
|
|
41
|
-
hidden: !config.allowHeaderColumn
|
|
46
|
+
hidden: !config.allowHeaderColumn,
|
|
47
|
+
domItemOptions: {
|
|
48
|
+
type: optionItem
|
|
49
|
+
}
|
|
42
50
|
}, {
|
|
43
51
|
id: 'editor.table.numberedColumn',
|
|
44
52
|
title: formatMessage(messages.numberedColumn),
|
|
45
53
|
onClick: toggleNumberColumnWithAnalytics(editorAnalyticsAPI),
|
|
46
54
|
selected: state.isNumberColumnEnabled,
|
|
47
|
-
hidden: !config.allowNumberColumn
|
|
55
|
+
hidden: !config.allowNumberColumn,
|
|
56
|
+
domItemOptions: {
|
|
57
|
+
type: optionItem
|
|
58
|
+
}
|
|
48
59
|
}, {
|
|
49
60
|
id: 'editor.table.collapseTable',
|
|
50
61
|
title: formatMessage(messages.collapseTable),
|
|
51
62
|
onClick: wrapTableInExpandWithAnalytics(editorAnalyticsAPI),
|
|
52
63
|
selected: !!state.isTableCollapsed,
|
|
53
64
|
disabled: !state.canCollapseTable,
|
|
54
|
-
hidden: !config.allowCollapse
|
|
65
|
+
hidden: !config.allowCollapse,
|
|
66
|
+
domItemOptions: {
|
|
67
|
+
type: optionItem
|
|
68
|
+
}
|
|
55
69
|
}];
|
|
56
70
|
if (state.isDragAndDropEnabled) {
|
|
57
71
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "7.6.
|
|
3
|
+
"version": "7.6.11",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -140,6 +140,9 @@
|
|
|
140
140
|
},
|
|
141
141
|
"platform.editor.table.use-shared-state-hook": {
|
|
142
142
|
"type": "boolean"
|
|
143
|
+
},
|
|
144
|
+
"platform.editor.a11y-table-floating-toolbar-dropdown-menu_zkb33": {
|
|
145
|
+
"type": "boolean"
|
|
143
146
|
}
|
|
144
147
|
}
|
|
145
148
|
}
|
package/src/toolbar.tsx
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
import commonMessages, {
|
|
14
14
|
tableMessages as messages,
|
|
15
15
|
} from '@atlaskit/editor-common/messages';
|
|
16
|
+
import type { typeOption } from '@atlaskit/editor-common/src/types/floating-toolbar';
|
|
16
17
|
import type {
|
|
17
18
|
Command,
|
|
18
19
|
CommandDispatch,
|
|
@@ -51,6 +52,7 @@ import {
|
|
|
51
52
|
import DistributeColumnIcon from '@atlaskit/icon/glyph/editor/layout-three-equal';
|
|
52
53
|
import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
53
54
|
import TableOptionsIcon from '@atlaskit/icon/glyph/preferences';
|
|
55
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
54
56
|
|
|
55
57
|
import {
|
|
56
58
|
clearHoverSelection,
|
|
@@ -102,6 +104,12 @@ export const getToolbarMenuConfig = (
|
|
|
102
104
|
{ formatMessage }: ToolbarMenuContext,
|
|
103
105
|
editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null,
|
|
104
106
|
): FloatingToolbarItem<Command> => {
|
|
107
|
+
const optionItem: typeOption = getBooleanFF(
|
|
108
|
+
'platform.editor.a11y-table-floating-toolbar-dropdown-menu_zkb33',
|
|
109
|
+
)
|
|
110
|
+
? 'item-checkbox'
|
|
111
|
+
: 'item';
|
|
112
|
+
|
|
105
113
|
const options = [
|
|
106
114
|
{
|
|
107
115
|
id: 'editor.table.headerRow',
|
|
@@ -109,6 +117,7 @@ export const getToolbarMenuConfig = (
|
|
|
109
117
|
onClick: toggleHeaderRowWithAnalytics(editorAnalyticsAPI),
|
|
110
118
|
selected: state.isHeaderRowEnabled,
|
|
111
119
|
hidden: !config.allowHeaderRow,
|
|
120
|
+
domItemOptions: { type: optionItem },
|
|
112
121
|
},
|
|
113
122
|
{
|
|
114
123
|
id: 'editor.table.headerColumn',
|
|
@@ -116,6 +125,7 @@ export const getToolbarMenuConfig = (
|
|
|
116
125
|
onClick: toggleHeaderColumnWithAnalytics(editorAnalyticsAPI),
|
|
117
126
|
selected: state.isHeaderColumnEnabled,
|
|
118
127
|
hidden: !config.allowHeaderColumn,
|
|
128
|
+
domItemOptions: { type: optionItem },
|
|
119
129
|
},
|
|
120
130
|
{
|
|
121
131
|
id: 'editor.table.numberedColumn',
|
|
@@ -123,6 +133,7 @@ export const getToolbarMenuConfig = (
|
|
|
123
133
|
onClick: toggleNumberColumnWithAnalytics(editorAnalyticsAPI),
|
|
124
134
|
selected: state.isNumberColumnEnabled,
|
|
125
135
|
hidden: !config.allowNumberColumn,
|
|
136
|
+
domItemOptions: { type: optionItem },
|
|
126
137
|
},
|
|
127
138
|
{
|
|
128
139
|
id: 'editor.table.collapseTable',
|
|
@@ -131,6 +142,7 @@ export const getToolbarMenuConfig = (
|
|
|
131
142
|
selected: !!state.isTableCollapsed,
|
|
132
143
|
disabled: !state.canCollapseTable,
|
|
133
144
|
hidden: !config.allowCollapse,
|
|
145
|
+
domItemOptions: { type: optionItem },
|
|
134
146
|
},
|
|
135
147
|
];
|
|
136
148
|
|