@atlaskit/editor-plugin-table 22.4.3 → 22.4.5
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/nodeviews/TableComponent.js +1 -1
- package/dist/cjs/pm-plugins/table-resizing/utils/scale-table.js +1 -2
- package/dist/cjs/tablePlugin.js +2 -2
- package/dist/cjs/ui/FloatingDragMenu/index.js +9 -6
- package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +4 -6
- package/dist/cjs/ui/TableMenu/column/getColumnMenuComponents.js +194 -0
- package/dist/cjs/ui/TableMenu/column/items/AddColumnLeftItem.js +27 -0
- package/dist/cjs/ui/TableMenu/column/items/AddColumnRightItem.js +27 -0
- package/dist/cjs/ui/TableMenu/column/items/DeleteColumnItem.js +29 -0
- package/dist/cjs/ui/TableMenu/column/items/DistributeColumnsItem.js +22 -0
- package/dist/cjs/ui/TableMenu/column/items/HeaderColumnToggleItem.js +23 -0
- package/dist/cjs/ui/TableMenu/column/items/MoveColumnRightItem.js +33 -0
- package/dist/cjs/ui/TableMenu/column/items/SortDecreasingItem.js +23 -0
- package/dist/cjs/ui/TableMenu/column/items/SortIncreasingItem.js +23 -0
- package/dist/cjs/ui/TableMenu/column/keys.js +79 -0
- package/dist/cjs/ui/TableMenu/row/getRowMenuComponents.js +25 -47
- package/dist/cjs/ui/TableMenu/row/items/AddRowAboveItem.js +27 -0
- package/dist/cjs/ui/TableMenu/row/items/AddRowBelowItem.js +27 -0
- package/dist/cjs/ui/TableMenu/row/items/DeleteRowItem.js +29 -0
- package/dist/cjs/ui/TableMenu/row/items/HeaderRowToggleItem.js +23 -0
- package/dist/cjs/ui/TableMenu/row/items/MoveRowDownItem.js +33 -0
- package/dist/cjs/ui/TableMenu/row/items/MoveRowUpItem.js +33 -0
- package/dist/cjs/ui/TableMenu/row/items/NumberedRowsToggleItem.js +23 -0
- package/dist/cjs/ui/TableMenu/row/keys.js +7 -14
- package/dist/cjs/ui/TableMenu/shared/TableMenu.js +35 -0
- package/dist/cjs/ui/TableMenu/shared/consts.js +2 -2
- package/dist/cjs/ui/TableMenu/shared/getSharedItems.js +46 -0
- package/dist/cjs/ui/TableMenu/shared/getTableMenuComponents.js +14 -0
- package/dist/cjs/ui/TableMenu/shared/items/BackgroundColorItem.js +5 -7
- package/dist/cjs/ui/TableMenu/shared/items/ClearCellsItem.js +1 -3
- package/dist/cjs/ui/TableMenu/shared/keys.js +14 -0
- package/dist/cjs/ui/common-styles.js +4 -4
- package/dist/es2019/nodeviews/TableComponent.js +1 -1
- package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +1 -2
- package/dist/es2019/tablePlugin.js +2 -2
- package/dist/es2019/ui/FloatingDragMenu/index.js +10 -7
- package/dist/es2019/ui/TableFloatingControls/NumberColumn/index.js +4 -4
- package/dist/es2019/ui/TableMenu/column/getColumnMenuComponents.js +160 -0
- package/dist/es2019/ui/TableMenu/column/items/AddColumnLeftItem.js +21 -0
- package/dist/es2019/ui/TableMenu/column/items/AddColumnRightItem.js +21 -0
- package/dist/es2019/ui/TableMenu/column/items/DeleteColumnItem.js +23 -0
- package/dist/es2019/ui/TableMenu/column/items/DistributeColumnsItem.js +16 -0
- package/dist/es2019/ui/TableMenu/column/items/HeaderColumnToggleItem.js +17 -0
- package/dist/es2019/ui/TableMenu/column/items/MoveColumnRightItem.js +25 -0
- package/dist/es2019/ui/TableMenu/column/items/SortDecreasingItem.js +17 -0
- package/dist/es2019/ui/TableMenu/column/items/SortIncreasingItem.js +17 -0
- package/dist/es2019/ui/TableMenu/column/keys.js +93 -0
- package/dist/es2019/ui/TableMenu/row/getRowMenuComponents.js +19 -37
- package/dist/es2019/ui/TableMenu/row/items/AddRowAboveItem.js +21 -0
- package/dist/es2019/ui/TableMenu/row/items/AddRowBelowItem.js +21 -0
- package/dist/es2019/ui/TableMenu/row/items/DeleteRowItem.js +23 -0
- package/dist/es2019/ui/TableMenu/row/items/HeaderRowToggleItem.js +17 -0
- package/dist/es2019/ui/TableMenu/row/items/MoveRowDownItem.js +25 -0
- package/dist/es2019/ui/TableMenu/row/items/MoveRowUpItem.js +25 -0
- package/dist/es2019/ui/TableMenu/row/items/NumberedRowsToggleItem.js +17 -0
- package/dist/es2019/ui/TableMenu/row/keys.js +7 -13
- package/dist/es2019/ui/TableMenu/shared/TableMenu.js +28 -0
- package/dist/es2019/ui/TableMenu/shared/consts.js +1 -1
- package/dist/es2019/ui/TableMenu/shared/getSharedItems.js +33 -0
- package/dist/es2019/ui/TableMenu/shared/getTableMenuComponents.js +4 -0
- package/dist/es2019/ui/TableMenu/shared/items/BackgroundColorItem.js +5 -8
- package/dist/es2019/ui/TableMenu/shared/items/ClearCellsItem.js +1 -4
- package/dist/es2019/ui/TableMenu/shared/keys.js +8 -0
- package/dist/es2019/ui/common-styles.js +167 -66
- package/dist/esm/nodeviews/TableComponent.js +1 -1
- package/dist/esm/pm-plugins/table-resizing/utils/scale-table.js +1 -2
- package/dist/esm/tablePlugin.js +2 -2
- package/dist/esm/ui/FloatingDragMenu/index.js +10 -7
- package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +4 -6
- package/dist/esm/ui/TableMenu/column/getColumnMenuComponents.js +188 -0
- package/dist/esm/ui/TableMenu/column/items/AddColumnLeftItem.js +20 -0
- package/dist/esm/ui/TableMenu/column/items/AddColumnRightItem.js +20 -0
- package/dist/esm/ui/TableMenu/column/items/DeleteColumnItem.js +22 -0
- package/dist/esm/ui/TableMenu/column/items/DistributeColumnsItem.js +15 -0
- package/dist/esm/ui/TableMenu/column/items/HeaderColumnToggleItem.js +16 -0
- package/dist/esm/ui/TableMenu/column/items/MoveColumnRightItem.js +26 -0
- package/dist/esm/ui/TableMenu/column/items/SortDecreasingItem.js +16 -0
- package/dist/esm/ui/TableMenu/column/items/SortIncreasingItem.js +16 -0
- package/dist/esm/ui/TableMenu/column/keys.js +73 -0
- package/dist/esm/ui/TableMenu/row/getRowMenuComponents.js +19 -41
- package/dist/esm/ui/TableMenu/row/items/AddRowAboveItem.js +20 -0
- package/dist/esm/ui/TableMenu/row/items/AddRowBelowItem.js +20 -0
- package/dist/esm/ui/TableMenu/row/items/DeleteRowItem.js +22 -0
- package/dist/esm/ui/TableMenu/row/items/HeaderRowToggleItem.js +16 -0
- package/dist/esm/ui/TableMenu/row/items/MoveRowDownItem.js +26 -0
- package/dist/esm/ui/TableMenu/row/items/MoveRowUpItem.js +26 -0
- package/dist/esm/ui/TableMenu/row/items/NumberedRowsToggleItem.js +16 -0
- package/dist/esm/ui/TableMenu/row/keys.js +7 -13
- package/dist/esm/ui/TableMenu/shared/TableMenu.js +27 -0
- package/dist/esm/ui/TableMenu/shared/consts.js +1 -1
- package/dist/esm/ui/TableMenu/shared/getSharedItems.js +39 -0
- package/dist/esm/ui/TableMenu/shared/getTableMenuComponents.js +7 -0
- package/dist/esm/ui/TableMenu/shared/items/BackgroundColorItem.js +5 -7
- package/dist/esm/ui/TableMenu/shared/items/ClearCellsItem.js +1 -3
- package/dist/esm/ui/TableMenu/shared/keys.js +8 -0
- package/dist/esm/ui/common-styles.js +4 -4
- package/dist/types/ui/TableMenu/column/getColumnMenuComponents.d.ts +9 -0
- package/dist/types/ui/TableMenu/column/items/AddColumnLeftItem.d.ts +2 -0
- package/dist/types/ui/TableMenu/column/items/AddColumnRightItem.d.ts +2 -0
- package/dist/types/ui/TableMenu/column/items/DeleteColumnItem.d.ts +2 -0
- package/dist/types/ui/TableMenu/column/items/DistributeColumnsItem.d.ts +2 -0
- package/dist/types/ui/TableMenu/column/items/HeaderColumnToggleItem.d.ts +2 -0
- package/dist/types/ui/TableMenu/column/items/MoveColumnRightItem.d.ts +2 -0
- package/dist/types/ui/TableMenu/column/items/SortDecreasingItem.d.ts +2 -0
- package/dist/types/ui/TableMenu/column/items/SortIncreasingItem.d.ts +2 -0
- package/dist/types/ui/TableMenu/column/keys.d.ts +21 -0
- package/dist/types/ui/TableMenu/row/items/AddRowAboveItem.d.ts +2 -0
- package/dist/types/ui/TableMenu/row/items/AddRowBelowItem.d.ts +2 -0
- package/dist/types/ui/TableMenu/row/items/DeleteRowItem.d.ts +2 -0
- package/dist/types/ui/TableMenu/row/items/HeaderRowToggleItem.d.ts +2 -0
- package/dist/types/ui/TableMenu/row/items/MoveRowDownItem.d.ts +2 -0
- package/dist/types/ui/TableMenu/row/items/MoveRowUpItem.d.ts +2 -0
- package/dist/types/ui/TableMenu/row/items/NumberedRowsToggleItem.d.ts +2 -0
- package/dist/types/ui/TableMenu/row/keys.d.ts +5 -7
- package/dist/types/ui/TableMenu/shared/TableMenu.d.ts +9 -0
- package/dist/types/ui/TableMenu/shared/consts.d.ts +1 -1
- package/dist/types/ui/TableMenu/shared/getSharedItems.d.ts +2 -0
- package/dist/types/ui/TableMenu/shared/getTableMenuComponents.d.ts +2 -0
- package/dist/types/ui/TableMenu/shared/items/BackgroundColorItem.d.ts +1 -5
- package/dist/types/ui/TableMenu/shared/items/ClearCellsItem.d.ts +1 -5
- package/dist/types/ui/TableMenu/shared/keys.d.ts +3 -0
- package/dist/types-ts4.5/ui/TableMenu/column/getColumnMenuComponents.d.ts +9 -0
- package/dist/types-ts4.5/ui/TableMenu/column/items/AddColumnLeftItem.d.ts +2 -0
- package/dist/types-ts4.5/ui/TableMenu/column/items/AddColumnRightItem.d.ts +2 -0
- package/dist/types-ts4.5/ui/TableMenu/column/items/DeleteColumnItem.d.ts +2 -0
- package/dist/types-ts4.5/ui/TableMenu/column/items/DistributeColumnsItem.d.ts +2 -0
- package/dist/types-ts4.5/ui/TableMenu/column/items/HeaderColumnToggleItem.d.ts +2 -0
- package/dist/types-ts4.5/ui/TableMenu/column/items/MoveColumnRightItem.d.ts +2 -0
- package/dist/types-ts4.5/ui/TableMenu/column/items/SortDecreasingItem.d.ts +2 -0
- package/dist/types-ts4.5/ui/TableMenu/column/items/SortIncreasingItem.d.ts +2 -0
- package/dist/types-ts4.5/ui/TableMenu/column/keys.d.ts +21 -0
- package/dist/types-ts4.5/ui/TableMenu/row/items/AddRowAboveItem.d.ts +2 -0
- package/dist/types-ts4.5/ui/TableMenu/row/items/AddRowBelowItem.d.ts +2 -0
- package/dist/types-ts4.5/ui/TableMenu/row/items/DeleteRowItem.d.ts +2 -0
- package/dist/types-ts4.5/ui/TableMenu/row/items/HeaderRowToggleItem.d.ts +2 -0
- package/dist/types-ts4.5/ui/TableMenu/row/items/MoveRowDownItem.d.ts +2 -0
- package/dist/types-ts4.5/ui/TableMenu/row/items/MoveRowUpItem.d.ts +2 -0
- package/dist/types-ts4.5/ui/TableMenu/row/items/NumberedRowsToggleItem.d.ts +2 -0
- package/dist/types-ts4.5/ui/TableMenu/row/keys.d.ts +5 -7
- package/dist/types-ts4.5/ui/TableMenu/shared/TableMenu.d.ts +9 -0
- package/dist/types-ts4.5/ui/TableMenu/shared/consts.d.ts +1 -1
- package/dist/types-ts4.5/ui/TableMenu/shared/getSharedItems.d.ts +2 -0
- package/dist/types-ts4.5/ui/TableMenu/shared/getTableMenuComponents.d.ts +2 -0
- package/dist/types-ts4.5/ui/TableMenu/shared/items/BackgroundColorItem.d.ts +1 -5
- package/dist/types-ts4.5/ui/TableMenu/shared/items/ClearCellsItem.d.ts +1 -5
- package/dist/types-ts4.5/ui/TableMenu/shared/keys.d.ts +3 -0
- package/package.json +13 -16
- package/dist/cjs/ui/TableMenu/row/RowMenu.js +0 -35
- package/dist/cjs/ui/TableMenu/row/RowMenuItems.js +0 -130
- package/dist/es2019/ui/TableMenu/row/RowMenu.js +0 -27
- package/dist/es2019/ui/TableMenu/row/RowMenuItems.js +0 -126
- package/dist/esm/ui/TableMenu/row/RowMenu.js +0 -28
- package/dist/esm/ui/TableMenu/row/RowMenuItems.js +0 -123
- package/dist/types/ui/TableMenu/row/RowMenu.d.ts +0 -7
- package/dist/types/ui/TableMenu/row/RowMenuItems.d.ts +0 -8
- package/dist/types-ts4.5/ui/TableMenu/row/RowMenu.d.ts +0 -7
- package/dist/types-ts4.5/ui/TableMenu/row/RowMenuItems.d.ts +0 -8
- /package/dist/cjs/ui/TableMenu/{row/RowMenu.compiled.css → shared/TableMenu.compiled.css} +0 -0
- /package/dist/es2019/ui/TableMenu/{row/RowMenu.compiled.css → shared/TableMenu.compiled.css} +0 -0
- /package/dist/esm/ui/TableMenu/{row/RowMenu.compiled.css → shared/TableMenu.compiled.css} +0 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
|
|
3
|
+
import { AddColumnLeftItem } from './items/AddColumnLeftItem';
|
|
4
|
+
import { AddColumnRightItem } from './items/AddColumnRightItem';
|
|
5
|
+
import { DeleteColumnItem } from './items/DeleteColumnItem';
|
|
6
|
+
import { DistributeColumnsItem } from './items/DistributeColumnsItem';
|
|
7
|
+
import { HeaderColumnToggleItem } from './items/HeaderColumnToggleItem';
|
|
8
|
+
import { MoveColumnRightItem } from './items/MoveColumnRightItem';
|
|
9
|
+
import { SortDecreasingItem } from './items/SortDecreasingItem';
|
|
10
|
+
import { SortIncreasingItem } from './items/SortIncreasingItem';
|
|
11
|
+
import { COLUMN_MENU, COLUMN_TOGGLE_SECTION, COLUMN_BACKGROUND_SECTION, COLUMN_SORT_SECTION, COLUMN_ADD_SECTION, COLUMN_DANGER_SECTION, COLUMN_SECTION_RANK, HEADER_COLUMN_TOGGLE_ITEM, SORT_INCREASING_ITEM, SORT_DECREASING_ITEM, ADD_COLUMN_LEFT_ITEM, ADD_COLUMN_RIGHT_ITEM, MOVE_COLUMN_RIGHT_ITEM, DISTRIBUTE_COLUMNS_ITEM, DELETE_COLUMN_ITEM, COLUMN_TOGGLE_SECTION_RANK, COLUMN_SORT_SECTION_RANK, COLUMN_ADD_SECTION_RANK, COLUMN_DANGER_SECTION_RANK } from './keys';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Returns the RegisterComponent[] array defining the column menu surface.
|
|
15
|
+
*
|
|
16
|
+
* This is a **UI-only stub** — all items are always visible with no conditional
|
|
17
|
+
* logic and no wired actions. Functional behaviour (actions, conditional visibility)
|
|
18
|
+
* will be connected in follow-up tickets.
|
|
19
|
+
*/
|
|
20
|
+
export var getColumnMenuComponents = function getColumnMenuComponents() {
|
|
21
|
+
return [
|
|
22
|
+
// --- Menu surface ---
|
|
23
|
+
{
|
|
24
|
+
type: COLUMN_MENU.type,
|
|
25
|
+
key: COLUMN_MENU.key
|
|
26
|
+
},
|
|
27
|
+
// --- Toggle section (Header column) ---
|
|
28
|
+
{
|
|
29
|
+
type: COLUMN_TOGGLE_SECTION.type,
|
|
30
|
+
key: COLUMN_TOGGLE_SECTION.key,
|
|
31
|
+
parents: [{
|
|
32
|
+
type: COLUMN_MENU.type,
|
|
33
|
+
key: COLUMN_MENU.key,
|
|
34
|
+
rank: COLUMN_SECTION_RANK[COLUMN_TOGGLE_SECTION.key]
|
|
35
|
+
}],
|
|
36
|
+
component: function component(props) {
|
|
37
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, null, props.children);
|
|
38
|
+
}
|
|
39
|
+
}, {
|
|
40
|
+
type: HEADER_COLUMN_TOGGLE_ITEM.type,
|
|
41
|
+
key: HEADER_COLUMN_TOGGLE_ITEM.key,
|
|
42
|
+
parents: [{
|
|
43
|
+
type: COLUMN_TOGGLE_SECTION.type,
|
|
44
|
+
key: COLUMN_TOGGLE_SECTION.key,
|
|
45
|
+
rank: COLUMN_TOGGLE_SECTION_RANK[HEADER_COLUMN_TOGGLE_ITEM.key]
|
|
46
|
+
}],
|
|
47
|
+
component: function component() {
|
|
48
|
+
return /*#__PURE__*/React.createElement(HeaderColumnToggleItem, null);
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
// --- Background color section ---
|
|
52
|
+
{
|
|
53
|
+
type: COLUMN_BACKGROUND_SECTION.type,
|
|
54
|
+
key: COLUMN_BACKGROUND_SECTION.key,
|
|
55
|
+
parents: [{
|
|
56
|
+
type: COLUMN_MENU.type,
|
|
57
|
+
key: COLUMN_MENU.key,
|
|
58
|
+
rank: COLUMN_SECTION_RANK[COLUMN_BACKGROUND_SECTION.key]
|
|
59
|
+
}],
|
|
60
|
+
component: function component(props) {
|
|
61
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
|
|
62
|
+
hasSeparator: true
|
|
63
|
+
}, props.children);
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
// --- Sort section ---
|
|
67
|
+
{
|
|
68
|
+
type: COLUMN_SORT_SECTION.type,
|
|
69
|
+
key: COLUMN_SORT_SECTION.key,
|
|
70
|
+
parents: [{
|
|
71
|
+
type: COLUMN_MENU.type,
|
|
72
|
+
key: COLUMN_MENU.key,
|
|
73
|
+
rank: COLUMN_SECTION_RANK[COLUMN_SORT_SECTION.key]
|
|
74
|
+
}],
|
|
75
|
+
component: function component(props) {
|
|
76
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
|
|
77
|
+
hasSeparator: true
|
|
78
|
+
}, props.children);
|
|
79
|
+
}
|
|
80
|
+
}, {
|
|
81
|
+
type: SORT_INCREASING_ITEM.type,
|
|
82
|
+
key: SORT_INCREASING_ITEM.key,
|
|
83
|
+
parents: [{
|
|
84
|
+
type: COLUMN_SORT_SECTION.type,
|
|
85
|
+
key: COLUMN_SORT_SECTION.key,
|
|
86
|
+
rank: COLUMN_SORT_SECTION_RANK[SORT_INCREASING_ITEM.key]
|
|
87
|
+
}],
|
|
88
|
+
component: function component() {
|
|
89
|
+
return /*#__PURE__*/React.createElement(SortIncreasingItem, null);
|
|
90
|
+
}
|
|
91
|
+
}, {
|
|
92
|
+
type: SORT_DECREASING_ITEM.type,
|
|
93
|
+
key: SORT_DECREASING_ITEM.key,
|
|
94
|
+
parents: [{
|
|
95
|
+
type: COLUMN_SORT_SECTION.type,
|
|
96
|
+
key: COLUMN_SORT_SECTION.key,
|
|
97
|
+
rank: COLUMN_SORT_SECTION_RANK[SORT_DECREASING_ITEM.key]
|
|
98
|
+
}],
|
|
99
|
+
component: function component() {
|
|
100
|
+
return /*#__PURE__*/React.createElement(SortDecreasingItem, null);
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
// --- Add / Move section ---
|
|
104
|
+
{
|
|
105
|
+
type: COLUMN_ADD_SECTION.type,
|
|
106
|
+
key: COLUMN_ADD_SECTION.key,
|
|
107
|
+
parents: [{
|
|
108
|
+
type: COLUMN_MENU.type,
|
|
109
|
+
key: COLUMN_MENU.key,
|
|
110
|
+
rank: COLUMN_SECTION_RANK[COLUMN_ADD_SECTION.key]
|
|
111
|
+
}],
|
|
112
|
+
component: function component(props) {
|
|
113
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
|
|
114
|
+
hasSeparator: true
|
|
115
|
+
}, props.children);
|
|
116
|
+
}
|
|
117
|
+
}, {
|
|
118
|
+
type: ADD_COLUMN_LEFT_ITEM.type,
|
|
119
|
+
key: ADD_COLUMN_LEFT_ITEM.key,
|
|
120
|
+
parents: [{
|
|
121
|
+
type: COLUMN_ADD_SECTION.type,
|
|
122
|
+
key: COLUMN_ADD_SECTION.key,
|
|
123
|
+
rank: COLUMN_ADD_SECTION_RANK[ADD_COLUMN_LEFT_ITEM.key]
|
|
124
|
+
}],
|
|
125
|
+
component: function component() {
|
|
126
|
+
return /*#__PURE__*/React.createElement(AddColumnLeftItem, null);
|
|
127
|
+
}
|
|
128
|
+
}, {
|
|
129
|
+
type: ADD_COLUMN_RIGHT_ITEM.type,
|
|
130
|
+
key: ADD_COLUMN_RIGHT_ITEM.key,
|
|
131
|
+
parents: [{
|
|
132
|
+
type: COLUMN_ADD_SECTION.type,
|
|
133
|
+
key: COLUMN_ADD_SECTION.key,
|
|
134
|
+
rank: COLUMN_ADD_SECTION_RANK[ADD_COLUMN_RIGHT_ITEM.key]
|
|
135
|
+
}],
|
|
136
|
+
component: function component() {
|
|
137
|
+
return /*#__PURE__*/React.createElement(AddColumnRightItem, null);
|
|
138
|
+
}
|
|
139
|
+
}, {
|
|
140
|
+
type: MOVE_COLUMN_RIGHT_ITEM.type,
|
|
141
|
+
key: MOVE_COLUMN_RIGHT_ITEM.key,
|
|
142
|
+
parents: [{
|
|
143
|
+
type: COLUMN_ADD_SECTION.type,
|
|
144
|
+
key: COLUMN_ADD_SECTION.key,
|
|
145
|
+
rank: COLUMN_ADD_SECTION_RANK[MOVE_COLUMN_RIGHT_ITEM.key]
|
|
146
|
+
}],
|
|
147
|
+
component: function component() {
|
|
148
|
+
return /*#__PURE__*/React.createElement(MoveColumnRightItem, null);
|
|
149
|
+
}
|
|
150
|
+
}, {
|
|
151
|
+
type: DISTRIBUTE_COLUMNS_ITEM.type,
|
|
152
|
+
key: DISTRIBUTE_COLUMNS_ITEM.key,
|
|
153
|
+
parents: [{
|
|
154
|
+
type: COLUMN_ADD_SECTION.type,
|
|
155
|
+
key: COLUMN_ADD_SECTION.key,
|
|
156
|
+
rank: COLUMN_ADD_SECTION_RANK[DISTRIBUTE_COLUMNS_ITEM.key]
|
|
157
|
+
}],
|
|
158
|
+
component: function component() {
|
|
159
|
+
return /*#__PURE__*/React.createElement(DistributeColumnsItem, null);
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
// --- Danger section (Clear cells, Delete column) ---
|
|
163
|
+
{
|
|
164
|
+
type: COLUMN_DANGER_SECTION.type,
|
|
165
|
+
key: COLUMN_DANGER_SECTION.key,
|
|
166
|
+
parents: [{
|
|
167
|
+
type: COLUMN_MENU.type,
|
|
168
|
+
key: COLUMN_MENU.key,
|
|
169
|
+
rank: COLUMN_SECTION_RANK[COLUMN_DANGER_SECTION.key]
|
|
170
|
+
}],
|
|
171
|
+
component: function component(props) {
|
|
172
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
|
|
173
|
+
hasSeparator: true
|
|
174
|
+
}, props.children);
|
|
175
|
+
}
|
|
176
|
+
}, {
|
|
177
|
+
type: DELETE_COLUMN_ITEM.type,
|
|
178
|
+
key: DELETE_COLUMN_ITEM.key,
|
|
179
|
+
parents: [{
|
|
180
|
+
type: COLUMN_DANGER_SECTION.type,
|
|
181
|
+
key: COLUMN_DANGER_SECTION.key,
|
|
182
|
+
rank: COLUMN_DANGER_SECTION_RANK[DELETE_COLUMN_ITEM.key]
|
|
183
|
+
}],
|
|
184
|
+
component: function component() {
|
|
185
|
+
return /*#__PURE__*/React.createElement(DeleteColumnItem, null);
|
|
186
|
+
}
|
|
187
|
+
}];
|
|
188
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
import { addColumnBefore, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
4
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
|
+
import { TableColumnAddLeftIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
6
|
+
export var AddColumnLeftItem = function AddColumnLeftItem() {
|
|
7
|
+
var _tooltip;
|
|
8
|
+
var _useIntl = useIntl(),
|
|
9
|
+
formatMessage = _useIntl.formatMessage;
|
|
10
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
11
|
+
elemBefore: /*#__PURE__*/React.createElement(TableColumnAddLeftIcon, {
|
|
12
|
+
color: "currentColor",
|
|
13
|
+
label: "",
|
|
14
|
+
size: "small"
|
|
15
|
+
}),
|
|
16
|
+
elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
|
|
17
|
+
shortcut: (_tooltip = tooltip(addColumnBefore)) !== null && _tooltip !== void 0 ? _tooltip : ''
|
|
18
|
+
})
|
|
19
|
+
}, formatMessage(messages.addColumnLeft));
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
import { addColumnAfter, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
4
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
|
+
import { TableColumnAddRightIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
6
|
+
export var AddColumnRightItem = function AddColumnRightItem() {
|
|
7
|
+
var _tooltip;
|
|
8
|
+
var _useIntl = useIntl(),
|
|
9
|
+
formatMessage = _useIntl.formatMessage;
|
|
10
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
11
|
+
elemBefore: /*#__PURE__*/React.createElement(TableColumnAddRightIcon, {
|
|
12
|
+
color: "currentColor",
|
|
13
|
+
label: "",
|
|
14
|
+
size: "small"
|
|
15
|
+
}),
|
|
16
|
+
elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
|
|
17
|
+
shortcut: (_tooltip = tooltip(addColumnAfter)) !== null && _tooltip !== void 0 ? _tooltip : ''
|
|
18
|
+
})
|
|
19
|
+
}, formatMessage(messages.addColumnRight));
|
|
20
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
import { deleteColumn, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
4
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
|
+
import { DeleteIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
6
|
+
export var DeleteColumnItem = function DeleteColumnItem() {
|
|
7
|
+
var _tooltip;
|
|
8
|
+
var _useIntl = useIntl(),
|
|
9
|
+
formatMessage = _useIntl.formatMessage;
|
|
10
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
11
|
+
elemBefore: /*#__PURE__*/React.createElement(DeleteIcon, {
|
|
12
|
+
color: "currentColor",
|
|
13
|
+
label: "",
|
|
14
|
+
size: "small"
|
|
15
|
+
}),
|
|
16
|
+
elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
|
|
17
|
+
shortcut: (_tooltip = tooltip(deleteColumn)) !== null && _tooltip !== void 0 ? _tooltip : ''
|
|
18
|
+
})
|
|
19
|
+
}, formatMessage(messages.removeColumns, {
|
|
20
|
+
0: 1
|
|
21
|
+
}));
|
|
22
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
4
|
+
import { TableColumnsDistributeIcon, ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
5
|
+
export var DistributeColumnsItem = function DistributeColumnsItem() {
|
|
6
|
+
var _useIntl = useIntl(),
|
|
7
|
+
formatMessage = _useIntl.formatMessage;
|
|
8
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
9
|
+
elemBefore: /*#__PURE__*/React.createElement(TableColumnsDistributeIcon, {
|
|
10
|
+
color: "currentColor",
|
|
11
|
+
label: "",
|
|
12
|
+
size: "small"
|
|
13
|
+
})
|
|
14
|
+
}, formatMessage(messages.distributeColumns));
|
|
15
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
4
|
+
import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
5
|
+
import Toggle from '@atlaskit/toggle';
|
|
6
|
+
export var HeaderColumnToggleItem = function HeaderColumnToggleItem() {
|
|
7
|
+
var _useIntl = useIntl(),
|
|
8
|
+
formatMessage = _useIntl.formatMessage;
|
|
9
|
+
var label = formatMessage(messages.headerColumn);
|
|
10
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
11
|
+
elemAfter: /*#__PURE__*/React.createElement(Toggle, {
|
|
12
|
+
label: label,
|
|
13
|
+
isChecked: false
|
|
14
|
+
})
|
|
15
|
+
}, label);
|
|
16
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
import { moveColumnRight, moveColumnRightOld, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
4
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
|
+
import { TableColumnMoveRightIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
6
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
|
+
var getMoveColumnRightShortcut = function getMoveColumnRightShortcut() {
|
|
8
|
+
return tooltip(expValEquals('editor-a11y-fy26-keyboard-move-row-column', 'isEnabled', true) ? moveColumnRight : moveColumnRightOld);
|
|
9
|
+
};
|
|
10
|
+
export var MoveColumnRightItem = function MoveColumnRightItem() {
|
|
11
|
+
var _getMoveColumnRightSh;
|
|
12
|
+
var _useIntl = useIntl(),
|
|
13
|
+
formatMessage = _useIntl.formatMessage;
|
|
14
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
15
|
+
elemBefore: /*#__PURE__*/React.createElement(TableColumnMoveRightIcon, {
|
|
16
|
+
color: "currentColor",
|
|
17
|
+
label: "",
|
|
18
|
+
size: "small"
|
|
19
|
+
}),
|
|
20
|
+
elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
|
|
21
|
+
shortcut: (_getMoveColumnRightSh = getMoveColumnRightShortcut()) !== null && _getMoveColumnRightSh !== void 0 ? _getMoveColumnRightSh : ''
|
|
22
|
+
})
|
|
23
|
+
}, formatMessage(messages.moveColumnRight, {
|
|
24
|
+
0: 1
|
|
25
|
+
}));
|
|
26
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
4
|
+
import { ArrowDownIcon, ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
5
|
+
export var SortDecreasingItem = function SortDecreasingItem() {
|
|
6
|
+
var _useIntl = useIntl(),
|
|
7
|
+
formatMessage = _useIntl.formatMessage;
|
|
8
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
9
|
+
isDisabled: true,
|
|
10
|
+
elemBefore: /*#__PURE__*/React.createElement(ArrowDownIcon, {
|
|
11
|
+
color: "currentColor",
|
|
12
|
+
label: "",
|
|
13
|
+
size: "small"
|
|
14
|
+
})
|
|
15
|
+
}, formatMessage(messages.sortColumnDecreasing));
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
4
|
+
import { ArrowUpIcon, ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
5
|
+
export var SortIncreasingItem = function SortIncreasingItem() {
|
|
6
|
+
var _useIntl = useIntl(),
|
|
7
|
+
formatMessage = _useIntl.formatMessage;
|
|
8
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
9
|
+
isDisabled: true,
|
|
10
|
+
elemBefore: /*#__PURE__*/React.createElement(ArrowUpIcon, {
|
|
11
|
+
color: "currentColor",
|
|
12
|
+
label: "",
|
|
13
|
+
size: "small"
|
|
14
|
+
})
|
|
15
|
+
}, formatMessage(messages.sortColumnIncreasing));
|
|
16
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import { BACKGROUND_COLOR_ITEM, CLEAR_CELLS_ITEM } from '../shared/keys';
|
|
3
|
+
|
|
4
|
+
// --- Menu surface ---
|
|
5
|
+
|
|
6
|
+
export var COLUMN_MENU = {
|
|
7
|
+
type: 'menu',
|
|
8
|
+
key: 'column-handle-menu'
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// --- Sections ---
|
|
12
|
+
|
|
13
|
+
export var COLUMN_TOGGLE_SECTION = {
|
|
14
|
+
type: 'menu-section',
|
|
15
|
+
key: 'column-toggle-section'
|
|
16
|
+
};
|
|
17
|
+
export var COLUMN_BACKGROUND_SECTION = {
|
|
18
|
+
type: 'menu-section',
|
|
19
|
+
key: 'column-background-section'
|
|
20
|
+
};
|
|
21
|
+
export var COLUMN_SORT_SECTION = {
|
|
22
|
+
type: 'menu-section',
|
|
23
|
+
key: 'column-sort-section'
|
|
24
|
+
};
|
|
25
|
+
export var COLUMN_ADD_SECTION = {
|
|
26
|
+
type: 'menu-section',
|
|
27
|
+
key: 'column-add-section'
|
|
28
|
+
};
|
|
29
|
+
export var COLUMN_DANGER_SECTION = {
|
|
30
|
+
type: 'menu-section',
|
|
31
|
+
key: 'column-danger-section'
|
|
32
|
+
};
|
|
33
|
+
export var COLUMN_SECTION_RANK = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, COLUMN_TOGGLE_SECTION.key, 100), COLUMN_BACKGROUND_SECTION.key, 200), COLUMN_SORT_SECTION.key, 300), COLUMN_ADD_SECTION.key, 400), COLUMN_DANGER_SECTION.key, 500);
|
|
34
|
+
export var HEADER_COLUMN_TOGGLE_ITEM = {
|
|
35
|
+
type: 'menu-item',
|
|
36
|
+
key: 'header-column-toggle'
|
|
37
|
+
};
|
|
38
|
+
export var SORT_INCREASING_ITEM = {
|
|
39
|
+
type: 'menu-item',
|
|
40
|
+
key: 'sort-increasing'
|
|
41
|
+
};
|
|
42
|
+
export var SORT_DECREASING_ITEM = {
|
|
43
|
+
type: 'menu-item',
|
|
44
|
+
key: 'sort-decreasing'
|
|
45
|
+
};
|
|
46
|
+
export var ADD_COLUMN_LEFT_ITEM = {
|
|
47
|
+
type: 'menu-item',
|
|
48
|
+
key: 'add-column-left'
|
|
49
|
+
};
|
|
50
|
+
export var ADD_COLUMN_RIGHT_ITEM = {
|
|
51
|
+
type: 'menu-item',
|
|
52
|
+
key: 'add-column-right'
|
|
53
|
+
};
|
|
54
|
+
export var MOVE_COLUMN_RIGHT_ITEM = {
|
|
55
|
+
type: 'menu-item',
|
|
56
|
+
key: 'move-column-right'
|
|
57
|
+
};
|
|
58
|
+
export var DISTRIBUTE_COLUMNS_ITEM = {
|
|
59
|
+
type: 'menu-item',
|
|
60
|
+
key: 'distribute-columns'
|
|
61
|
+
};
|
|
62
|
+
export var DELETE_COLUMN_ITEM = {
|
|
63
|
+
type: 'menu-item',
|
|
64
|
+
key: 'delete-column'
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// --- Item ranks within their sections ---
|
|
68
|
+
|
|
69
|
+
export var COLUMN_TOGGLE_SECTION_RANK = _defineProperty({}, HEADER_COLUMN_TOGGLE_ITEM.key, 100);
|
|
70
|
+
export var COLUMN_BACKGROUND_SECTION_RANK = _defineProperty({}, BACKGROUND_COLOR_ITEM.key, 100);
|
|
71
|
+
export var COLUMN_SORT_SECTION_RANK = _defineProperty(_defineProperty({}, SORT_INCREASING_ITEM.key, 100), SORT_DECREASING_ITEM.key, 200);
|
|
72
|
+
export var COLUMN_ADD_SECTION_RANK = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ADD_COLUMN_LEFT_ITEM.key, 100), ADD_COLUMN_RIGHT_ITEM.key, 200), MOVE_COLUMN_RIGHT_ITEM.key, 300), DISTRIBUTE_COLUMNS_ITEM.key, 400);
|
|
73
|
+
export var COLUMN_DANGER_SECTION_RANK = _defineProperty(_defineProperty({}, CLEAR_CELLS_ITEM.key, 100), DELETE_COLUMN_ITEM.key, 200);
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { HeaderRowToggleItem
|
|
3
|
+
import { AddRowAboveItem } from './items/AddRowAboveItem';
|
|
4
|
+
import { AddRowBelowItem } from './items/AddRowBelowItem';
|
|
5
|
+
import { DeleteRowItem } from './items/DeleteRowItem';
|
|
6
|
+
import { HeaderRowToggleItem } from './items/HeaderRowToggleItem';
|
|
7
|
+
import { MoveRowDownItem } from './items/MoveRowDownItem';
|
|
8
|
+
import { MoveRowUpItem } from './items/MoveRowUpItem';
|
|
9
|
+
import { NumberedRowsToggleItem } from './items/NumberedRowsToggleItem';
|
|
10
|
+
import { ROW_MENU, ROW_TOGGLE_SECTION, ROW_BACKGROUND_SECTION, ROW_ADD_SECTION, ROW_DANGER_SECTION, ROW_MENU_SECTION_RANK, HEADER_ROW_TOGGLE_ITEM, NUMBERED_ROWS_TOGGLE_ITEM, ADD_ROW_ABOVE_ITEM, ADD_ROW_BELOW_ITEM, MOVE_ROW_UP_ITEM, MOVE_ROW_DOWN_ITEM, DELETE_ROW_ITEM, ROW_TOGGLE_SECTION_RANK, ROW_ADD_SECTION_RANK, ROW_DANGER_SECTION_RANK } from './keys';
|
|
7
11
|
|
|
8
12
|
/**
|
|
9
13
|
* Returns the RegisterComponent[] array defining the row menu surface.
|
|
@@ -26,7 +30,7 @@ export var getRowMenuComponents = function getRowMenuComponents() {
|
|
|
26
30
|
parents: [{
|
|
27
31
|
type: ROW_MENU.type,
|
|
28
32
|
key: ROW_MENU.key,
|
|
29
|
-
rank:
|
|
33
|
+
rank: ROW_MENU_SECTION_RANK[ROW_TOGGLE_SECTION.key]
|
|
30
34
|
}],
|
|
31
35
|
component: function component(props) {
|
|
32
36
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, null, props.children);
|
|
@@ -37,7 +41,7 @@ export var getRowMenuComponents = function getRowMenuComponents() {
|
|
|
37
41
|
parents: [{
|
|
38
42
|
type: ROW_TOGGLE_SECTION.type,
|
|
39
43
|
key: ROW_TOGGLE_SECTION.key,
|
|
40
|
-
rank:
|
|
44
|
+
rank: ROW_TOGGLE_SECTION_RANK[HEADER_ROW_TOGGLE_ITEM.key]
|
|
41
45
|
}],
|
|
42
46
|
component: function component() {
|
|
43
47
|
return /*#__PURE__*/React.createElement(HeaderRowToggleItem, null);
|
|
@@ -48,7 +52,7 @@ export var getRowMenuComponents = function getRowMenuComponents() {
|
|
|
48
52
|
parents: [{
|
|
49
53
|
type: ROW_TOGGLE_SECTION.type,
|
|
50
54
|
key: ROW_TOGGLE_SECTION.key,
|
|
51
|
-
rank:
|
|
55
|
+
rank: ROW_TOGGLE_SECTION_RANK[NUMBERED_ROWS_TOGGLE_ITEM.key]
|
|
52
56
|
}],
|
|
53
57
|
component: function component() {
|
|
54
58
|
return /*#__PURE__*/React.createElement(NumberedRowsToggleItem, null);
|
|
@@ -61,26 +65,13 @@ export var getRowMenuComponents = function getRowMenuComponents() {
|
|
|
61
65
|
parents: [{
|
|
62
66
|
type: ROW_MENU.type,
|
|
63
67
|
key: ROW_MENU.key,
|
|
64
|
-
rank:
|
|
68
|
+
rank: ROW_MENU_SECTION_RANK[ROW_BACKGROUND_SECTION.key]
|
|
65
69
|
}],
|
|
66
70
|
component: function component(props) {
|
|
67
71
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
|
|
68
72
|
hasSeparator: true
|
|
69
73
|
}, props.children);
|
|
70
74
|
}
|
|
71
|
-
}, {
|
|
72
|
-
type: BACKGROUND_COLOR_ITEM.type,
|
|
73
|
-
key: BACKGROUND_COLOR_ITEM.key,
|
|
74
|
-
parents: [{
|
|
75
|
-
type: ROW_BACKGROUND_SECTION.type,
|
|
76
|
-
key: ROW_BACKGROUND_SECTION.key,
|
|
77
|
-
rank: BACKGROUND_SECTION_ITEM_RANK[BACKGROUND_COLOR_ITEM.key]
|
|
78
|
-
}],
|
|
79
|
-
component: function component() {
|
|
80
|
-
return /*#__PURE__*/React.createElement(BackgroundColorItem, {
|
|
81
|
-
testId: "row-menu-background-color"
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
75
|
},
|
|
85
76
|
// --- Add / Move section ---
|
|
86
77
|
{
|
|
@@ -89,7 +80,7 @@ export var getRowMenuComponents = function getRowMenuComponents() {
|
|
|
89
80
|
parents: [{
|
|
90
81
|
type: ROW_MENU.type,
|
|
91
82
|
key: ROW_MENU.key,
|
|
92
|
-
rank:
|
|
83
|
+
rank: ROW_MENU_SECTION_RANK[ROW_ADD_SECTION.key]
|
|
93
84
|
}],
|
|
94
85
|
component: function component(props) {
|
|
95
86
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
|
|
@@ -102,7 +93,7 @@ export var getRowMenuComponents = function getRowMenuComponents() {
|
|
|
102
93
|
parents: [{
|
|
103
94
|
type: ROW_ADD_SECTION.type,
|
|
104
95
|
key: ROW_ADD_SECTION.key,
|
|
105
|
-
rank:
|
|
96
|
+
rank: ROW_ADD_SECTION_RANK[ADD_ROW_ABOVE_ITEM.key]
|
|
106
97
|
}],
|
|
107
98
|
component: function component() {
|
|
108
99
|
return /*#__PURE__*/React.createElement(AddRowAboveItem, null);
|
|
@@ -113,7 +104,7 @@ export var getRowMenuComponents = function getRowMenuComponents() {
|
|
|
113
104
|
parents: [{
|
|
114
105
|
type: ROW_ADD_SECTION.type,
|
|
115
106
|
key: ROW_ADD_SECTION.key,
|
|
116
|
-
rank:
|
|
107
|
+
rank: ROW_ADD_SECTION_RANK[ADD_ROW_BELOW_ITEM.key]
|
|
117
108
|
}],
|
|
118
109
|
component: function component() {
|
|
119
110
|
return /*#__PURE__*/React.createElement(AddRowBelowItem, null);
|
|
@@ -124,7 +115,7 @@ export var getRowMenuComponents = function getRowMenuComponents() {
|
|
|
124
115
|
parents: [{
|
|
125
116
|
type: ROW_ADD_SECTION.type,
|
|
126
117
|
key: ROW_ADD_SECTION.key,
|
|
127
|
-
rank:
|
|
118
|
+
rank: ROW_ADD_SECTION_RANK[MOVE_ROW_UP_ITEM.key]
|
|
128
119
|
}],
|
|
129
120
|
component: function component() {
|
|
130
121
|
return /*#__PURE__*/React.createElement(MoveRowUpItem, null);
|
|
@@ -135,7 +126,7 @@ export var getRowMenuComponents = function getRowMenuComponents() {
|
|
|
135
126
|
parents: [{
|
|
136
127
|
type: ROW_ADD_SECTION.type,
|
|
137
128
|
key: ROW_ADD_SECTION.key,
|
|
138
|
-
rank:
|
|
129
|
+
rank: ROW_ADD_SECTION_RANK[MOVE_ROW_DOWN_ITEM.key]
|
|
139
130
|
}],
|
|
140
131
|
component: function component() {
|
|
141
132
|
return /*#__PURE__*/React.createElement(MoveRowDownItem, null);
|
|
@@ -148,33 +139,20 @@ export var getRowMenuComponents = function getRowMenuComponents() {
|
|
|
148
139
|
parents: [{
|
|
149
140
|
type: ROW_MENU.type,
|
|
150
141
|
key: ROW_MENU.key,
|
|
151
|
-
rank:
|
|
142
|
+
rank: ROW_MENU_SECTION_RANK[ROW_DANGER_SECTION.key]
|
|
152
143
|
}],
|
|
153
144
|
component: function component(props) {
|
|
154
145
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
|
|
155
146
|
hasSeparator: true
|
|
156
147
|
}, props.children);
|
|
157
148
|
}
|
|
158
|
-
}, {
|
|
159
|
-
type: CLEAR_CELLS_ITEM.type,
|
|
160
|
-
key: CLEAR_CELLS_ITEM.key,
|
|
161
|
-
parents: [{
|
|
162
|
-
type: ROW_DANGER_SECTION.type,
|
|
163
|
-
key: ROW_DANGER_SECTION.key,
|
|
164
|
-
rank: DANGER_SECTION_ITEM_RANK[CLEAR_CELLS_ITEM.key]
|
|
165
|
-
}],
|
|
166
|
-
component: function component() {
|
|
167
|
-
return /*#__PURE__*/React.createElement(ClearCellsItem, {
|
|
168
|
-
testId: "row-menu-clear-cells"
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
149
|
}, {
|
|
172
150
|
type: DELETE_ROW_ITEM.type,
|
|
173
151
|
key: DELETE_ROW_ITEM.key,
|
|
174
152
|
parents: [{
|
|
175
153
|
type: ROW_DANGER_SECTION.type,
|
|
176
154
|
key: ROW_DANGER_SECTION.key,
|
|
177
|
-
rank:
|
|
155
|
+
rank: ROW_DANGER_SECTION_RANK[DELETE_ROW_ITEM.key]
|
|
178
156
|
}],
|
|
179
157
|
component: function component() {
|
|
180
158
|
return /*#__PURE__*/React.createElement(DeleteRowItem, null);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
import { addRowBefore, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
4
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
|
+
import { TableRowAddAboveIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
6
|
+
export var AddRowAboveItem = function AddRowAboveItem() {
|
|
7
|
+
var _tooltip;
|
|
8
|
+
var _useIntl = useIntl(),
|
|
9
|
+
formatMessage = _useIntl.formatMessage;
|
|
10
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
11
|
+
elemBefore: /*#__PURE__*/React.createElement(TableRowAddAboveIcon, {
|
|
12
|
+
color: "currentColor",
|
|
13
|
+
label: "",
|
|
14
|
+
size: "small"
|
|
15
|
+
}),
|
|
16
|
+
elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
|
|
17
|
+
shortcut: (_tooltip = tooltip(addRowBefore)) !== null && _tooltip !== void 0 ? _tooltip : ''
|
|
18
|
+
})
|
|
19
|
+
}, formatMessage(messages.addRowAbove));
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
import { addRowAfter, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
4
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
|
+
import { TableRowAddBelowIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
6
|
+
export var AddRowBelowItem = function AddRowBelowItem() {
|
|
7
|
+
var _tooltip;
|
|
8
|
+
var _useIntl = useIntl(),
|
|
9
|
+
formatMessage = _useIntl.formatMessage;
|
|
10
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
11
|
+
elemBefore: /*#__PURE__*/React.createElement(TableRowAddBelowIcon, {
|
|
12
|
+
color: "currentColor",
|
|
13
|
+
label: "",
|
|
14
|
+
size: "small"
|
|
15
|
+
}),
|
|
16
|
+
elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
|
|
17
|
+
shortcut: (_tooltip = tooltip(addRowAfter)) !== null && _tooltip !== void 0 ? _tooltip : ''
|
|
18
|
+
})
|
|
19
|
+
}, formatMessage(messages.addRowBelow));
|
|
20
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
import { deleteRow, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
4
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
|
+
import { DeleteIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
6
|
+
export var DeleteRowItem = function DeleteRowItem() {
|
|
7
|
+
var _tooltip;
|
|
8
|
+
var _useIntl = useIntl(),
|
|
9
|
+
formatMessage = _useIntl.formatMessage;
|
|
10
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
11
|
+
elemBefore: /*#__PURE__*/React.createElement(DeleteIcon, {
|
|
12
|
+
color: "currentColor",
|
|
13
|
+
label: "",
|
|
14
|
+
size: "small"
|
|
15
|
+
}),
|
|
16
|
+
elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
|
|
17
|
+
shortcut: (_tooltip = tooltip(deleteRow)) !== null && _tooltip !== void 0 ? _tooltip : ''
|
|
18
|
+
})
|
|
19
|
+
}, formatMessage(messages.removeRows, {
|
|
20
|
+
0: 1
|
|
21
|
+
}));
|
|
22
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
4
|
+
import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
5
|
+
import Toggle from '@atlaskit/toggle';
|
|
6
|
+
export var HeaderRowToggleItem = function HeaderRowToggleItem() {
|
|
7
|
+
var _useIntl = useIntl(),
|
|
8
|
+
formatMessage = _useIntl.formatMessage;
|
|
9
|
+
var label = formatMessage(messages.headerRow);
|
|
10
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
11
|
+
elemAfter: /*#__PURE__*/React.createElement(Toggle, {
|
|
12
|
+
label: label,
|
|
13
|
+
isChecked: false
|
|
14
|
+
})
|
|
15
|
+
}, label);
|
|
16
|
+
};
|