@atlaskit/editor-plugin-table 39.0.1 → 39.0.3
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 +13 -0
- package/dist/cjs/ui/TableMenu/cell/getCellMenuComponents.js +3 -136
- package/dist/cjs/ui/TableMenu/column/getColumnMenuComponents.js +1 -205
- package/dist/cjs/ui/TableMenu/row/getRowMenuComponents.js +1 -161
- package/dist/cjs/ui/TableMenu/shared/getSharedItems.js +2 -49
- package/dist/cjs/ui/TableMenu/shared/selection.js +1 -6
- package/dist/es2019/ui/TableMenu/cell/getCellMenuComponents.js +3 -118
- package/dist/es2019/ui/TableMenu/column/getColumnMenuComponents.js +2 -178
- package/dist/es2019/ui/TableMenu/row/getRowMenuComponents.js +2 -140
- package/dist/es2019/ui/TableMenu/shared/getSharedItems.js +2 -45
- package/dist/es2019/ui/TableMenu/shared/selection.js +2 -9
- package/dist/esm/ui/TableMenu/cell/getCellMenuComponents.js +3 -136
- package/dist/esm/ui/TableMenu/column/getColumnMenuComponents.js +2 -206
- package/dist/esm/ui/TableMenu/row/getRowMenuComponents.js +2 -162
- package/dist/esm/ui/TableMenu/shared/getSharedItems.js +2 -49
- package/dist/esm/ui/TableMenu/shared/selection.js +1 -6
- package/dist/types/ui/TableMenu/column/getColumnMenuComponents.d.ts +1 -1
- package/dist/types/ui/TableMenu/shared/selection.d.ts +1 -2
- package/package.json +3 -6
|
@@ -4,7 +4,6 @@ import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar/toolbar-dro
|
|
|
4
4
|
import AlignPositionBottomIcon from '@atlaskit/icon-lab/core/align-position-bottom';
|
|
5
5
|
import AlignPositionCenterVerticalIcon from '@atlaskit/icon-lab/core/align-position-center-vertical';
|
|
6
6
|
import AlignPositionTopIcon from '@atlaskit/icon-lab/core/align-position-top';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
8
7
|
import { MergeCellsItem } from './items/MergeCellsItem';
|
|
9
8
|
import { SplitCellItem } from './items/SplitCellItem';
|
|
10
9
|
import { VerticalAlignDropdownItem } from './items/VerticalAlignDropdownItem';
|
|
@@ -12,10 +11,9 @@ import { VerticalAlignNestedMenu } from './items/VerticalAlignNestedMenu';
|
|
|
12
11
|
import { CELL_MENU, CELL_ACTION_SECTION, CELL_ADD_SECTION, CELL_DANGER_SECTION, CELL_MENU_RANK, MERGE_CELLS_ITEM, SPLIT_CELL_ITEM, CELL_ACTION_SECTION_RANK, CELL_ADD_SECTION_RANK, VERTICAL_ALIGN_BOTTOM_ITEM, VERTICAL_ALIGN_MENU, VERTICAL_ALIGN_MENU_RANK, VERTICAL_ALIGN_MENU_SECTION, VERTICAL_ALIGN_MENU_SECTION_RANK, VERTICAL_ALIGN_MIDDLE_ITEM, VERTICAL_ALIGN_TOP_ITEM } from './keys';
|
|
13
12
|
export var getCellMenuComponents = function getCellMenuComponents(_ref) {
|
|
14
13
|
var api = _ref.api;
|
|
15
|
-
return
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
// items); the danger section gains the shared Delete column/row items.
|
|
14
|
+
return [
|
|
15
|
+
// Merge/Split cells live in the Add section (alongside the shared add/distribute
|
|
16
|
+
// items); the danger section also contains the shared Delete column/row items.
|
|
19
17
|
|
|
20
18
|
// --- Menu surface ---
|
|
21
19
|
{
|
|
@@ -148,137 +146,6 @@ export var getCellMenuComponents = function getCellMenuComponents(_ref) {
|
|
|
148
146
|
}
|
|
149
147
|
},
|
|
150
148
|
// --- Danger section (Clear cell + shared Delete column / Delete row) ---
|
|
151
|
-
{
|
|
152
|
-
type: CELL_DANGER_SECTION.type,
|
|
153
|
-
key: CELL_DANGER_SECTION.key,
|
|
154
|
-
parents: [{
|
|
155
|
-
type: CELL_MENU.type,
|
|
156
|
-
key: CELL_MENU.key,
|
|
157
|
-
rank: CELL_MENU_RANK[CELL_DANGER_SECTION.key]
|
|
158
|
-
}],
|
|
159
|
-
component: function component(props) {
|
|
160
|
-
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
|
|
161
|
-
hasSeparator: true
|
|
162
|
-
}, props.children);
|
|
163
|
-
}
|
|
164
|
-
}] : [
|
|
165
|
-
// --- Cell menu update OFF: legacy cell menu (Merge/Split live in the action section) ---
|
|
166
|
-
|
|
167
|
-
// --- Menu surface ---
|
|
168
|
-
{
|
|
169
|
-
type: CELL_MENU.type,
|
|
170
|
-
key: CELL_MENU.key
|
|
171
|
-
},
|
|
172
|
-
// --- Main action section (Background color, Merge cells, Split cell) ---
|
|
173
|
-
{
|
|
174
|
-
type: CELL_ACTION_SECTION.type,
|
|
175
|
-
key: CELL_ACTION_SECTION.key,
|
|
176
|
-
parents: [{
|
|
177
|
-
type: CELL_MENU.type,
|
|
178
|
-
key: CELL_MENU.key,
|
|
179
|
-
rank: CELL_MENU_RANK[CELL_ACTION_SECTION.key]
|
|
180
|
-
}],
|
|
181
|
-
component: function component(props) {
|
|
182
|
-
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, null, props.children);
|
|
183
|
-
}
|
|
184
|
-
}, {
|
|
185
|
-
type: VERTICAL_ALIGN_MENU.type,
|
|
186
|
-
key: VERTICAL_ALIGN_MENU.key,
|
|
187
|
-
parents: [{
|
|
188
|
-
type: CELL_ACTION_SECTION.type,
|
|
189
|
-
key: CELL_ACTION_SECTION.key,
|
|
190
|
-
rank: CELL_ACTION_SECTION_RANK[VERTICAL_ALIGN_MENU.key]
|
|
191
|
-
}],
|
|
192
|
-
component: function component(props) {
|
|
193
|
-
return /*#__PURE__*/React.createElement(VerticalAlignNestedMenu, null, props.children);
|
|
194
|
-
}
|
|
195
|
-
}, {
|
|
196
|
-
type: VERTICAL_ALIGN_MENU_SECTION.type,
|
|
197
|
-
key: VERTICAL_ALIGN_MENU_SECTION.key,
|
|
198
|
-
parents: [{
|
|
199
|
-
type: VERTICAL_ALIGN_MENU.type,
|
|
200
|
-
key: VERTICAL_ALIGN_MENU.key,
|
|
201
|
-
rank: VERTICAL_ALIGN_MENU_RANK[VERTICAL_ALIGN_MENU_SECTION.key]
|
|
202
|
-
}],
|
|
203
|
-
component: function component(props) {
|
|
204
|
-
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, null, props.children);
|
|
205
|
-
}
|
|
206
|
-
}, {
|
|
207
|
-
type: VERTICAL_ALIGN_TOP_ITEM.type,
|
|
208
|
-
key: VERTICAL_ALIGN_TOP_ITEM.key,
|
|
209
|
-
parents: [{
|
|
210
|
-
type: VERTICAL_ALIGN_MENU_SECTION.type,
|
|
211
|
-
key: VERTICAL_ALIGN_MENU_SECTION.key,
|
|
212
|
-
rank: VERTICAL_ALIGN_MENU_SECTION_RANK[VERTICAL_ALIGN_TOP_ITEM.key]
|
|
213
|
-
}],
|
|
214
|
-
component: function component() {
|
|
215
|
-
return /*#__PURE__*/React.createElement(VerticalAlignDropdownItem, {
|
|
216
|
-
api: api,
|
|
217
|
-
icon: AlignPositionTopIcon,
|
|
218
|
-
label: messages.cellAlignmentTop,
|
|
219
|
-
value: "top"
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
}, {
|
|
223
|
-
type: VERTICAL_ALIGN_MIDDLE_ITEM.type,
|
|
224
|
-
key: VERTICAL_ALIGN_MIDDLE_ITEM.key,
|
|
225
|
-
parents: [{
|
|
226
|
-
type: VERTICAL_ALIGN_MENU_SECTION.type,
|
|
227
|
-
key: VERTICAL_ALIGN_MENU_SECTION.key,
|
|
228
|
-
rank: VERTICAL_ALIGN_MENU_SECTION_RANK[VERTICAL_ALIGN_MIDDLE_ITEM.key]
|
|
229
|
-
}],
|
|
230
|
-
component: function component() {
|
|
231
|
-
return /*#__PURE__*/React.createElement(VerticalAlignDropdownItem, {
|
|
232
|
-
api: api,
|
|
233
|
-
icon: AlignPositionCenterVerticalIcon,
|
|
234
|
-
label: messages.cellAlignmentMiddle,
|
|
235
|
-
value: "middle"
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
}, {
|
|
239
|
-
type: VERTICAL_ALIGN_BOTTOM_ITEM.type,
|
|
240
|
-
key: VERTICAL_ALIGN_BOTTOM_ITEM.key,
|
|
241
|
-
parents: [{
|
|
242
|
-
type: VERTICAL_ALIGN_MENU_SECTION.type,
|
|
243
|
-
key: VERTICAL_ALIGN_MENU_SECTION.key,
|
|
244
|
-
rank: VERTICAL_ALIGN_MENU_SECTION_RANK[VERTICAL_ALIGN_BOTTOM_ITEM.key]
|
|
245
|
-
}],
|
|
246
|
-
component: function component() {
|
|
247
|
-
return /*#__PURE__*/React.createElement(VerticalAlignDropdownItem, {
|
|
248
|
-
api: api,
|
|
249
|
-
icon: AlignPositionBottomIcon,
|
|
250
|
-
label: messages.cellAlignmentBottom,
|
|
251
|
-
value: "bottom"
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
}, {
|
|
255
|
-
type: MERGE_CELLS_ITEM.type,
|
|
256
|
-
key: MERGE_CELLS_ITEM.key,
|
|
257
|
-
parents: [{
|
|
258
|
-
type: CELL_ACTION_SECTION.type,
|
|
259
|
-
key: CELL_ACTION_SECTION.key,
|
|
260
|
-
rank: CELL_ACTION_SECTION_RANK[MERGE_CELLS_ITEM.key]
|
|
261
|
-
}],
|
|
262
|
-
component: function component() {
|
|
263
|
-
return /*#__PURE__*/React.createElement(MergeCellsItem, {
|
|
264
|
-
api: api
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
}, {
|
|
268
|
-
type: SPLIT_CELL_ITEM.type,
|
|
269
|
-
key: SPLIT_CELL_ITEM.key,
|
|
270
|
-
parents: [{
|
|
271
|
-
type: CELL_ACTION_SECTION.type,
|
|
272
|
-
key: CELL_ACTION_SECTION.key,
|
|
273
|
-
rank: CELL_ACTION_SECTION_RANK[SPLIT_CELL_ITEM.key]
|
|
274
|
-
}],
|
|
275
|
-
component: function component() {
|
|
276
|
-
return /*#__PURE__*/React.createElement(SplitCellItem, {
|
|
277
|
-
api: api
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
},
|
|
281
|
-
// --- Danger section (Clear cell) ---
|
|
282
149
|
{
|
|
283
150
|
type: CELL_DANGER_SECTION.type,
|
|
284
151
|
key: CELL_DANGER_SECTION.key,
|
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar/toolbar-dropdown-item-section';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
4
3
|
import { AddColumnLeftItem } from './items/AddColumnLeftItem';
|
|
5
|
-
import { AddColumnRightItem } from './items/AddColumnRightItem';
|
|
6
4
|
import { ColumnBackgroundSection } from './items/ColumnBackgroundSection';
|
|
7
5
|
import { ColumnToggleSection } from './items/ColumnToggleSection';
|
|
8
|
-
import { DeleteColumnItem } from './items/DeleteColumnItem';
|
|
9
|
-
import { DistributeColumnsItem } from './items/DistributeColumnsItem';
|
|
10
6
|
import { HeaderColumnToggleItem } from './items/HeaderColumnToggleItem';
|
|
11
7
|
import { MoveColumnLeftItem } from './items/MoveColumnLeftItem';
|
|
12
8
|
import { MoveColumnRightItem } from './items/MoveColumnRightItem';
|
|
13
9
|
import { SortDecreasingItem } from './items/SortDecreasingItem';
|
|
14
10
|
import { SortIncreasingItem } from './items/SortIncreasingItem';
|
|
15
|
-
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,
|
|
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, MOVE_COLUMN_LEFT_ITEM, MOVE_COLUMN_RIGHT_ITEM, COLUMN_TOGGLE_SECTION_RANK, COLUMN_SORT_SECTION_RANK, COLUMN_ADD_SECTION_RANK } from './keys';
|
|
16
12
|
export var getColumnMenuComponents = function getColumnMenuComponents(_ref) {
|
|
17
13
|
var api = _ref.api;
|
|
18
|
-
return
|
|
19
|
-
// --- Cell menu update ON ---
|
|
14
|
+
return [
|
|
20
15
|
// AddColumnRightItem/DistributeColumnsItem/DeleteColumnItem are registered in
|
|
21
16
|
// `../shared/getSharedItems` (shared with the cell menu), so they are omitted here.
|
|
22
17
|
|
|
@@ -177,204 +172,5 @@ export var getColumnMenuComponents = function getColumnMenuComponents(_ref) {
|
|
|
177
172
|
hasSeparator: true
|
|
178
173
|
}, props.children);
|
|
179
174
|
}
|
|
180
|
-
}] : [
|
|
181
|
-
// --- Cell menu update OFF: legacy column menu (registers its own add/delete items) ---
|
|
182
|
-
|
|
183
|
-
// --- Menu surface ---
|
|
184
|
-
{
|
|
185
|
-
type: COLUMN_MENU.type,
|
|
186
|
-
key: COLUMN_MENU.key
|
|
187
|
-
},
|
|
188
|
-
// --- Toggle section (Header column) ---
|
|
189
|
-
{
|
|
190
|
-
type: COLUMN_TOGGLE_SECTION.type,
|
|
191
|
-
key: COLUMN_TOGGLE_SECTION.key,
|
|
192
|
-
parents: [{
|
|
193
|
-
type: COLUMN_MENU.type,
|
|
194
|
-
key: COLUMN_MENU.key,
|
|
195
|
-
rank: COLUMN_SECTION_RANK[COLUMN_TOGGLE_SECTION.key]
|
|
196
|
-
}],
|
|
197
|
-
component: function component(props) {
|
|
198
|
-
return /*#__PURE__*/React.createElement(ColumnToggleSection, {
|
|
199
|
-
api: api
|
|
200
|
-
}, props.children);
|
|
201
|
-
}
|
|
202
|
-
}, {
|
|
203
|
-
type: HEADER_COLUMN_TOGGLE_ITEM.type,
|
|
204
|
-
key: HEADER_COLUMN_TOGGLE_ITEM.key,
|
|
205
|
-
parents: [{
|
|
206
|
-
type: COLUMN_TOGGLE_SECTION.type,
|
|
207
|
-
key: COLUMN_TOGGLE_SECTION.key,
|
|
208
|
-
rank: COLUMN_TOGGLE_SECTION_RANK[HEADER_COLUMN_TOGGLE_ITEM.key]
|
|
209
|
-
}],
|
|
210
|
-
component: function component() {
|
|
211
|
-
return /*#__PURE__*/React.createElement(HeaderColumnToggleItem, {
|
|
212
|
-
api: api
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
},
|
|
216
|
-
// --- Background color section ---
|
|
217
|
-
{
|
|
218
|
-
type: COLUMN_BACKGROUND_SECTION.type,
|
|
219
|
-
key: COLUMN_BACKGROUND_SECTION.key,
|
|
220
|
-
parents: [{
|
|
221
|
-
type: COLUMN_MENU.type,
|
|
222
|
-
key: COLUMN_MENU.key,
|
|
223
|
-
rank: COLUMN_SECTION_RANK[COLUMN_BACKGROUND_SECTION.key]
|
|
224
|
-
}],
|
|
225
|
-
component: function component(props) {
|
|
226
|
-
return /*#__PURE__*/React.createElement(ColumnBackgroundSection, {
|
|
227
|
-
api: api
|
|
228
|
-
}, props.children);
|
|
229
|
-
}
|
|
230
|
-
},
|
|
231
|
-
// --- Sort section ---
|
|
232
|
-
{
|
|
233
|
-
type: COLUMN_SORT_SECTION.type,
|
|
234
|
-
key: COLUMN_SORT_SECTION.key,
|
|
235
|
-
parents: [{
|
|
236
|
-
type: COLUMN_MENU.type,
|
|
237
|
-
key: COLUMN_MENU.key,
|
|
238
|
-
rank: COLUMN_SECTION_RANK[COLUMN_SORT_SECTION.key]
|
|
239
|
-
}],
|
|
240
|
-
component: function component(props) {
|
|
241
|
-
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
|
|
242
|
-
hasSeparator: true
|
|
243
|
-
}, props.children);
|
|
244
|
-
}
|
|
245
|
-
}, {
|
|
246
|
-
type: SORT_INCREASING_ITEM.type,
|
|
247
|
-
key: SORT_INCREASING_ITEM.key,
|
|
248
|
-
parents: [{
|
|
249
|
-
type: COLUMN_SORT_SECTION.type,
|
|
250
|
-
key: COLUMN_SORT_SECTION.key,
|
|
251
|
-
rank: COLUMN_SORT_SECTION_RANK[SORT_INCREASING_ITEM.key]
|
|
252
|
-
}],
|
|
253
|
-
component: function component() {
|
|
254
|
-
return /*#__PURE__*/React.createElement(SortIncreasingItem, {
|
|
255
|
-
api: api
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
}, {
|
|
259
|
-
type: SORT_DECREASING_ITEM.type,
|
|
260
|
-
key: SORT_DECREASING_ITEM.key,
|
|
261
|
-
parents: [{
|
|
262
|
-
type: COLUMN_SORT_SECTION.type,
|
|
263
|
-
key: COLUMN_SORT_SECTION.key,
|
|
264
|
-
rank: COLUMN_SORT_SECTION_RANK[SORT_DECREASING_ITEM.key]
|
|
265
|
-
}],
|
|
266
|
-
component: function component() {
|
|
267
|
-
return /*#__PURE__*/React.createElement(SortDecreasingItem, {
|
|
268
|
-
api: api
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
},
|
|
272
|
-
// --- Add / Move section ---
|
|
273
|
-
{
|
|
274
|
-
type: COLUMN_ADD_SECTION.type,
|
|
275
|
-
key: COLUMN_ADD_SECTION.key,
|
|
276
|
-
parents: [{
|
|
277
|
-
type: COLUMN_MENU.type,
|
|
278
|
-
key: COLUMN_MENU.key,
|
|
279
|
-
rank: COLUMN_SECTION_RANK[COLUMN_ADD_SECTION.key]
|
|
280
|
-
}],
|
|
281
|
-
component: function component(props) {
|
|
282
|
-
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
|
|
283
|
-
hasSeparator: true
|
|
284
|
-
}, props.children);
|
|
285
|
-
}
|
|
286
|
-
}, {
|
|
287
|
-
type: ADD_COLUMN_LEFT_ITEM.type,
|
|
288
|
-
key: ADD_COLUMN_LEFT_ITEM.key,
|
|
289
|
-
parents: [{
|
|
290
|
-
type: COLUMN_ADD_SECTION.type,
|
|
291
|
-
key: COLUMN_ADD_SECTION.key,
|
|
292
|
-
rank: COLUMN_ADD_SECTION_RANK[ADD_COLUMN_LEFT_ITEM.key]
|
|
293
|
-
}],
|
|
294
|
-
component: function component() {
|
|
295
|
-
return /*#__PURE__*/React.createElement(AddColumnLeftItem, {
|
|
296
|
-
api: api
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
}, {
|
|
300
|
-
type: ADD_COLUMN_RIGHT_ITEM.type,
|
|
301
|
-
key: ADD_COLUMN_RIGHT_ITEM.key,
|
|
302
|
-
parents: [{
|
|
303
|
-
type: COLUMN_ADD_SECTION.type,
|
|
304
|
-
key: COLUMN_ADD_SECTION.key,
|
|
305
|
-
rank: COLUMN_ADD_SECTION_RANK[ADD_COLUMN_RIGHT_ITEM.key]
|
|
306
|
-
}],
|
|
307
|
-
component: function component() {
|
|
308
|
-
return /*#__PURE__*/React.createElement(AddColumnRightItem, {
|
|
309
|
-
api: api
|
|
310
|
-
});
|
|
311
|
-
}
|
|
312
|
-
}, {
|
|
313
|
-
type: MOVE_COLUMN_LEFT_ITEM.type,
|
|
314
|
-
key: MOVE_COLUMN_LEFT_ITEM.key,
|
|
315
|
-
parents: [{
|
|
316
|
-
type: COLUMN_ADD_SECTION.type,
|
|
317
|
-
key: COLUMN_ADD_SECTION.key,
|
|
318
|
-
rank: COLUMN_ADD_SECTION_RANK[MOVE_COLUMN_LEFT_ITEM.key]
|
|
319
|
-
}],
|
|
320
|
-
component: function component() {
|
|
321
|
-
return /*#__PURE__*/React.createElement(MoveColumnLeftItem, {
|
|
322
|
-
api: api
|
|
323
|
-
});
|
|
324
|
-
}
|
|
325
|
-
}, {
|
|
326
|
-
type: MOVE_COLUMN_RIGHT_ITEM.type,
|
|
327
|
-
key: MOVE_COLUMN_RIGHT_ITEM.key,
|
|
328
|
-
parents: [{
|
|
329
|
-
type: COLUMN_ADD_SECTION.type,
|
|
330
|
-
key: COLUMN_ADD_SECTION.key,
|
|
331
|
-
rank: COLUMN_ADD_SECTION_RANK[MOVE_COLUMN_RIGHT_ITEM.key]
|
|
332
|
-
}],
|
|
333
|
-
component: function component() {
|
|
334
|
-
return /*#__PURE__*/React.createElement(MoveColumnRightItem, {
|
|
335
|
-
api: api
|
|
336
|
-
});
|
|
337
|
-
}
|
|
338
|
-
}, {
|
|
339
|
-
type: DISTRIBUTE_COLUMNS_ITEM.type,
|
|
340
|
-
key: DISTRIBUTE_COLUMNS_ITEM.key,
|
|
341
|
-
parents: [{
|
|
342
|
-
type: COLUMN_ADD_SECTION.type,
|
|
343
|
-
key: COLUMN_ADD_SECTION.key,
|
|
344
|
-
rank: COLUMN_ADD_SECTION_RANK[DISTRIBUTE_COLUMNS_ITEM.key]
|
|
345
|
-
}],
|
|
346
|
-
component: function component() {
|
|
347
|
-
return /*#__PURE__*/React.createElement(DistributeColumnsItem, {
|
|
348
|
-
api: api
|
|
349
|
-
});
|
|
350
|
-
}
|
|
351
|
-
},
|
|
352
|
-
// --- Danger section (Clear cells, Delete column) ---
|
|
353
|
-
{
|
|
354
|
-
type: COLUMN_DANGER_SECTION.type,
|
|
355
|
-
key: COLUMN_DANGER_SECTION.key,
|
|
356
|
-
parents: [{
|
|
357
|
-
type: COLUMN_MENU.type,
|
|
358
|
-
key: COLUMN_MENU.key,
|
|
359
|
-
rank: COLUMN_SECTION_RANK[COLUMN_DANGER_SECTION.key]
|
|
360
|
-
}],
|
|
361
|
-
component: function component(props) {
|
|
362
|
-
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
|
|
363
|
-
hasSeparator: true
|
|
364
|
-
}, props.children);
|
|
365
|
-
}
|
|
366
|
-
}, {
|
|
367
|
-
type: DELETE_COLUMN_ITEM.type,
|
|
368
|
-
key: DELETE_COLUMN_ITEM.key,
|
|
369
|
-
parents: [{
|
|
370
|
-
type: COLUMN_DANGER_SECTION.type,
|
|
371
|
-
key: COLUMN_DANGER_SECTION.key,
|
|
372
|
-
rank: COLUMN_DANGER_SECTION_RANK[DELETE_COLUMN_ITEM.key]
|
|
373
|
-
}],
|
|
374
|
-
component: function component() {
|
|
375
|
-
return /*#__PURE__*/React.createElement(DeleteColumnItem, {
|
|
376
|
-
api: api
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
175
|
}];
|
|
380
176
|
};
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar/toolbar-dropdown-item-section';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
4
3
|
import { AddRowAboveItem } from './items/AddRowAboveItem';
|
|
5
|
-
import { AddRowBelowItem } from './items/AddRowBelowItem';
|
|
6
|
-
import { DeleteRowItem } from './items/DeleteRowItem';
|
|
7
4
|
import { HeaderRowToggleItem } from './items/HeaderRowToggleItem';
|
|
8
5
|
import { MoveRowDownItem } from './items/MoveRowDownItem';
|
|
9
6
|
import { MoveRowUpItem } from './items/MoveRowUpItem';
|
|
10
7
|
import { NumberedRowsToggleItem } from './items/NumberedRowsToggleItem';
|
|
11
|
-
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,
|
|
8
|
+
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, MOVE_ROW_UP_ITEM, MOVE_ROW_DOWN_ITEM, ROW_TOGGLE_SECTION_RANK, ROW_ADD_SECTION_RANK } from './keys';
|
|
12
9
|
export var getRowMenuComponents = function getRowMenuComponents(_ref) {
|
|
13
10
|
var api = _ref.api;
|
|
14
|
-
return
|
|
15
|
-
// --- Cell menu update ON ---
|
|
11
|
+
return [
|
|
16
12
|
// AddRowBelowItem/DeleteRowItem are registered in `../shared/getSharedItems`
|
|
17
13
|
// (shared with the cell menu), so they are omitted here.
|
|
18
14
|
|
|
@@ -143,161 +139,5 @@ export var getRowMenuComponents = function getRowMenuComponents(_ref) {
|
|
|
143
139
|
hasSeparator: true
|
|
144
140
|
}, props.children);
|
|
145
141
|
}
|
|
146
|
-
}] : [
|
|
147
|
-
// --- Cell menu update OFF: legacy row menu (registers its own add/delete items) ---
|
|
148
|
-
|
|
149
|
-
// --- Menu surface ---
|
|
150
|
-
{
|
|
151
|
-
type: ROW_MENU.type,
|
|
152
|
-
key: ROW_MENU.key
|
|
153
|
-
},
|
|
154
|
-
// --- Toggle section (Header row, Numbered rows) ---
|
|
155
|
-
{
|
|
156
|
-
type: ROW_TOGGLE_SECTION.type,
|
|
157
|
-
key: ROW_TOGGLE_SECTION.key,
|
|
158
|
-
parents: [{
|
|
159
|
-
type: ROW_MENU.type,
|
|
160
|
-
key: ROW_MENU.key,
|
|
161
|
-
rank: ROW_MENU_SECTION_RANK[ROW_TOGGLE_SECTION.key]
|
|
162
|
-
}],
|
|
163
|
-
component: function component(props) {
|
|
164
|
-
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, null, props.children);
|
|
165
|
-
}
|
|
166
|
-
}, {
|
|
167
|
-
type: HEADER_ROW_TOGGLE_ITEM.type,
|
|
168
|
-
key: HEADER_ROW_TOGGLE_ITEM.key,
|
|
169
|
-
parents: [{
|
|
170
|
-
type: ROW_TOGGLE_SECTION.type,
|
|
171
|
-
key: ROW_TOGGLE_SECTION.key,
|
|
172
|
-
rank: ROW_TOGGLE_SECTION_RANK[HEADER_ROW_TOGGLE_ITEM.key]
|
|
173
|
-
}],
|
|
174
|
-
component: function component() {
|
|
175
|
-
return /*#__PURE__*/React.createElement(HeaderRowToggleItem, {
|
|
176
|
-
api: api
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
}, {
|
|
180
|
-
type: NUMBERED_ROWS_TOGGLE_ITEM.type,
|
|
181
|
-
key: NUMBERED_ROWS_TOGGLE_ITEM.key,
|
|
182
|
-
parents: [{
|
|
183
|
-
type: ROW_TOGGLE_SECTION.type,
|
|
184
|
-
key: ROW_TOGGLE_SECTION.key,
|
|
185
|
-
rank: ROW_TOGGLE_SECTION_RANK[NUMBERED_ROWS_TOGGLE_ITEM.key]
|
|
186
|
-
}],
|
|
187
|
-
component: function component() {
|
|
188
|
-
return /*#__PURE__*/React.createElement(NumberedRowsToggleItem, {
|
|
189
|
-
api: api
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
},
|
|
193
|
-
// --- Background color section ---
|
|
194
|
-
{
|
|
195
|
-
type: ROW_BACKGROUND_SECTION.type,
|
|
196
|
-
key: ROW_BACKGROUND_SECTION.key,
|
|
197
|
-
parents: [{
|
|
198
|
-
type: ROW_MENU.type,
|
|
199
|
-
key: ROW_MENU.key,
|
|
200
|
-
rank: ROW_MENU_SECTION_RANK[ROW_BACKGROUND_SECTION.key]
|
|
201
|
-
}],
|
|
202
|
-
component: function component(props) {
|
|
203
|
-
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
|
|
204
|
-
hasSeparator: true
|
|
205
|
-
}, props.children);
|
|
206
|
-
}
|
|
207
|
-
},
|
|
208
|
-
// --- Add / Move section ---
|
|
209
|
-
{
|
|
210
|
-
type: ROW_ADD_SECTION.type,
|
|
211
|
-
key: ROW_ADD_SECTION.key,
|
|
212
|
-
parents: [{
|
|
213
|
-
type: ROW_MENU.type,
|
|
214
|
-
key: ROW_MENU.key,
|
|
215
|
-
rank: ROW_MENU_SECTION_RANK[ROW_ADD_SECTION.key]
|
|
216
|
-
}],
|
|
217
|
-
component: function component(props) {
|
|
218
|
-
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
|
|
219
|
-
hasSeparator: true
|
|
220
|
-
}, props.children);
|
|
221
|
-
}
|
|
222
|
-
}, {
|
|
223
|
-
type: ADD_ROW_ABOVE_ITEM.type,
|
|
224
|
-
key: ADD_ROW_ABOVE_ITEM.key,
|
|
225
|
-
parents: [{
|
|
226
|
-
type: ROW_ADD_SECTION.type,
|
|
227
|
-
key: ROW_ADD_SECTION.key,
|
|
228
|
-
rank: ROW_ADD_SECTION_RANK[ADD_ROW_ABOVE_ITEM.key]
|
|
229
|
-
}],
|
|
230
|
-
component: function component() {
|
|
231
|
-
return /*#__PURE__*/React.createElement(AddRowAboveItem, {
|
|
232
|
-
api: api
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
}, {
|
|
236
|
-
type: ADD_ROW_BELOW_ITEM.type,
|
|
237
|
-
key: ADD_ROW_BELOW_ITEM.key,
|
|
238
|
-
parents: [{
|
|
239
|
-
type: ROW_ADD_SECTION.type,
|
|
240
|
-
key: ROW_ADD_SECTION.key,
|
|
241
|
-
rank: ROW_ADD_SECTION_RANK[ADD_ROW_BELOW_ITEM.key]
|
|
242
|
-
}],
|
|
243
|
-
component: function component() {
|
|
244
|
-
return /*#__PURE__*/React.createElement(AddRowBelowItem, {
|
|
245
|
-
api: api
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
}, {
|
|
249
|
-
type: MOVE_ROW_UP_ITEM.type,
|
|
250
|
-
key: MOVE_ROW_UP_ITEM.key,
|
|
251
|
-
parents: [{
|
|
252
|
-
type: ROW_ADD_SECTION.type,
|
|
253
|
-
key: ROW_ADD_SECTION.key,
|
|
254
|
-
rank: ROW_ADD_SECTION_RANK[MOVE_ROW_UP_ITEM.key]
|
|
255
|
-
}],
|
|
256
|
-
component: function component() {
|
|
257
|
-
return /*#__PURE__*/React.createElement(MoveRowUpItem, {
|
|
258
|
-
api: api
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
}, {
|
|
262
|
-
type: MOVE_ROW_DOWN_ITEM.type,
|
|
263
|
-
key: MOVE_ROW_DOWN_ITEM.key,
|
|
264
|
-
parents: [{
|
|
265
|
-
type: ROW_ADD_SECTION.type,
|
|
266
|
-
key: ROW_ADD_SECTION.key,
|
|
267
|
-
rank: ROW_ADD_SECTION_RANK[MOVE_ROW_DOWN_ITEM.key]
|
|
268
|
-
}],
|
|
269
|
-
component: function component() {
|
|
270
|
-
return /*#__PURE__*/React.createElement(MoveRowDownItem, {
|
|
271
|
-
api: api
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
},
|
|
275
|
-
// --- Danger section (Clear cells, Delete row) ---
|
|
276
|
-
{
|
|
277
|
-
type: ROW_DANGER_SECTION.type,
|
|
278
|
-
key: ROW_DANGER_SECTION.key,
|
|
279
|
-
parents: [{
|
|
280
|
-
type: ROW_MENU.type,
|
|
281
|
-
key: ROW_MENU.key,
|
|
282
|
-
rank: ROW_MENU_SECTION_RANK[ROW_DANGER_SECTION.key]
|
|
283
|
-
}],
|
|
284
|
-
component: function component(props) {
|
|
285
|
-
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
|
|
286
|
-
hasSeparator: true
|
|
287
|
-
}, props.children);
|
|
288
|
-
}
|
|
289
|
-
}, {
|
|
290
|
-
type: DELETE_ROW_ITEM.type,
|
|
291
|
-
key: DELETE_ROW_ITEM.key,
|
|
292
|
-
parents: [{
|
|
293
|
-
type: ROW_DANGER_SECTION.type,
|
|
294
|
-
key: ROW_DANGER_SECTION.key,
|
|
295
|
-
rank: ROW_DANGER_SECTION_RANK[DELETE_ROW_ITEM.key]
|
|
296
|
-
}],
|
|
297
|
-
component: function component() {
|
|
298
|
-
return /*#__PURE__*/React.createElement(DeleteRowItem, {
|
|
299
|
-
api: api
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
142
|
}];
|
|
303
143
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
3
2
|
import { CELL_ACTION_SECTION, CELL_ADD_SECTION, CELL_DANGER_SECTION, CELL_ACTION_SECTION_RANK, CELL_ADD_SECTION_RANK, CELL_DANGER_SECTION_RANK } from '../cell/keys';
|
|
4
3
|
import { AddColumnRightItem } from '../column/items/AddColumnRightItem';
|
|
5
4
|
import { DeleteColumnItem } from '../column/items/DeleteColumnItem';
|
|
@@ -13,9 +12,8 @@ import { ClearCellsItem } from './items/ClearCellsItem';
|
|
|
13
12
|
import { BACKGROUND_COLOR_ITEM, CLEAR_CELLS_ITEM } from './keys';
|
|
14
13
|
export var getSharedItems = function getSharedItems(_ref) {
|
|
15
14
|
var api = _ref.api;
|
|
16
|
-
return
|
|
17
|
-
//
|
|
18
|
-
// The add/delete items move out of the row/column menu files and are registered here
|
|
15
|
+
return [
|
|
16
|
+
// The add/delete items are registered here rather than in the row/column menu files,
|
|
19
17
|
// once with an additional cell parent, so they render inside the cell menu too.
|
|
20
18
|
{
|
|
21
19
|
type: BACKGROUND_COLOR_ITEM.type,
|
|
@@ -144,50 +142,5 @@ export var getSharedItems = function getSharedItems(_ref) {
|
|
|
144
142
|
api: api
|
|
145
143
|
});
|
|
146
144
|
}
|
|
147
|
-
}] : [
|
|
148
|
-
// --- Cell menu update OFF: legacy shared items (background color + clear cells only).
|
|
149
|
-
// The add/delete items are registered by the row/column menu files in this mode.
|
|
150
|
-
{
|
|
151
|
-
type: BACKGROUND_COLOR_ITEM.type,
|
|
152
|
-
key: BACKGROUND_COLOR_ITEM.key,
|
|
153
|
-
parents: [{
|
|
154
|
-
type: ROW_BACKGROUND_SECTION.type,
|
|
155
|
-
key: ROW_BACKGROUND_SECTION.key,
|
|
156
|
-
rank: ROW_BACKGROUND_SECTION_RANK[BACKGROUND_COLOR_ITEM.key]
|
|
157
|
-
}, {
|
|
158
|
-
type: COLUMN_BACKGROUND_SECTION.type,
|
|
159
|
-
key: COLUMN_BACKGROUND_SECTION.key,
|
|
160
|
-
rank: COLUMN_BACKGROUND_SECTION_RANK[BACKGROUND_COLOR_ITEM.key]
|
|
161
|
-
}, {
|
|
162
|
-
type: CELL_ACTION_SECTION.type,
|
|
163
|
-
key: CELL_ACTION_SECTION.key,
|
|
164
|
-
rank: CELL_ACTION_SECTION_RANK[BACKGROUND_COLOR_ITEM.key]
|
|
165
|
-
}],
|
|
166
|
-
component: function component() {
|
|
167
|
-
return /*#__PURE__*/React.createElement(BackgroundColorItem, {
|
|
168
|
-
api: api
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
}, {
|
|
172
|
-
type: CLEAR_CELLS_ITEM.type,
|
|
173
|
-
key: CLEAR_CELLS_ITEM.key,
|
|
174
|
-
parents: [{
|
|
175
|
-
type: ROW_DANGER_SECTION.type,
|
|
176
|
-
key: ROW_DANGER_SECTION.key,
|
|
177
|
-
rank: ROW_DANGER_SECTION_RANK[CLEAR_CELLS_ITEM.key]
|
|
178
|
-
}, {
|
|
179
|
-
type: COLUMN_DANGER_SECTION.type,
|
|
180
|
-
key: COLUMN_DANGER_SECTION.key,
|
|
181
|
-
rank: COLUMN_DANGER_SECTION_RANK[CLEAR_CELLS_ITEM.key]
|
|
182
|
-
}, {
|
|
183
|
-
type: CELL_DANGER_SECTION.type,
|
|
184
|
-
key: CELL_DANGER_SECTION.key,
|
|
185
|
-
rank: CELL_DANGER_SECTION_RANK[CLEAR_CELLS_ITEM.key]
|
|
186
|
-
}],
|
|
187
|
-
component: function component() {
|
|
188
|
-
return /*#__PURE__*/React.createElement(ClearCellsItem, {
|
|
189
|
-
api: api
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
145
|
}];
|
|
193
146
|
};
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import { findCellRectClosestToPos } from '@atlaskit/editor-tables/utils';
|
|
2
2
|
import { getSelectionRect } from '@atlaskit/editor-tables/utils/get-selection-rect';
|
|
3
3
|
import { isSelectionType } from '@atlaskit/editor-tables/utils/is-selection-type';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* Resolve the table `Rect` for the current selection. Falls back to the closest cell's rect
|
|
8
|
-
* for a `TextSelection` (cell menu), where `getSelectionRect` returns `undefined`.
|
|
9
|
-
* with the gate off this behaves exactly like `getSelectionRect`.
|
|
7
|
+
* for a `TextSelection` (cell menu), where `getSelectionRect` returns `undefined`.
|
|
10
8
|
*/
|
|
11
9
|
export var getMenuSelectionRect = function getMenuSelectionRect(selection) {
|
|
12
|
-
if (!fg('platform_editor_table_cell_menu_update')) {
|
|
13
|
-
return getSelectionRect(selection);
|
|
14
|
-
}
|
|
15
10
|
return isSelectionType(selection, 'cell') ? getSelectionRect(selection) : findCellRectClosestToPos(selection.$from);
|
|
16
11
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { RegisterComponent } from '@atlaskit/editor-ui-control-model/types';
|
|
2
2
|
import type { TableMenuComponentsParams } from '../shared/types';
|
|
3
|
-
export declare const getColumnMenuComponents: ({ api }: TableMenuComponentsParams) => RegisterComponent[];
|
|
3
|
+
export declare const getColumnMenuComponents: ({ api, }: TableMenuComponentsParams) => RegisterComponent[];
|
|
@@ -2,7 +2,6 @@ import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
|
2
2
|
import type { Rect } from '@atlaskit/editor-tables/rect';
|
|
3
3
|
/**
|
|
4
4
|
* Resolve the table `Rect` for the current selection. Falls back to the closest cell's rect
|
|
5
|
-
* for a `TextSelection` (cell menu), where `getSelectionRect` returns `undefined`.
|
|
6
|
-
* with the gate off this behaves exactly like `getSelectionRect`.
|
|
5
|
+
* for a `TextSelection` (cell menu), where `getSelectionRect` returns `undefined`.
|
|
7
6
|
*/
|
|
8
7
|
export declare const getMenuSelectionRect: (selection: Selection) => Rect | undefined;
|