@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.
Files changed (149) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/tablePlugin.js +2 -2
  3. package/dist/cjs/ui/FloatingDragMenu/index.js +9 -6
  4. package/dist/cjs/ui/TableMenu/column/getColumnMenuComponents.js +194 -0
  5. package/dist/cjs/ui/TableMenu/column/items/AddColumnLeftItem.js +27 -0
  6. package/dist/cjs/ui/TableMenu/column/items/AddColumnRightItem.js +27 -0
  7. package/dist/cjs/ui/TableMenu/column/items/DeleteColumnItem.js +29 -0
  8. package/dist/cjs/ui/TableMenu/column/items/DistributeColumnsItem.js +22 -0
  9. package/dist/cjs/ui/TableMenu/column/items/HeaderColumnToggleItem.js +23 -0
  10. package/dist/cjs/ui/TableMenu/column/items/MoveColumnRightItem.js +33 -0
  11. package/dist/cjs/ui/TableMenu/column/items/SortDecreasingItem.js +23 -0
  12. package/dist/cjs/ui/TableMenu/column/items/SortIncreasingItem.js +23 -0
  13. package/dist/cjs/ui/TableMenu/column/keys.js +79 -0
  14. package/dist/cjs/ui/TableMenu/row/getRowMenuComponents.js +25 -47
  15. package/dist/cjs/ui/TableMenu/row/items/AddRowAboveItem.js +27 -0
  16. package/dist/cjs/ui/TableMenu/row/items/AddRowBelowItem.js +27 -0
  17. package/dist/cjs/ui/TableMenu/row/items/DeleteRowItem.js +29 -0
  18. package/dist/cjs/ui/TableMenu/row/items/HeaderRowToggleItem.js +23 -0
  19. package/dist/cjs/ui/TableMenu/row/items/MoveRowDownItem.js +33 -0
  20. package/dist/cjs/ui/TableMenu/row/items/MoveRowUpItem.js +33 -0
  21. package/dist/cjs/ui/TableMenu/row/items/NumberedRowsToggleItem.js +23 -0
  22. package/dist/cjs/ui/TableMenu/row/keys.js +7 -14
  23. package/dist/cjs/ui/TableMenu/shared/TableMenu.js +35 -0
  24. package/dist/cjs/ui/TableMenu/shared/consts.js +2 -2
  25. package/dist/cjs/ui/TableMenu/shared/getSharedItems.js +46 -0
  26. package/dist/cjs/ui/TableMenu/shared/getTableMenuComponents.js +14 -0
  27. package/dist/cjs/ui/TableMenu/shared/items/BackgroundColorItem.js +5 -7
  28. package/dist/cjs/ui/TableMenu/shared/items/ClearCellsItem.js +1 -3
  29. package/dist/cjs/ui/TableMenu/shared/keys.js +14 -0
  30. package/dist/es2019/tablePlugin.js +2 -2
  31. package/dist/es2019/ui/FloatingDragMenu/index.js +10 -7
  32. package/dist/es2019/ui/TableMenu/column/getColumnMenuComponents.js +160 -0
  33. package/dist/es2019/ui/TableMenu/column/items/AddColumnLeftItem.js +21 -0
  34. package/dist/es2019/ui/TableMenu/column/items/AddColumnRightItem.js +21 -0
  35. package/dist/es2019/ui/TableMenu/column/items/DeleteColumnItem.js +23 -0
  36. package/dist/es2019/ui/TableMenu/column/items/DistributeColumnsItem.js +16 -0
  37. package/dist/es2019/ui/TableMenu/column/items/HeaderColumnToggleItem.js +17 -0
  38. package/dist/es2019/ui/TableMenu/column/items/MoveColumnRightItem.js +25 -0
  39. package/dist/es2019/ui/TableMenu/column/items/SortDecreasingItem.js +17 -0
  40. package/dist/es2019/ui/TableMenu/column/items/SortIncreasingItem.js +17 -0
  41. package/dist/es2019/ui/TableMenu/column/keys.js +93 -0
  42. package/dist/es2019/ui/TableMenu/row/getRowMenuComponents.js +19 -37
  43. package/dist/es2019/ui/TableMenu/row/items/AddRowAboveItem.js +21 -0
  44. package/dist/es2019/ui/TableMenu/row/items/AddRowBelowItem.js +21 -0
  45. package/dist/es2019/ui/TableMenu/row/items/DeleteRowItem.js +23 -0
  46. package/dist/es2019/ui/TableMenu/row/items/HeaderRowToggleItem.js +17 -0
  47. package/dist/es2019/ui/TableMenu/row/items/MoveRowDownItem.js +25 -0
  48. package/dist/es2019/ui/TableMenu/row/items/MoveRowUpItem.js +25 -0
  49. package/dist/es2019/ui/TableMenu/row/items/NumberedRowsToggleItem.js +17 -0
  50. package/dist/es2019/ui/TableMenu/row/keys.js +7 -13
  51. package/dist/es2019/ui/TableMenu/shared/TableMenu.js +28 -0
  52. package/dist/es2019/ui/TableMenu/shared/consts.js +1 -1
  53. package/dist/es2019/ui/TableMenu/shared/getSharedItems.js +33 -0
  54. package/dist/es2019/ui/TableMenu/shared/getTableMenuComponents.js +4 -0
  55. package/dist/es2019/ui/TableMenu/shared/items/BackgroundColorItem.js +5 -8
  56. package/dist/es2019/ui/TableMenu/shared/items/ClearCellsItem.js +1 -4
  57. package/dist/es2019/ui/TableMenu/shared/keys.js +8 -0
  58. package/dist/esm/tablePlugin.js +2 -2
  59. package/dist/esm/ui/FloatingDragMenu/index.js +10 -7
  60. package/dist/esm/ui/TableMenu/column/getColumnMenuComponents.js +188 -0
  61. package/dist/esm/ui/TableMenu/column/items/AddColumnLeftItem.js +20 -0
  62. package/dist/esm/ui/TableMenu/column/items/AddColumnRightItem.js +20 -0
  63. package/dist/esm/ui/TableMenu/column/items/DeleteColumnItem.js +22 -0
  64. package/dist/esm/ui/TableMenu/column/items/DistributeColumnsItem.js +15 -0
  65. package/dist/esm/ui/TableMenu/column/items/HeaderColumnToggleItem.js +16 -0
  66. package/dist/esm/ui/TableMenu/column/items/MoveColumnRightItem.js +26 -0
  67. package/dist/esm/ui/TableMenu/column/items/SortDecreasingItem.js +16 -0
  68. package/dist/esm/ui/TableMenu/column/items/SortIncreasingItem.js +16 -0
  69. package/dist/esm/ui/TableMenu/column/keys.js +73 -0
  70. package/dist/esm/ui/TableMenu/row/getRowMenuComponents.js +19 -41
  71. package/dist/esm/ui/TableMenu/row/items/AddRowAboveItem.js +20 -0
  72. package/dist/esm/ui/TableMenu/row/items/AddRowBelowItem.js +20 -0
  73. package/dist/esm/ui/TableMenu/row/items/DeleteRowItem.js +22 -0
  74. package/dist/esm/ui/TableMenu/row/items/HeaderRowToggleItem.js +16 -0
  75. package/dist/esm/ui/TableMenu/row/items/MoveRowDownItem.js +26 -0
  76. package/dist/esm/ui/TableMenu/row/items/MoveRowUpItem.js +26 -0
  77. package/dist/esm/ui/TableMenu/row/items/NumberedRowsToggleItem.js +16 -0
  78. package/dist/esm/ui/TableMenu/row/keys.js +7 -13
  79. package/dist/esm/ui/TableMenu/shared/TableMenu.js +27 -0
  80. package/dist/esm/ui/TableMenu/shared/consts.js +1 -1
  81. package/dist/esm/ui/TableMenu/shared/getSharedItems.js +39 -0
  82. package/dist/esm/ui/TableMenu/shared/getTableMenuComponents.js +7 -0
  83. package/dist/esm/ui/TableMenu/shared/items/BackgroundColorItem.js +5 -7
  84. package/dist/esm/ui/TableMenu/shared/items/ClearCellsItem.js +1 -3
  85. package/dist/esm/ui/TableMenu/shared/keys.js +8 -0
  86. package/dist/types/ui/TableMenu/column/getColumnMenuComponents.d.ts +9 -0
  87. package/dist/types/ui/TableMenu/column/items/AddColumnLeftItem.d.ts +2 -0
  88. package/dist/types/ui/TableMenu/column/items/AddColumnRightItem.d.ts +2 -0
  89. package/dist/types/ui/TableMenu/column/items/DeleteColumnItem.d.ts +2 -0
  90. package/dist/types/ui/TableMenu/column/items/DistributeColumnsItem.d.ts +2 -0
  91. package/dist/types/ui/TableMenu/column/items/HeaderColumnToggleItem.d.ts +2 -0
  92. package/dist/types/ui/TableMenu/column/items/MoveColumnRightItem.d.ts +2 -0
  93. package/dist/types/ui/TableMenu/column/items/SortDecreasingItem.d.ts +2 -0
  94. package/dist/types/ui/TableMenu/column/items/SortIncreasingItem.d.ts +2 -0
  95. package/dist/types/ui/TableMenu/column/keys.d.ts +21 -0
  96. package/dist/types/ui/TableMenu/row/items/AddRowAboveItem.d.ts +2 -0
  97. package/dist/types/ui/TableMenu/row/items/AddRowBelowItem.d.ts +2 -0
  98. package/dist/types/ui/TableMenu/row/items/DeleteRowItem.d.ts +2 -0
  99. package/dist/types/ui/TableMenu/row/items/HeaderRowToggleItem.d.ts +2 -0
  100. package/dist/types/ui/TableMenu/row/items/MoveRowDownItem.d.ts +2 -0
  101. package/dist/types/ui/TableMenu/row/items/MoveRowUpItem.d.ts +2 -0
  102. package/dist/types/ui/TableMenu/row/items/NumberedRowsToggleItem.d.ts +2 -0
  103. package/dist/types/ui/TableMenu/row/keys.d.ts +5 -7
  104. package/dist/types/ui/TableMenu/shared/TableMenu.d.ts +9 -0
  105. package/dist/types/ui/TableMenu/shared/consts.d.ts +1 -1
  106. package/dist/types/ui/TableMenu/shared/getSharedItems.d.ts +2 -0
  107. package/dist/types/ui/TableMenu/shared/getTableMenuComponents.d.ts +2 -0
  108. package/dist/types/ui/TableMenu/shared/items/BackgroundColorItem.d.ts +1 -5
  109. package/dist/types/ui/TableMenu/shared/items/ClearCellsItem.d.ts +1 -5
  110. package/dist/types/ui/TableMenu/shared/keys.d.ts +3 -0
  111. package/dist/types-ts4.5/ui/TableMenu/column/getColumnMenuComponents.d.ts +9 -0
  112. package/dist/types-ts4.5/ui/TableMenu/column/items/AddColumnLeftItem.d.ts +2 -0
  113. package/dist/types-ts4.5/ui/TableMenu/column/items/AddColumnRightItem.d.ts +2 -0
  114. package/dist/types-ts4.5/ui/TableMenu/column/items/DeleteColumnItem.d.ts +2 -0
  115. package/dist/types-ts4.5/ui/TableMenu/column/items/DistributeColumnsItem.d.ts +2 -0
  116. package/dist/types-ts4.5/ui/TableMenu/column/items/HeaderColumnToggleItem.d.ts +2 -0
  117. package/dist/types-ts4.5/ui/TableMenu/column/items/MoveColumnRightItem.d.ts +2 -0
  118. package/dist/types-ts4.5/ui/TableMenu/column/items/SortDecreasingItem.d.ts +2 -0
  119. package/dist/types-ts4.5/ui/TableMenu/column/items/SortIncreasingItem.d.ts +2 -0
  120. package/dist/types-ts4.5/ui/TableMenu/column/keys.d.ts +21 -0
  121. package/dist/types-ts4.5/ui/TableMenu/row/items/AddRowAboveItem.d.ts +2 -0
  122. package/dist/types-ts4.5/ui/TableMenu/row/items/AddRowBelowItem.d.ts +2 -0
  123. package/dist/types-ts4.5/ui/TableMenu/row/items/DeleteRowItem.d.ts +2 -0
  124. package/dist/types-ts4.5/ui/TableMenu/row/items/HeaderRowToggleItem.d.ts +2 -0
  125. package/dist/types-ts4.5/ui/TableMenu/row/items/MoveRowDownItem.d.ts +2 -0
  126. package/dist/types-ts4.5/ui/TableMenu/row/items/MoveRowUpItem.d.ts +2 -0
  127. package/dist/types-ts4.5/ui/TableMenu/row/items/NumberedRowsToggleItem.d.ts +2 -0
  128. package/dist/types-ts4.5/ui/TableMenu/row/keys.d.ts +5 -7
  129. package/dist/types-ts4.5/ui/TableMenu/shared/TableMenu.d.ts +9 -0
  130. package/dist/types-ts4.5/ui/TableMenu/shared/consts.d.ts +1 -1
  131. package/dist/types-ts4.5/ui/TableMenu/shared/getSharedItems.d.ts +2 -0
  132. package/dist/types-ts4.5/ui/TableMenu/shared/getTableMenuComponents.d.ts +2 -0
  133. package/dist/types-ts4.5/ui/TableMenu/shared/items/BackgroundColorItem.d.ts +1 -5
  134. package/dist/types-ts4.5/ui/TableMenu/shared/items/ClearCellsItem.d.ts +1 -5
  135. package/dist/types-ts4.5/ui/TableMenu/shared/keys.d.ts +3 -0
  136. package/package.json +10 -10
  137. package/dist/cjs/ui/TableMenu/row/RowMenu.js +0 -35
  138. package/dist/cjs/ui/TableMenu/row/RowMenuItems.js +0 -130
  139. package/dist/es2019/ui/TableMenu/row/RowMenu.js +0 -27
  140. package/dist/es2019/ui/TableMenu/row/RowMenuItems.js +0 -126
  141. package/dist/esm/ui/TableMenu/row/RowMenu.js +0 -28
  142. package/dist/esm/ui/TableMenu/row/RowMenuItems.js +0 -123
  143. package/dist/types/ui/TableMenu/row/RowMenu.d.ts +0 -7
  144. package/dist/types/ui/TableMenu/row/RowMenuItems.d.ts +0 -8
  145. package/dist/types-ts4.5/ui/TableMenu/row/RowMenu.d.ts +0 -7
  146. package/dist/types-ts4.5/ui/TableMenu/row/RowMenuItems.d.ts +0 -8
  147. /package/dist/cjs/ui/TableMenu/{row/RowMenu.compiled.css → shared/TableMenu.compiled.css} +0 -0
  148. /package/dist/es2019/ui/TableMenu/{row/RowMenu.compiled.css → shared/TableMenu.compiled.css} +0 -0
  149. /package/dist/esm/ui/TableMenu/{row/RowMenu.compiled.css → shared/TableMenu.compiled.css} +0 -0
@@ -6,10 +6,12 @@ import { fg } from '@atlaskit/platform-feature-flags';
6
6
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
7
  import { TableCssClassName as ClassName } from '../../types';
8
8
  import { dragMenuDropdownWidth, dragTableInsertColumnButtonSize, tablePopupMenuFitHeight } from '../consts';
9
- import { RowMenu } from '../TableMenu/row/RowMenu';
10
- import { newMenuWidth } from '../TableMenu/shared/consts';
9
+ import { COLUMN_MENU } from '../TableMenu/column/keys';
10
+ import { ROW_MENU } from '../TableMenu/row/keys';
11
+ import { TABLE_MENU_WIDTH } from '../TableMenu/shared/consts';
12
+ import { TableMenu } from '../TableMenu/shared/TableMenu';
11
13
  import DragMenu from './DragMenu';
12
- const rowMenuOffset = dragTableInsertColumnButtonSize + 4;
14
+ const TABLE_MENU_OFFSET = dragTableInsertColumnButtonSize + 4;
13
15
  const FloatingDragMenu = ({
14
16
  mountPoint,
15
17
  boundariesElement,
@@ -54,7 +56,7 @@ const FloatingDragMenu = ({
54
56
  mountTo: mountPoint,
55
57
  boundariesElement: boundariesElement,
56
58
  scrollableElement: scrollableElement,
57
- fitWidth: expValEquals('platform_editor_table_menu_updates', 'isEnabled', true) ? newMenuWidth : dragMenuDropdownWidth,
59
+ fitWidth: expValEquals('platform_editor_table_menu_updates', 'isEnabled', true) ? TABLE_MENU_WIDTH : dragMenuDropdownWidth,
58
60
  fitHeight: tablePopupMenuFitHeight
59
61
  // z-index value below is to ensure that this menu is above other floating menu
60
62
  // in table, but below floating dialogs like typeaheads, pickers, etc.
@@ -62,10 +64,11 @@ const FloatingDragMenu = ({
62
64
  ,
63
65
  zIndex: inStickyMode ? akEditorFloatingDialogZIndex : akEditorFloatingOverlapPanelZIndex,
64
66
  forcePlacement: true,
65
- offset: expValEquals('platform_editor_table_menu_updates', 'isEnabled', true) ? [rowMenuOffset, 0] : direction === 'row' ? [-9, 0] : [0, -7],
67
+ offset: expValEquals('platform_editor_table_menu_updates', 'isEnabled', true) ? [TABLE_MENU_OFFSET, 0] : direction === 'row' ? [-9, 0] : [0, -7],
66
68
  stick: true
67
- }, expValEquals('platform_editor_table_menu_updates', 'isEnabled', true) ? /*#__PURE__*/React.createElement(RowMenu, {
68
- api: api
69
+ }, expValEquals('platform_editor_table_menu_updates', 'isEnabled', true) ? /*#__PURE__*/React.createElement(TableMenu, {
70
+ api: api,
71
+ surface: direction === 'row' ? ROW_MENU : COLUMN_MENU
69
72
  }) : /*#__PURE__*/React.createElement(DragMenu, {
70
73
  editorView: editorView,
71
74
  isOpen: isOpen,
@@ -0,0 +1,160 @@
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 const getColumnMenuComponents = () => [
21
+ // --- Menu surface ---
22
+ {
23
+ type: COLUMN_MENU.type,
24
+ key: COLUMN_MENU.key
25
+ },
26
+ // --- Toggle section (Header column) ---
27
+ {
28
+ type: COLUMN_TOGGLE_SECTION.type,
29
+ key: COLUMN_TOGGLE_SECTION.key,
30
+ parents: [{
31
+ type: COLUMN_MENU.type,
32
+ key: COLUMN_MENU.key,
33
+ rank: COLUMN_SECTION_RANK[COLUMN_TOGGLE_SECTION.key]
34
+ }],
35
+ component: props => /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, null, props.children)
36
+ }, {
37
+ type: HEADER_COLUMN_TOGGLE_ITEM.type,
38
+ key: HEADER_COLUMN_TOGGLE_ITEM.key,
39
+ parents: [{
40
+ type: COLUMN_TOGGLE_SECTION.type,
41
+ key: COLUMN_TOGGLE_SECTION.key,
42
+ rank: COLUMN_TOGGLE_SECTION_RANK[HEADER_COLUMN_TOGGLE_ITEM.key]
43
+ }],
44
+ component: () => /*#__PURE__*/React.createElement(HeaderColumnToggleItem, null)
45
+ },
46
+ // --- Background color section ---
47
+ {
48
+ type: COLUMN_BACKGROUND_SECTION.type,
49
+ key: COLUMN_BACKGROUND_SECTION.key,
50
+ parents: [{
51
+ type: COLUMN_MENU.type,
52
+ key: COLUMN_MENU.key,
53
+ rank: COLUMN_SECTION_RANK[COLUMN_BACKGROUND_SECTION.key]
54
+ }],
55
+ component: props => /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
56
+ hasSeparator: true
57
+ }, props.children)
58
+ },
59
+ // --- Sort section ---
60
+ {
61
+ type: COLUMN_SORT_SECTION.type,
62
+ key: COLUMN_SORT_SECTION.key,
63
+ parents: [{
64
+ type: COLUMN_MENU.type,
65
+ key: COLUMN_MENU.key,
66
+ rank: COLUMN_SECTION_RANK[COLUMN_SORT_SECTION.key]
67
+ }],
68
+ component: props => /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
69
+ hasSeparator: true
70
+ }, props.children)
71
+ }, {
72
+ type: SORT_INCREASING_ITEM.type,
73
+ key: SORT_INCREASING_ITEM.key,
74
+ parents: [{
75
+ type: COLUMN_SORT_SECTION.type,
76
+ key: COLUMN_SORT_SECTION.key,
77
+ rank: COLUMN_SORT_SECTION_RANK[SORT_INCREASING_ITEM.key]
78
+ }],
79
+ component: () => /*#__PURE__*/React.createElement(SortIncreasingItem, null)
80
+ }, {
81
+ type: SORT_DECREASING_ITEM.type,
82
+ key: SORT_DECREASING_ITEM.key,
83
+ parents: [{
84
+ type: COLUMN_SORT_SECTION.type,
85
+ key: COLUMN_SORT_SECTION.key,
86
+ rank: COLUMN_SORT_SECTION_RANK[SORT_DECREASING_ITEM.key]
87
+ }],
88
+ component: () => /*#__PURE__*/React.createElement(SortDecreasingItem, null)
89
+ },
90
+ // --- Add / Move section ---
91
+ {
92
+ type: COLUMN_ADD_SECTION.type,
93
+ key: COLUMN_ADD_SECTION.key,
94
+ parents: [{
95
+ type: COLUMN_MENU.type,
96
+ key: COLUMN_MENU.key,
97
+ rank: COLUMN_SECTION_RANK[COLUMN_ADD_SECTION.key]
98
+ }],
99
+ component: props => /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
100
+ hasSeparator: true
101
+ }, props.children)
102
+ }, {
103
+ type: ADD_COLUMN_LEFT_ITEM.type,
104
+ key: ADD_COLUMN_LEFT_ITEM.key,
105
+ parents: [{
106
+ type: COLUMN_ADD_SECTION.type,
107
+ key: COLUMN_ADD_SECTION.key,
108
+ rank: COLUMN_ADD_SECTION_RANK[ADD_COLUMN_LEFT_ITEM.key]
109
+ }],
110
+ component: () => /*#__PURE__*/React.createElement(AddColumnLeftItem, null)
111
+ }, {
112
+ type: ADD_COLUMN_RIGHT_ITEM.type,
113
+ key: ADD_COLUMN_RIGHT_ITEM.key,
114
+ parents: [{
115
+ type: COLUMN_ADD_SECTION.type,
116
+ key: COLUMN_ADD_SECTION.key,
117
+ rank: COLUMN_ADD_SECTION_RANK[ADD_COLUMN_RIGHT_ITEM.key]
118
+ }],
119
+ component: () => /*#__PURE__*/React.createElement(AddColumnRightItem, null)
120
+ }, {
121
+ type: MOVE_COLUMN_RIGHT_ITEM.type,
122
+ key: MOVE_COLUMN_RIGHT_ITEM.key,
123
+ parents: [{
124
+ type: COLUMN_ADD_SECTION.type,
125
+ key: COLUMN_ADD_SECTION.key,
126
+ rank: COLUMN_ADD_SECTION_RANK[MOVE_COLUMN_RIGHT_ITEM.key]
127
+ }],
128
+ component: () => /*#__PURE__*/React.createElement(MoveColumnRightItem, null)
129
+ }, {
130
+ type: DISTRIBUTE_COLUMNS_ITEM.type,
131
+ key: DISTRIBUTE_COLUMNS_ITEM.key,
132
+ parents: [{
133
+ type: COLUMN_ADD_SECTION.type,
134
+ key: COLUMN_ADD_SECTION.key,
135
+ rank: COLUMN_ADD_SECTION_RANK[DISTRIBUTE_COLUMNS_ITEM.key]
136
+ }],
137
+ component: () => /*#__PURE__*/React.createElement(DistributeColumnsItem, null)
138
+ },
139
+ // --- Danger section (Clear cells, Delete column) ---
140
+ {
141
+ type: COLUMN_DANGER_SECTION.type,
142
+ key: COLUMN_DANGER_SECTION.key,
143
+ parents: [{
144
+ type: COLUMN_MENU.type,
145
+ key: COLUMN_MENU.key,
146
+ rank: COLUMN_SECTION_RANK[COLUMN_DANGER_SECTION.key]
147
+ }],
148
+ component: props => /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
149
+ hasSeparator: true
150
+ }, props.children)
151
+ }, {
152
+ type: DELETE_COLUMN_ITEM.type,
153
+ key: DELETE_COLUMN_ITEM.key,
154
+ parents: [{
155
+ type: COLUMN_DANGER_SECTION.type,
156
+ key: COLUMN_DANGER_SECTION.key,
157
+ rank: COLUMN_DANGER_SECTION_RANK[DELETE_COLUMN_ITEM.key]
158
+ }],
159
+ component: () => /*#__PURE__*/React.createElement(DeleteColumnItem, null)
160
+ }];
@@ -0,0 +1,21 @@
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 const AddColumnLeftItem = () => {
7
+ var _tooltip;
8
+ const {
9
+ formatMessage
10
+ } = useIntl();
11
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
12
+ elemBefore: /*#__PURE__*/React.createElement(TableColumnAddLeftIcon, {
13
+ color: "currentColor",
14
+ label: "",
15
+ size: "small"
16
+ }),
17
+ elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
18
+ shortcut: (_tooltip = tooltip(addColumnBefore)) !== null && _tooltip !== void 0 ? _tooltip : ''
19
+ })
20
+ }, formatMessage(messages.addColumnLeft));
21
+ };
@@ -0,0 +1,21 @@
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 const AddColumnRightItem = () => {
7
+ var _tooltip;
8
+ const {
9
+ formatMessage
10
+ } = useIntl();
11
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
12
+ elemBefore: /*#__PURE__*/React.createElement(TableColumnAddRightIcon, {
13
+ color: "currentColor",
14
+ label: "",
15
+ size: "small"
16
+ }),
17
+ elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
18
+ shortcut: (_tooltip = tooltip(addColumnAfter)) !== null && _tooltip !== void 0 ? _tooltip : ''
19
+ })
20
+ }, formatMessage(messages.addColumnRight));
21
+ };
@@ -0,0 +1,23 @@
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 const DeleteColumnItem = () => {
7
+ var _tooltip;
8
+ const {
9
+ formatMessage
10
+ } = useIntl();
11
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
12
+ elemBefore: /*#__PURE__*/React.createElement(DeleteIcon, {
13
+ color: "currentColor",
14
+ label: "",
15
+ size: "small"
16
+ }),
17
+ elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
18
+ shortcut: (_tooltip = tooltip(deleteColumn)) !== null && _tooltip !== void 0 ? _tooltip : ''
19
+ })
20
+ }, formatMessage(messages.removeColumns, {
21
+ 0: 1
22
+ }));
23
+ };
@@ -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 { TableColumnsDistributeIcon, ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
5
+ export const DistributeColumnsItem = () => {
6
+ const {
7
+ formatMessage
8
+ } = useIntl();
9
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
10
+ elemBefore: /*#__PURE__*/React.createElement(TableColumnsDistributeIcon, {
11
+ color: "currentColor",
12
+ label: "",
13
+ size: "small"
14
+ })
15
+ }, formatMessage(messages.distributeColumns));
16
+ };
@@ -0,0 +1,17 @@
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 const HeaderColumnToggleItem = () => {
7
+ const {
8
+ formatMessage
9
+ } = useIntl();
10
+ const label = formatMessage(messages.headerColumn);
11
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
12
+ elemAfter: /*#__PURE__*/React.createElement(Toggle, {
13
+ label: label,
14
+ isChecked: false
15
+ })
16
+ }, label);
17
+ };
@@ -0,0 +1,25 @@
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
+ const getMoveColumnRightShortcut = () => tooltip(expValEquals('editor-a11y-fy26-keyboard-move-row-column', 'isEnabled', true) ? moveColumnRight : moveColumnRightOld);
8
+ export const MoveColumnRightItem = () => {
9
+ var _getMoveColumnRightSh;
10
+ const {
11
+ formatMessage
12
+ } = useIntl();
13
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
14
+ elemBefore: /*#__PURE__*/React.createElement(TableColumnMoveRightIcon, {
15
+ color: "currentColor",
16
+ label: "",
17
+ size: "small"
18
+ }),
19
+ elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
20
+ shortcut: (_getMoveColumnRightSh = getMoveColumnRightShortcut()) !== null && _getMoveColumnRightSh !== void 0 ? _getMoveColumnRightSh : ''
21
+ })
22
+ }, formatMessage(messages.moveColumnRight, {
23
+ 0: 1
24
+ }));
25
+ };
@@ -0,0 +1,17 @@
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 const SortDecreasingItem = () => {
6
+ const {
7
+ formatMessage
8
+ } = useIntl();
9
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
10
+ isDisabled: true,
11
+ elemBefore: /*#__PURE__*/React.createElement(ArrowDownIcon, {
12
+ color: "currentColor",
13
+ label: "",
14
+ size: "small"
15
+ })
16
+ }, formatMessage(messages.sortColumnDecreasing));
17
+ };
@@ -0,0 +1,17 @@
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 const SortIncreasingItem = () => {
6
+ const {
7
+ formatMessage
8
+ } = useIntl();
9
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
10
+ isDisabled: true,
11
+ elemBefore: /*#__PURE__*/React.createElement(ArrowUpIcon, {
12
+ color: "currentColor",
13
+ label: "",
14
+ size: "small"
15
+ })
16
+ }, formatMessage(messages.sortColumnIncreasing));
17
+ };
@@ -0,0 +1,93 @@
1
+ import { BACKGROUND_COLOR_ITEM, CLEAR_CELLS_ITEM } from '../shared/keys';
2
+
3
+ // --- Menu surface ---
4
+
5
+ export const COLUMN_MENU = {
6
+ type: 'menu',
7
+ key: 'column-handle-menu'
8
+ };
9
+
10
+ // --- Sections ---
11
+
12
+ export const COLUMN_TOGGLE_SECTION = {
13
+ type: 'menu-section',
14
+ key: 'column-toggle-section'
15
+ };
16
+ export const COLUMN_BACKGROUND_SECTION = {
17
+ type: 'menu-section',
18
+ key: 'column-background-section'
19
+ };
20
+ export const COLUMN_SORT_SECTION = {
21
+ type: 'menu-section',
22
+ key: 'column-sort-section'
23
+ };
24
+ export const COLUMN_ADD_SECTION = {
25
+ type: 'menu-section',
26
+ key: 'column-add-section'
27
+ };
28
+ export const COLUMN_DANGER_SECTION = {
29
+ type: 'menu-section',
30
+ key: 'column-danger-section'
31
+ };
32
+ export const COLUMN_SECTION_RANK = {
33
+ [COLUMN_TOGGLE_SECTION.key]: 100,
34
+ [COLUMN_BACKGROUND_SECTION.key]: 200,
35
+ [COLUMN_SORT_SECTION.key]: 300,
36
+ [COLUMN_ADD_SECTION.key]: 400,
37
+ [COLUMN_DANGER_SECTION.key]: 500
38
+ };
39
+ export const HEADER_COLUMN_TOGGLE_ITEM = {
40
+ type: 'menu-item',
41
+ key: 'header-column-toggle'
42
+ };
43
+ export const SORT_INCREASING_ITEM = {
44
+ type: 'menu-item',
45
+ key: 'sort-increasing'
46
+ };
47
+ export const SORT_DECREASING_ITEM = {
48
+ type: 'menu-item',
49
+ key: 'sort-decreasing'
50
+ };
51
+ export const ADD_COLUMN_LEFT_ITEM = {
52
+ type: 'menu-item',
53
+ key: 'add-column-left'
54
+ };
55
+ export const ADD_COLUMN_RIGHT_ITEM = {
56
+ type: 'menu-item',
57
+ key: 'add-column-right'
58
+ };
59
+ export const MOVE_COLUMN_RIGHT_ITEM = {
60
+ type: 'menu-item',
61
+ key: 'move-column-right'
62
+ };
63
+ export const DISTRIBUTE_COLUMNS_ITEM = {
64
+ type: 'menu-item',
65
+ key: 'distribute-columns'
66
+ };
67
+ export const DELETE_COLUMN_ITEM = {
68
+ type: 'menu-item',
69
+ key: 'delete-column'
70
+ };
71
+
72
+ // --- Item ranks within their sections ---
73
+
74
+ export const COLUMN_TOGGLE_SECTION_RANK = {
75
+ [HEADER_COLUMN_TOGGLE_ITEM.key]: 100
76
+ };
77
+ export const COLUMN_BACKGROUND_SECTION_RANK = {
78
+ [BACKGROUND_COLOR_ITEM.key]: 100
79
+ };
80
+ export const COLUMN_SORT_SECTION_RANK = {
81
+ [SORT_INCREASING_ITEM.key]: 100,
82
+ [SORT_DECREASING_ITEM.key]: 200
83
+ };
84
+ export const COLUMN_ADD_SECTION_RANK = {
85
+ [ADD_COLUMN_LEFT_ITEM.key]: 100,
86
+ [ADD_COLUMN_RIGHT_ITEM.key]: 200,
87
+ [MOVE_COLUMN_RIGHT_ITEM.key]: 300,
88
+ [DISTRIBUTE_COLUMNS_ITEM.key]: 400
89
+ };
90
+ export const COLUMN_DANGER_SECTION_RANK = {
91
+ [CLEAR_CELLS_ITEM.key]: 100,
92
+ [DELETE_COLUMN_ITEM.key]: 200
93
+ };
@@ -1,9 +1,13 @@
1
1
  import React from 'react';
2
2
  import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
3
- import { BackgroundColorItem } from '../shared/items/BackgroundColorItem';
4
- import { ClearCellsItem } from '../shared/items/ClearCellsItem';
5
- import { ROW_MENU, ROW_TOGGLE_SECTION, ROW_BACKGROUND_SECTION, ROW_ADD_SECTION, ROW_DANGER_SECTION, ROW_SECTION_RANK, HEADER_ROW_TOGGLE_ITEM, NUMBERED_ROWS_TOGGLE_ITEM, BACKGROUND_COLOR_ITEM, ADD_ROW_ABOVE_ITEM, ADD_ROW_BELOW_ITEM, MOVE_ROW_UP_ITEM, MOVE_ROW_DOWN_ITEM, CLEAR_CELLS_ITEM, DELETE_ROW_ITEM, TOGGLE_SECTION_ITEM_RANK, BACKGROUND_SECTION_ITEM_RANK, ADD_SECTION_ITEM_RANK, DANGER_SECTION_ITEM_RANK } from './keys';
6
- import { HeaderRowToggleItem, NumberedRowsToggleItem, AddRowAboveItem, AddRowBelowItem, MoveRowUpItem, MoveRowDownItem, DeleteRowItem } from './RowMenuItems';
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.
@@ -25,7 +29,7 @@ export const getRowMenuComponents = () => [
25
29
  parents: [{
26
30
  type: ROW_MENU.type,
27
31
  key: ROW_MENU.key,
28
- rank: ROW_SECTION_RANK[ROW_TOGGLE_SECTION.key]
32
+ rank: ROW_MENU_SECTION_RANK[ROW_TOGGLE_SECTION.key]
29
33
  }],
30
34
  component: props => /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, null, props.children)
31
35
  }, {
@@ -34,7 +38,7 @@ export const getRowMenuComponents = () => [
34
38
  parents: [{
35
39
  type: ROW_TOGGLE_SECTION.type,
36
40
  key: ROW_TOGGLE_SECTION.key,
37
- rank: TOGGLE_SECTION_ITEM_RANK[HEADER_ROW_TOGGLE_ITEM.key]
41
+ rank: ROW_TOGGLE_SECTION_RANK[HEADER_ROW_TOGGLE_ITEM.key]
38
42
  }],
39
43
  component: () => /*#__PURE__*/React.createElement(HeaderRowToggleItem, null)
40
44
  }, {
@@ -43,7 +47,7 @@ export const getRowMenuComponents = () => [
43
47
  parents: [{
44
48
  type: ROW_TOGGLE_SECTION.type,
45
49
  key: ROW_TOGGLE_SECTION.key,
46
- rank: TOGGLE_SECTION_ITEM_RANK[NUMBERED_ROWS_TOGGLE_ITEM.key]
50
+ rank: ROW_TOGGLE_SECTION_RANK[NUMBERED_ROWS_TOGGLE_ITEM.key]
47
51
  }],
48
52
  component: () => /*#__PURE__*/React.createElement(NumberedRowsToggleItem, null)
49
53
  },
@@ -54,22 +58,11 @@ export const getRowMenuComponents = () => [
54
58
  parents: [{
55
59
  type: ROW_MENU.type,
56
60
  key: ROW_MENU.key,
57
- rank: ROW_SECTION_RANK[ROW_BACKGROUND_SECTION.key]
61
+ rank: ROW_MENU_SECTION_RANK[ROW_BACKGROUND_SECTION.key]
58
62
  }],
59
63
  component: props => /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
60
64
  hasSeparator: true
61
65
  }, props.children)
62
- }, {
63
- type: BACKGROUND_COLOR_ITEM.type,
64
- key: BACKGROUND_COLOR_ITEM.key,
65
- parents: [{
66
- type: ROW_BACKGROUND_SECTION.type,
67
- key: ROW_BACKGROUND_SECTION.key,
68
- rank: BACKGROUND_SECTION_ITEM_RANK[BACKGROUND_COLOR_ITEM.key]
69
- }],
70
- component: () => /*#__PURE__*/React.createElement(BackgroundColorItem, {
71
- testId: "row-menu-background-color"
72
- })
73
66
  },
74
67
  // --- Add / Move section ---
75
68
  {
@@ -78,7 +71,7 @@ export const getRowMenuComponents = () => [
78
71
  parents: [{
79
72
  type: ROW_MENU.type,
80
73
  key: ROW_MENU.key,
81
- rank: ROW_SECTION_RANK[ROW_ADD_SECTION.key]
74
+ rank: ROW_MENU_SECTION_RANK[ROW_ADD_SECTION.key]
82
75
  }],
83
76
  component: props => /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
84
77
  hasSeparator: true
@@ -89,7 +82,7 @@ export const getRowMenuComponents = () => [
89
82
  parents: [{
90
83
  type: ROW_ADD_SECTION.type,
91
84
  key: ROW_ADD_SECTION.key,
92
- rank: ADD_SECTION_ITEM_RANK[ADD_ROW_ABOVE_ITEM.key]
85
+ rank: ROW_ADD_SECTION_RANK[ADD_ROW_ABOVE_ITEM.key]
93
86
  }],
94
87
  component: () => /*#__PURE__*/React.createElement(AddRowAboveItem, null)
95
88
  }, {
@@ -98,7 +91,7 @@ export const getRowMenuComponents = () => [
98
91
  parents: [{
99
92
  type: ROW_ADD_SECTION.type,
100
93
  key: ROW_ADD_SECTION.key,
101
- rank: ADD_SECTION_ITEM_RANK[ADD_ROW_BELOW_ITEM.key]
94
+ rank: ROW_ADD_SECTION_RANK[ADD_ROW_BELOW_ITEM.key]
102
95
  }],
103
96
  component: () => /*#__PURE__*/React.createElement(AddRowBelowItem, null)
104
97
  }, {
@@ -107,7 +100,7 @@ export const getRowMenuComponents = () => [
107
100
  parents: [{
108
101
  type: ROW_ADD_SECTION.type,
109
102
  key: ROW_ADD_SECTION.key,
110
- rank: ADD_SECTION_ITEM_RANK[MOVE_ROW_UP_ITEM.key]
103
+ rank: ROW_ADD_SECTION_RANK[MOVE_ROW_UP_ITEM.key]
111
104
  }],
112
105
  component: () => /*#__PURE__*/React.createElement(MoveRowUpItem, null)
113
106
  }, {
@@ -116,7 +109,7 @@ export const getRowMenuComponents = () => [
116
109
  parents: [{
117
110
  type: ROW_ADD_SECTION.type,
118
111
  key: ROW_ADD_SECTION.key,
119
- rank: ADD_SECTION_ITEM_RANK[MOVE_ROW_DOWN_ITEM.key]
112
+ rank: ROW_ADD_SECTION_RANK[MOVE_ROW_DOWN_ITEM.key]
120
113
  }],
121
114
  component: () => /*#__PURE__*/React.createElement(MoveRowDownItem, null)
122
115
  },
@@ -127,29 +120,18 @@ export const getRowMenuComponents = () => [
127
120
  parents: [{
128
121
  type: ROW_MENU.type,
129
122
  key: ROW_MENU.key,
130
- rank: ROW_SECTION_RANK[ROW_DANGER_SECTION.key]
123
+ rank: ROW_MENU_SECTION_RANK[ROW_DANGER_SECTION.key]
131
124
  }],
132
125
  component: props => /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
133
126
  hasSeparator: true
134
127
  }, props.children)
135
- }, {
136
- type: CLEAR_CELLS_ITEM.type,
137
- key: CLEAR_CELLS_ITEM.key,
138
- parents: [{
139
- type: ROW_DANGER_SECTION.type,
140
- key: ROW_DANGER_SECTION.key,
141
- rank: DANGER_SECTION_ITEM_RANK[CLEAR_CELLS_ITEM.key]
142
- }],
143
- component: () => /*#__PURE__*/React.createElement(ClearCellsItem, {
144
- testId: "row-menu-clear-cells"
145
- })
146
128
  }, {
147
129
  type: DELETE_ROW_ITEM.type,
148
130
  key: DELETE_ROW_ITEM.key,
149
131
  parents: [{
150
132
  type: ROW_DANGER_SECTION.type,
151
133
  key: ROW_DANGER_SECTION.key,
152
- rank: DANGER_SECTION_ITEM_RANK[DELETE_ROW_ITEM.key]
134
+ rank: ROW_DANGER_SECTION_RANK[DELETE_ROW_ITEM.key]
153
135
  }],
154
136
  component: () => /*#__PURE__*/React.createElement(DeleteRowItem, null)
155
137
  }];
@@ -0,0 +1,21 @@
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 const AddRowAboveItem = () => {
7
+ var _tooltip;
8
+ const {
9
+ formatMessage
10
+ } = useIntl();
11
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
12
+ elemBefore: /*#__PURE__*/React.createElement(TableRowAddAboveIcon, {
13
+ color: "currentColor",
14
+ label: "",
15
+ size: "small"
16
+ }),
17
+ elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
18
+ shortcut: (_tooltip = tooltip(addRowBefore)) !== null && _tooltip !== void 0 ? _tooltip : ''
19
+ })
20
+ }, formatMessage(messages.addRowAbove));
21
+ };
@@ -0,0 +1,21 @@
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 const AddRowBelowItem = () => {
7
+ var _tooltip;
8
+ const {
9
+ formatMessage
10
+ } = useIntl();
11
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
12
+ elemBefore: /*#__PURE__*/React.createElement(TableRowAddBelowIcon, {
13
+ color: "currentColor",
14
+ label: "",
15
+ size: "small"
16
+ }),
17
+ elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
18
+ shortcut: (_tooltip = tooltip(addRowAfter)) !== null && _tooltip !== void 0 ? _tooltip : ''
19
+ })
20
+ }, formatMessage(messages.addRowBelow));
21
+ };
@@ -0,0 +1,23 @@
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 const DeleteRowItem = () => {
7
+ var _tooltip;
8
+ const {
9
+ formatMessage
10
+ } = useIntl();
11
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
12
+ elemBefore: /*#__PURE__*/React.createElement(DeleteIcon, {
13
+ color: "currentColor",
14
+ label: "",
15
+ size: "small"
16
+ }),
17
+ elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
18
+ shortcut: (_tooltip = tooltip(deleteRow)) !== null && _tooltip !== void 0 ? _tooltip : ''
19
+ })
20
+ }, formatMessage(messages.removeRows, {
21
+ 0: 1
22
+ }));
23
+ };