@atlaskit/editor-plugin-table 22.4.4 → 22.4.6
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 +15 -0
- package/dist/cjs/tablePlugin.js +2 -2
- package/dist/cjs/ui/FloatingDragMenu/index.js +9 -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/es2019/tablePlugin.js +2 -2
- package/dist/es2019/ui/FloatingDragMenu/index.js +10 -7
- 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/esm/tablePlugin.js +2 -2
- package/dist/esm/ui/FloatingDragMenu/index.js +10 -7
- 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/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 +10 -10
- 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,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
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
import { moveRowDown, moveRowDownOld, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
4
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
|
+
import { TableRowMoveDownIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
6
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
|
+
var getMoveRowDownShortcut = function getMoveRowDownShortcut() {
|
|
8
|
+
return tooltip(expValEquals('editor-a11y-fy26-keyboard-move-row-column', 'isEnabled', true) ? moveRowDown : moveRowDownOld);
|
|
9
|
+
};
|
|
10
|
+
export var MoveRowDownItem = function MoveRowDownItem() {
|
|
11
|
+
var _getMoveRowDownShortc;
|
|
12
|
+
var _useIntl = useIntl(),
|
|
13
|
+
formatMessage = _useIntl.formatMessage;
|
|
14
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
15
|
+
elemBefore: /*#__PURE__*/React.createElement(TableRowMoveDownIcon, {
|
|
16
|
+
color: "currentColor",
|
|
17
|
+
label: "",
|
|
18
|
+
size: "small"
|
|
19
|
+
}),
|
|
20
|
+
elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
|
|
21
|
+
shortcut: (_getMoveRowDownShortc = getMoveRowDownShortcut()) !== null && _getMoveRowDownShortc !== void 0 ? _getMoveRowDownShortc : ''
|
|
22
|
+
})
|
|
23
|
+
}, formatMessage(messages.moveRowDown, {
|
|
24
|
+
0: 1
|
|
25
|
+
}));
|
|
26
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
import { moveRowUp, moveRowUpOld, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
4
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
|
+
import { TableRowMoveUpIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
6
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
|
+
var getMoveRowUpShortcut = function getMoveRowUpShortcut() {
|
|
8
|
+
return tooltip(expValEquals('editor-a11y-fy26-keyboard-move-row-column', 'isEnabled', true) ? moveRowUp : moveRowUpOld);
|
|
9
|
+
};
|
|
10
|
+
export var MoveRowUpItem = function MoveRowUpItem() {
|
|
11
|
+
var _getMoveRowUpShortcut;
|
|
12
|
+
var _useIntl = useIntl(),
|
|
13
|
+
formatMessage = _useIntl.formatMessage;
|
|
14
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
15
|
+
elemBefore: /*#__PURE__*/React.createElement(TableRowMoveUpIcon, {
|
|
16
|
+
color: "currentColor",
|
|
17
|
+
label: "",
|
|
18
|
+
size: "small"
|
|
19
|
+
}),
|
|
20
|
+
elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
|
|
21
|
+
shortcut: (_getMoveRowUpShortcut = getMoveRowUpShortcut()) !== null && _getMoveRowUpShortcut !== void 0 ? _getMoveRowUpShortcut : ''
|
|
22
|
+
})
|
|
23
|
+
}, formatMessage(messages.moveRowUp, {
|
|
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 { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
5
|
+
import Toggle from '@atlaskit/toggle';
|
|
6
|
+
export var NumberedRowsToggleItem = function NumberedRowsToggleItem() {
|
|
7
|
+
var _useIntl = useIntl(),
|
|
8
|
+
formatMessage = _useIntl.formatMessage;
|
|
9
|
+
var label = formatMessage(messages.numberedRows);
|
|
10
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
11
|
+
elemAfter: /*#__PURE__*/React.createElement(Toggle, {
|
|
12
|
+
label: label,
|
|
13
|
+
isChecked: false
|
|
14
|
+
})
|
|
15
|
+
}, label);
|
|
16
|
+
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import { BACKGROUND_COLOR_ITEM, CLEAR_CELLS_ITEM } from '../shared/keys';
|
|
3
|
+
|
|
2
4
|
// --- Menu surface ---
|
|
3
5
|
|
|
4
6
|
export var ROW_MENU = {
|
|
@@ -24,7 +26,7 @@ export var ROW_DANGER_SECTION = {
|
|
|
24
26
|
type: 'menu-section',
|
|
25
27
|
key: 'row-danger-section'
|
|
26
28
|
};
|
|
27
|
-
export var
|
|
29
|
+
export var ROW_MENU_SECTION_RANK = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ROW_TOGGLE_SECTION.key, 100), ROW_BACKGROUND_SECTION.key, 200), ROW_ADD_SECTION.key, 300), ROW_DANGER_SECTION.key, 400);
|
|
28
30
|
export var HEADER_ROW_TOGGLE_ITEM = {
|
|
29
31
|
type: 'menu-item',
|
|
30
32
|
key: 'header-row-toggle'
|
|
@@ -33,10 +35,6 @@ export var NUMBERED_ROWS_TOGGLE_ITEM = {
|
|
|
33
35
|
type: 'menu-item',
|
|
34
36
|
key: 'numbered-rows-toggle'
|
|
35
37
|
};
|
|
36
|
-
export var BACKGROUND_COLOR_ITEM = {
|
|
37
|
-
type: 'menu-item',
|
|
38
|
-
key: 'background-color'
|
|
39
|
-
};
|
|
40
38
|
export var ADD_ROW_ABOVE_ITEM = {
|
|
41
39
|
type: 'menu-item',
|
|
42
40
|
key: 'add-row-above'
|
|
@@ -53,10 +51,6 @@ export var MOVE_ROW_DOWN_ITEM = {
|
|
|
53
51
|
type: 'menu-item',
|
|
54
52
|
key: 'move-row-down'
|
|
55
53
|
};
|
|
56
|
-
export var CLEAR_CELLS_ITEM = {
|
|
57
|
-
type: 'menu-item',
|
|
58
|
-
key: 'clear-cells'
|
|
59
|
-
};
|
|
60
54
|
export var DELETE_ROW_ITEM = {
|
|
61
55
|
type: 'menu-item',
|
|
62
56
|
key: 'delete-row'
|
|
@@ -64,7 +58,7 @@ export var DELETE_ROW_ITEM = {
|
|
|
64
58
|
|
|
65
59
|
// --- Item ranks within their sections ---
|
|
66
60
|
|
|
67
|
-
export var
|
|
68
|
-
export var
|
|
69
|
-
export var
|
|
70
|
-
export var
|
|
61
|
+
export var ROW_TOGGLE_SECTION_RANK = _defineProperty(_defineProperty({}, HEADER_ROW_TOGGLE_ITEM.key, 100), NUMBERED_ROWS_TOGGLE_ITEM.key, 200);
|
|
62
|
+
export var ROW_BACKGROUND_SECTION_RANK = _defineProperty({}, BACKGROUND_COLOR_ITEM.key, 100);
|
|
63
|
+
export var ROW_ADD_SECTION_RANK = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ADD_ROW_ABOVE_ITEM.key, 100), ADD_ROW_BELOW_ITEM.key, 200), MOVE_ROW_UP_ITEM.key, 300), MOVE_ROW_DOWN_ITEM.key, 400);
|
|
64
|
+
export var ROW_DANGER_SECTION_RANK = _defineProperty(_defineProperty({}, CLEAR_CELLS_ITEM.key, 100), DELETE_ROW_ITEM.key, 200);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* TableMenu.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
|
+
import "./TableMenu.compiled.css";
|
|
3
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
+
import React, { memo, useMemo } from 'react';
|
|
5
|
+
import { SurfaceRenderer } from '@atlaskit/editor-ui-control-model';
|
|
6
|
+
import { Box } from '@atlaskit/primitives/compiled';
|
|
7
|
+
var tableMenuContainerStyles = {
|
|
8
|
+
container: "_2rko1qi0 _1reo15vq _18m915vq _1bsb1178 _16qs130s _bfhk1bhr"
|
|
9
|
+
};
|
|
10
|
+
export var TableMenu = /*#__PURE__*/memo(function (_ref) {
|
|
11
|
+
var api = _ref.api,
|
|
12
|
+
surface = _ref.surface;
|
|
13
|
+
var components = useMemo(function () {
|
|
14
|
+
var _api$uiControlRegistr, _api$uiControlRegistr2;
|
|
15
|
+
return (_api$uiControlRegistr = api === null || api === void 0 || (_api$uiControlRegistr2 = api.uiControlRegistry) === null || _api$uiControlRegistr2 === void 0 ? void 0 : _api$uiControlRegistr2.actions.getComponents(surface.key)) !== null && _api$uiControlRegistr !== void 0 ? _api$uiControlRegistr : [];
|
|
16
|
+
}, [api, surface.key]);
|
|
17
|
+
if (components.length === 0) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
21
|
+
xcss: tableMenuContainerStyles.container,
|
|
22
|
+
testId: surface.key
|
|
23
|
+
}, /*#__PURE__*/React.createElement(SurfaceRenderer, {
|
|
24
|
+
surface: surface,
|
|
25
|
+
components: components
|
|
26
|
+
}));
|
|
27
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export var
|
|
1
|
+
export var TABLE_MENU_WIDTH = 280;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { COLUMN_BACKGROUND_SECTION, COLUMN_DANGER_SECTION, COLUMN_BACKGROUND_SECTION_RANK, COLUMN_DANGER_SECTION_RANK } from '../column/keys';
|
|
3
|
+
import { ROW_BACKGROUND_SECTION, ROW_DANGER_SECTION, ROW_BACKGROUND_SECTION_RANK, ROW_DANGER_SECTION_RANK } from '../row/keys';
|
|
4
|
+
import { BackgroundColorItem } from './items/BackgroundColorItem';
|
|
5
|
+
import { ClearCellsItem } from './items/ClearCellsItem';
|
|
6
|
+
import { BACKGROUND_COLOR_ITEM, CLEAR_CELLS_ITEM } from './keys';
|
|
7
|
+
export var getSharedItems = function getSharedItems() {
|
|
8
|
+
return [{
|
|
9
|
+
type: BACKGROUND_COLOR_ITEM.type,
|
|
10
|
+
key: BACKGROUND_COLOR_ITEM.key,
|
|
11
|
+
parents: [{
|
|
12
|
+
type: ROW_BACKGROUND_SECTION.type,
|
|
13
|
+
key: ROW_BACKGROUND_SECTION.key,
|
|
14
|
+
rank: ROW_BACKGROUND_SECTION_RANK[BACKGROUND_COLOR_ITEM.key]
|
|
15
|
+
}, {
|
|
16
|
+
type: COLUMN_BACKGROUND_SECTION.type,
|
|
17
|
+
key: COLUMN_BACKGROUND_SECTION.key,
|
|
18
|
+
rank: COLUMN_BACKGROUND_SECTION_RANK[BACKGROUND_COLOR_ITEM.key]
|
|
19
|
+
}],
|
|
20
|
+
component: function component() {
|
|
21
|
+
return /*#__PURE__*/React.createElement(BackgroundColorItem, null);
|
|
22
|
+
}
|
|
23
|
+
}, {
|
|
24
|
+
type: CLEAR_CELLS_ITEM.type,
|
|
25
|
+
key: CLEAR_CELLS_ITEM.key,
|
|
26
|
+
parents: [{
|
|
27
|
+
type: ROW_DANGER_SECTION.type,
|
|
28
|
+
key: ROW_DANGER_SECTION.key,
|
|
29
|
+
rank: ROW_DANGER_SECTION_RANK[CLEAR_CELLS_ITEM.key]
|
|
30
|
+
}, {
|
|
31
|
+
type: COLUMN_DANGER_SECTION.type,
|
|
32
|
+
key: COLUMN_DANGER_SECTION.key,
|
|
33
|
+
rank: COLUMN_DANGER_SECTION_RANK[CLEAR_CELLS_ITEM.key]
|
|
34
|
+
}],
|
|
35
|
+
component: function component() {
|
|
36
|
+
return /*#__PURE__*/React.createElement(ClearCellsItem, null);
|
|
37
|
+
}
|
|
38
|
+
}];
|
|
39
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import { getColumnMenuComponents } from '../column/getColumnMenuComponents';
|
|
3
|
+
import { getRowMenuComponents } from '../row/getRowMenuComponents';
|
|
4
|
+
import { getSharedItems } from './getSharedItems';
|
|
5
|
+
export var getTableMenuComponents = function getTableMenuComponents() {
|
|
6
|
+
return [].concat(_toConsumableArray(getRowMenuComponents()), _toConsumableArray(getColumnMenuComponents()), _toConsumableArray(getSharedItems()));
|
|
7
|
+
};
|
|
@@ -14,17 +14,16 @@ var colorPaletteStyles = {
|
|
|
14
14
|
elemAfter: "_zulp1b66 _1e0c1txw _4cvr1h6o",
|
|
15
15
|
colorPreview: "_2rko12b0 _1h6d1l7x _1dqonqa1 _189ee4h9 _1bsbdlk8 _4t3idlk8 _1o9zidpf"
|
|
16
16
|
};
|
|
17
|
-
export var BackgroundColorItem = function BackgroundColorItem(
|
|
18
|
-
var testId = _ref.testId;
|
|
17
|
+
export var BackgroundColorItem = function BackgroundColorItem() {
|
|
19
18
|
var _useIntl = useIntl(),
|
|
20
19
|
formatMessage = _useIntl.formatMessage;
|
|
21
|
-
var selectedColor = '#ffffff';
|
|
22
20
|
var onClick = useCallback(function () {}, []);
|
|
21
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
23
22
|
var colorPreviewStyle = useMemo(function () {
|
|
24
23
|
return {
|
|
25
|
-
backgroundColor:
|
|
24
|
+
backgroundColor: '#ffffff'
|
|
26
25
|
};
|
|
27
|
-
}, [
|
|
26
|
+
}, []);
|
|
28
27
|
var paletteOptions = useMemo(function () {
|
|
29
28
|
return {
|
|
30
29
|
palette: cellBackgroundColorPalette,
|
|
@@ -33,7 +32,6 @@ export var BackgroundColorItem = function BackgroundColorItem(_ref) {
|
|
|
33
32
|
};
|
|
34
33
|
}, []);
|
|
35
34
|
return /*#__PURE__*/React.createElement(ToolbarNestedDropdownMenu, {
|
|
36
|
-
testId: testId,
|
|
37
35
|
elemBefore: /*#__PURE__*/React.createElement(PaintBucketIcon, {
|
|
38
36
|
color: "currentColor",
|
|
39
37
|
label: "",
|
|
@@ -54,7 +52,7 @@ export var BackgroundColorItem = function BackgroundColorItem(_ref) {
|
|
|
54
52
|
}, /*#__PURE__*/React.createElement(ColorPalette, {
|
|
55
53
|
cols: colorPaletteColumns,
|
|
56
54
|
onClick: onClick,
|
|
57
|
-
selectedColor:
|
|
55
|
+
selectedColor: colorPreviewStyle.backgroundColor,
|
|
58
56
|
paletteOptions: paletteOptions
|
|
59
57
|
})));
|
|
60
58
|
};
|
|
@@ -3,13 +3,11 @@ import { useIntl } from 'react-intl';
|
|
|
3
3
|
import { backspace, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
4
4
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
5
|
import { CrossIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
6
|
-
export var ClearCellsItem = function ClearCellsItem(
|
|
6
|
+
export var ClearCellsItem = function ClearCellsItem() {
|
|
7
7
|
var _tooltip;
|
|
8
|
-
var testId = _ref.testId;
|
|
9
8
|
var _useIntl = useIntl(),
|
|
10
9
|
formatMessage = _useIntl.formatMessage;
|
|
11
10
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
12
|
-
testId: testId,
|
|
13
11
|
elemBefore: /*#__PURE__*/React.createElement(CrossIcon, {
|
|
14
12
|
color: "currentColor",
|
|
15
13
|
label: "",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { RegisterComponent } from '@atlaskit/editor-ui-control-model';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the RegisterComponent[] array defining the column menu surface.
|
|
4
|
+
*
|
|
5
|
+
* This is a **UI-only stub** — all items are always visible with no conditional
|
|
6
|
+
* logic and no wired actions. Functional behaviour (actions, conditional visibility)
|
|
7
|
+
* will be connected in follow-up tickets.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getColumnMenuComponents: () => RegisterComponent[];
|