@atlaskit/editor-plugin-table 22.4.4 → 22.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/CHANGELOG.md +9 -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 +8 -8
  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
@@ -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 HeaderRowToggleItem = () => {
7
+ const {
8
+ formatMessage
9
+ } = useIntl();
10
+ const label = formatMessage(messages.headerRow);
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 { 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
+ const getMoveRowDownShortcut = () => tooltip(expValEquals('editor-a11y-fy26-keyboard-move-row-column', 'isEnabled', true) ? moveRowDown : moveRowDownOld);
8
+ export const MoveRowDownItem = () => {
9
+ var _getMoveRowDownShortc;
10
+ const {
11
+ formatMessage
12
+ } = useIntl();
13
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
14
+ elemBefore: /*#__PURE__*/React.createElement(TableRowMoveDownIcon, {
15
+ color: "currentColor",
16
+ label: "",
17
+ size: "small"
18
+ }),
19
+ elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
20
+ shortcut: (_getMoveRowDownShortc = getMoveRowDownShortcut()) !== null && _getMoveRowDownShortc !== void 0 ? _getMoveRowDownShortc : ''
21
+ })
22
+ }, formatMessage(messages.moveRowDown, {
23
+ 0: 1
24
+ }));
25
+ };
@@ -0,0 +1,25 @@
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
+ const getMoveRowUpShortcut = () => tooltip(expValEquals('editor-a11y-fy26-keyboard-move-row-column', 'isEnabled', true) ? moveRowUp : moveRowUpOld);
8
+ export const MoveRowUpItem = () => {
9
+ var _getMoveRowUpShortcut;
10
+ const {
11
+ formatMessage
12
+ } = useIntl();
13
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
14
+ elemBefore: /*#__PURE__*/React.createElement(TableRowMoveUpIcon, {
15
+ color: "currentColor",
16
+ label: "",
17
+ size: "small"
18
+ }),
19
+ elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
20
+ shortcut: (_getMoveRowUpShortcut = getMoveRowUpShortcut()) !== null && _getMoveRowUpShortcut !== void 0 ? _getMoveRowUpShortcut : ''
21
+ })
22
+ }, formatMessage(messages.moveRowUp, {
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 { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
5
+ import Toggle from '@atlaskit/toggle';
6
+ export const NumberedRowsToggleItem = () => {
7
+ const {
8
+ formatMessage
9
+ } = useIntl();
10
+ const label = formatMessage(messages.numberedRows);
11
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
12
+ elemAfter: /*#__PURE__*/React.createElement(Toggle, {
13
+ label: label,
14
+ isChecked: false
15
+ })
16
+ }, label);
17
+ };
@@ -1,3 +1,5 @@
1
+ import { BACKGROUND_COLOR_ITEM, CLEAR_CELLS_ITEM } from '../shared/keys';
2
+
1
3
  // --- Menu surface ---
2
4
 
3
5
  export const ROW_MENU = {
@@ -23,7 +25,7 @@ export const ROW_DANGER_SECTION = {
23
25
  type: 'menu-section',
24
26
  key: 'row-danger-section'
25
27
  };
26
- export const ROW_SECTION_RANK = {
28
+ export const ROW_MENU_SECTION_RANK = {
27
29
  [ROW_TOGGLE_SECTION.key]: 100,
28
30
  [ROW_BACKGROUND_SECTION.key]: 200,
29
31
  [ROW_ADD_SECTION.key]: 300,
@@ -37,10 +39,6 @@ export const NUMBERED_ROWS_TOGGLE_ITEM = {
37
39
  type: 'menu-item',
38
40
  key: 'numbered-rows-toggle'
39
41
  };
40
- export const BACKGROUND_COLOR_ITEM = {
41
- type: 'menu-item',
42
- key: 'background-color'
43
- };
44
42
  export const ADD_ROW_ABOVE_ITEM = {
45
43
  type: 'menu-item',
46
44
  key: 'add-row-above'
@@ -57,10 +55,6 @@ export const MOVE_ROW_DOWN_ITEM = {
57
55
  type: 'menu-item',
58
56
  key: 'move-row-down'
59
57
  };
60
- export const CLEAR_CELLS_ITEM = {
61
- type: 'menu-item',
62
- key: 'clear-cells'
63
- };
64
58
  export const DELETE_ROW_ITEM = {
65
59
  type: 'menu-item',
66
60
  key: 'delete-row'
@@ -68,20 +62,20 @@ export const DELETE_ROW_ITEM = {
68
62
 
69
63
  // --- Item ranks within their sections ---
70
64
 
71
- export const TOGGLE_SECTION_ITEM_RANK = {
65
+ export const ROW_TOGGLE_SECTION_RANK = {
72
66
  [HEADER_ROW_TOGGLE_ITEM.key]: 100,
73
67
  [NUMBERED_ROWS_TOGGLE_ITEM.key]: 200
74
68
  };
75
- export const BACKGROUND_SECTION_ITEM_RANK = {
69
+ export const ROW_BACKGROUND_SECTION_RANK = {
76
70
  [BACKGROUND_COLOR_ITEM.key]: 100
77
71
  };
78
- export const ADD_SECTION_ITEM_RANK = {
72
+ export const ROW_ADD_SECTION_RANK = {
79
73
  [ADD_ROW_ABOVE_ITEM.key]: 100,
80
74
  [ADD_ROW_BELOW_ITEM.key]: 200,
81
75
  [MOVE_ROW_UP_ITEM.key]: 300,
82
76
  [MOVE_ROW_DOWN_ITEM.key]: 400
83
77
  };
84
- export const DANGER_SECTION_ITEM_RANK = {
78
+ export const ROW_DANGER_SECTION_RANK = {
85
79
  [CLEAR_CELLS_ITEM.key]: 100,
86
80
  [DELETE_ROW_ITEM.key]: 200
87
81
  };
@@ -0,0 +1,28 @@
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
+ const tableMenuContainerStyles = {
8
+ container: "_2rko1qi0 _1reo15vq _18m915vq _1bsb1178 _16qs130s _bfhk1bhr"
9
+ };
10
+ export const TableMenu = /*#__PURE__*/memo(({
11
+ api,
12
+ surface
13
+ }) => {
14
+ const components = useMemo(() => {
15
+ var _api$uiControlRegistr, _api$uiControlRegistr2;
16
+ return (_api$uiControlRegistr = api === null || api === void 0 ? 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 : [];
17
+ }, [api, surface.key]);
18
+ if (components.length === 0) {
19
+ return null;
20
+ }
21
+ return /*#__PURE__*/React.createElement(Box, {
22
+ xcss: tableMenuContainerStyles.container,
23
+ testId: surface.key
24
+ }, /*#__PURE__*/React.createElement(SurfaceRenderer, {
25
+ surface: surface,
26
+ components: components
27
+ }));
28
+ });
@@ -1 +1 @@
1
- export const newMenuWidth = 280;
1
+ export const TABLE_MENU_WIDTH = 280;
@@ -0,0 +1,33 @@
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 const getSharedItems = () => [{
8
+ type: BACKGROUND_COLOR_ITEM.type,
9
+ key: BACKGROUND_COLOR_ITEM.key,
10
+ parents: [{
11
+ type: ROW_BACKGROUND_SECTION.type,
12
+ key: ROW_BACKGROUND_SECTION.key,
13
+ rank: ROW_BACKGROUND_SECTION_RANK[BACKGROUND_COLOR_ITEM.key]
14
+ }, {
15
+ type: COLUMN_BACKGROUND_SECTION.type,
16
+ key: COLUMN_BACKGROUND_SECTION.key,
17
+ rank: COLUMN_BACKGROUND_SECTION_RANK[BACKGROUND_COLOR_ITEM.key]
18
+ }],
19
+ component: () => /*#__PURE__*/React.createElement(BackgroundColorItem, null)
20
+ }, {
21
+ type: CLEAR_CELLS_ITEM.type,
22
+ key: CLEAR_CELLS_ITEM.key,
23
+ parents: [{
24
+ type: ROW_DANGER_SECTION.type,
25
+ key: ROW_DANGER_SECTION.key,
26
+ rank: ROW_DANGER_SECTION_RANK[CLEAR_CELLS_ITEM.key]
27
+ }, {
28
+ type: COLUMN_DANGER_SECTION.type,
29
+ key: COLUMN_DANGER_SECTION.key,
30
+ rank: COLUMN_DANGER_SECTION_RANK[CLEAR_CELLS_ITEM.key]
31
+ }],
32
+ component: () => /*#__PURE__*/React.createElement(ClearCellsItem, null)
33
+ }];
@@ -0,0 +1,4 @@
1
+ import { getColumnMenuComponents } from '../column/getColumnMenuComponents';
2
+ import { getRowMenuComponents } from '../row/getRowMenuComponents';
3
+ import { getSharedItems } from './getSharedItems';
4
+ export const getTableMenuComponents = () => [...getRowMenuComponents(), ...getColumnMenuComponents(), ...getSharedItems()];
@@ -14,17 +14,15 @@ const colorPaletteStyles = {
14
14
  elemAfter: "_zulp1b66 _1e0c1txw _4cvr1h6o",
15
15
  colorPreview: "_2rko12b0 _1h6d1l7x _1dqonqa1 _189ee4h9 _1bsbdlk8 _4t3idlk8 _1o9zidpf"
16
16
  };
17
- export const BackgroundColorItem = ({
18
- testId
19
- }) => {
17
+ export const BackgroundColorItem = () => {
20
18
  const {
21
19
  formatMessage
22
20
  } = useIntl();
23
- const selectedColor = '#ffffff';
24
21
  const onClick = useCallback(() => {}, []);
22
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
25
23
  const colorPreviewStyle = useMemo(() => ({
26
- backgroundColor: selectedColor
27
- }), [selectedColor]);
24
+ backgroundColor: '#ffffff'
25
+ }), []);
28
26
  const paletteOptions = useMemo(() => {
29
27
  return {
30
28
  palette: cellBackgroundColorPalette,
@@ -33,7 +31,6 @@ export const BackgroundColorItem = ({
33
31
  };
34
32
  }, []);
35
33
  return /*#__PURE__*/React.createElement(ToolbarNestedDropdownMenu, {
36
- testId: testId,
37
34
  elemBefore: /*#__PURE__*/React.createElement(PaintBucketIcon, {
38
35
  color: "currentColor",
39
36
  label: "",
@@ -54,7 +51,7 @@ export const BackgroundColorItem = ({
54
51
  }, /*#__PURE__*/React.createElement(ColorPalette, {
55
52
  cols: colorPaletteColumns,
56
53
  onClick: onClick,
57
- selectedColor: selectedColor,
54
+ selectedColor: colorPreviewStyle.backgroundColor,
58
55
  paletteOptions: paletteOptions
59
56
  })));
60
57
  };
@@ -3,15 +3,12 @@ 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 const ClearCellsItem = ({
7
- testId
8
- }) => {
6
+ export const ClearCellsItem = () => {
9
7
  var _tooltip;
10
8
  const {
11
9
  formatMessage
12
10
  } = useIntl();
13
11
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
14
- testId: testId,
15
12
  elemBefore: /*#__PURE__*/React.createElement(CrossIcon, {
16
13
  color: "currentColor",
17
14
  label: "",
@@ -0,0 +1,8 @@
1
+ export const BACKGROUND_COLOR_ITEM = {
2
+ type: 'menu-item',
3
+ key: 'background-color'
4
+ };
5
+ export const CLEAR_CELLS_ITEM = {
6
+ type: 'menu-item',
7
+ key: 'clear-cells'
8
+ };
@@ -46,7 +46,7 @@ import { getHeightInfoPayload, getWidthInfoPayload } from './pm-plugins/utils/an
46
46
  import { createTableWithWidth } from './pm-plugins/utils/create';
47
47
  import { createPlugin as createViewModeSortPlugin } from './pm-plugins/view-mode-sort';
48
48
  import { ContentComponent } from './ui/ContentComponent';
49
- import { getRowMenuComponents } from './ui/TableMenu/row/getRowMenuComponents';
49
+ import { getTableMenuComponents } from './ui/TableMenu/shared/getTableMenuComponents';
50
50
  import { getToolbarConfig } from './ui/toolbar';
51
51
  var defaultGetEditorFeatureFlags = function defaultGetEditorFeatureFlags() {
52
52
  return {};
@@ -85,7 +85,7 @@ var tablePlugin = function tablePlugin(_ref) {
85
85
  !(options !== null && options !== void 0 && options.isChromelessEditor) && !(options !== null && options !== void 0 && options.isCommentEditor) && (options === null || options === void 0 || (_options$getEditorFea2 = options.getEditorFeatureFlags) === null || _options$getEditorFea2 === void 0 ? void 0 : _options$getEditorFea2.call(options).tableSelector) && editorExperiment('platform_editor_controls', 'variant1');
86
86
  if (expValEquals('platform_editor_table_menu_updates', 'isEnabled', true)) {
87
87
  var _api$uiControlRegistr;
88
- api === null || api === void 0 || (_api$uiControlRegistr = api.uiControlRegistry) === null || _api$uiControlRegistr === void 0 || _api$uiControlRegistr.actions.register(getRowMenuComponents());
88
+ api === null || api === void 0 || (_api$uiControlRegistr = api.uiControlRegistry) === null || _api$uiControlRegistr === void 0 || _api$uiControlRegistr.actions.register(getTableMenuComponents());
89
89
  }
90
90
  return {
91
91
  name: 'table',
@@ -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
- var rowMenuOffset = dragTableInsertColumnButtonSize + 4;
14
+ var TABLE_MENU_OFFSET = dragTableInsertColumnButtonSize + 4;
13
15
  var FloatingDragMenu = function FloatingDragMenu(_ref) {
14
16
  var _getEditorFeatureFlag;
15
17
  var mountPoint = _ref.mountPoint,
@@ -53,7 +55,7 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
53
55
  mountTo: mountPoint,
54
56
  boundariesElement: boundariesElement,
55
57
  scrollableElement: scrollableElement,
56
- fitWidth: expValEquals('platform_editor_table_menu_updates', 'isEnabled', true) ? newMenuWidth : dragMenuDropdownWidth,
58
+ fitWidth: expValEquals('platform_editor_table_menu_updates', 'isEnabled', true) ? TABLE_MENU_WIDTH : dragMenuDropdownWidth,
57
59
  fitHeight: tablePopupMenuFitHeight
58
60
  // z-index value below is to ensure that this menu is above other floating menu
59
61
  // in table, but below floating dialogs like typeaheads, pickers, etc.
@@ -61,10 +63,11 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
61
63
  ,
62
64
  zIndex: inStickyMode ? akEditorFloatingDialogZIndex : akEditorFloatingOverlapPanelZIndex,
63
65
  forcePlacement: true,
64
- offset: expValEquals('platform_editor_table_menu_updates', 'isEnabled', true) ? [rowMenuOffset, 0] : direction === 'row' ? [-9, 0] : [0, -7],
66
+ offset: expValEquals('platform_editor_table_menu_updates', 'isEnabled', true) ? [TABLE_MENU_OFFSET, 0] : direction === 'row' ? [-9, 0] : [0, -7],
65
67
  stick: true
66
- }, expValEquals('platform_editor_table_menu_updates', 'isEnabled', true) ? /*#__PURE__*/React.createElement(RowMenu, {
67
- api: api
68
+ }, expValEquals('platform_editor_table_menu_updates', 'isEnabled', true) ? /*#__PURE__*/React.createElement(TableMenu, {
69
+ api: api,
70
+ surface: direction === 'row' ? ROW_MENU : COLUMN_MENU
68
71
  }) : /*#__PURE__*/React.createElement(DragMenu, {
69
72
  editorView: editorView,
70
73
  isOpen: isOpen,
@@ -0,0 +1,188 @@
1
+ import React from 'react';
2
+ import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
3
+ import { AddColumnLeftItem } from './items/AddColumnLeftItem';
4
+ import { AddColumnRightItem } from './items/AddColumnRightItem';
5
+ import { DeleteColumnItem } from './items/DeleteColumnItem';
6
+ import { DistributeColumnsItem } from './items/DistributeColumnsItem';
7
+ import { HeaderColumnToggleItem } from './items/HeaderColumnToggleItem';
8
+ import { MoveColumnRightItem } from './items/MoveColumnRightItem';
9
+ import { SortDecreasingItem } from './items/SortDecreasingItem';
10
+ import { SortIncreasingItem } from './items/SortIncreasingItem';
11
+ import { COLUMN_MENU, COLUMN_TOGGLE_SECTION, COLUMN_BACKGROUND_SECTION, COLUMN_SORT_SECTION, COLUMN_ADD_SECTION, COLUMN_DANGER_SECTION, COLUMN_SECTION_RANK, HEADER_COLUMN_TOGGLE_ITEM, SORT_INCREASING_ITEM, SORT_DECREASING_ITEM, ADD_COLUMN_LEFT_ITEM, ADD_COLUMN_RIGHT_ITEM, MOVE_COLUMN_RIGHT_ITEM, DISTRIBUTE_COLUMNS_ITEM, DELETE_COLUMN_ITEM, COLUMN_TOGGLE_SECTION_RANK, COLUMN_SORT_SECTION_RANK, COLUMN_ADD_SECTION_RANK, COLUMN_DANGER_SECTION_RANK } from './keys';
12
+
13
+ /**
14
+ * Returns the RegisterComponent[] array defining the column menu surface.
15
+ *
16
+ * This is a **UI-only stub** — all items are always visible with no conditional
17
+ * logic and no wired actions. Functional behaviour (actions, conditional visibility)
18
+ * will be connected in follow-up tickets.
19
+ */
20
+ export var getColumnMenuComponents = function getColumnMenuComponents() {
21
+ return [
22
+ // --- Menu surface ---
23
+ {
24
+ type: COLUMN_MENU.type,
25
+ key: COLUMN_MENU.key
26
+ },
27
+ // --- Toggle section (Header column) ---
28
+ {
29
+ type: COLUMN_TOGGLE_SECTION.type,
30
+ key: COLUMN_TOGGLE_SECTION.key,
31
+ parents: [{
32
+ type: COLUMN_MENU.type,
33
+ key: COLUMN_MENU.key,
34
+ rank: COLUMN_SECTION_RANK[COLUMN_TOGGLE_SECTION.key]
35
+ }],
36
+ component: function component(props) {
37
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, null, props.children);
38
+ }
39
+ }, {
40
+ type: HEADER_COLUMN_TOGGLE_ITEM.type,
41
+ key: HEADER_COLUMN_TOGGLE_ITEM.key,
42
+ parents: [{
43
+ type: COLUMN_TOGGLE_SECTION.type,
44
+ key: COLUMN_TOGGLE_SECTION.key,
45
+ rank: COLUMN_TOGGLE_SECTION_RANK[HEADER_COLUMN_TOGGLE_ITEM.key]
46
+ }],
47
+ component: function component() {
48
+ return /*#__PURE__*/React.createElement(HeaderColumnToggleItem, null);
49
+ }
50
+ },
51
+ // --- Background color section ---
52
+ {
53
+ type: COLUMN_BACKGROUND_SECTION.type,
54
+ key: COLUMN_BACKGROUND_SECTION.key,
55
+ parents: [{
56
+ type: COLUMN_MENU.type,
57
+ key: COLUMN_MENU.key,
58
+ rank: COLUMN_SECTION_RANK[COLUMN_BACKGROUND_SECTION.key]
59
+ }],
60
+ component: function component(props) {
61
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
62
+ hasSeparator: true
63
+ }, props.children);
64
+ }
65
+ },
66
+ // --- Sort section ---
67
+ {
68
+ type: COLUMN_SORT_SECTION.type,
69
+ key: COLUMN_SORT_SECTION.key,
70
+ parents: [{
71
+ type: COLUMN_MENU.type,
72
+ key: COLUMN_MENU.key,
73
+ rank: COLUMN_SECTION_RANK[COLUMN_SORT_SECTION.key]
74
+ }],
75
+ component: function component(props) {
76
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
77
+ hasSeparator: true
78
+ }, props.children);
79
+ }
80
+ }, {
81
+ type: SORT_INCREASING_ITEM.type,
82
+ key: SORT_INCREASING_ITEM.key,
83
+ parents: [{
84
+ type: COLUMN_SORT_SECTION.type,
85
+ key: COLUMN_SORT_SECTION.key,
86
+ rank: COLUMN_SORT_SECTION_RANK[SORT_INCREASING_ITEM.key]
87
+ }],
88
+ component: function component() {
89
+ return /*#__PURE__*/React.createElement(SortIncreasingItem, null);
90
+ }
91
+ }, {
92
+ type: SORT_DECREASING_ITEM.type,
93
+ key: SORT_DECREASING_ITEM.key,
94
+ parents: [{
95
+ type: COLUMN_SORT_SECTION.type,
96
+ key: COLUMN_SORT_SECTION.key,
97
+ rank: COLUMN_SORT_SECTION_RANK[SORT_DECREASING_ITEM.key]
98
+ }],
99
+ component: function component() {
100
+ return /*#__PURE__*/React.createElement(SortDecreasingItem, null);
101
+ }
102
+ },
103
+ // --- Add / Move section ---
104
+ {
105
+ type: COLUMN_ADD_SECTION.type,
106
+ key: COLUMN_ADD_SECTION.key,
107
+ parents: [{
108
+ type: COLUMN_MENU.type,
109
+ key: COLUMN_MENU.key,
110
+ rank: COLUMN_SECTION_RANK[COLUMN_ADD_SECTION.key]
111
+ }],
112
+ component: function component(props) {
113
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
114
+ hasSeparator: true
115
+ }, props.children);
116
+ }
117
+ }, {
118
+ type: ADD_COLUMN_LEFT_ITEM.type,
119
+ key: ADD_COLUMN_LEFT_ITEM.key,
120
+ parents: [{
121
+ type: COLUMN_ADD_SECTION.type,
122
+ key: COLUMN_ADD_SECTION.key,
123
+ rank: COLUMN_ADD_SECTION_RANK[ADD_COLUMN_LEFT_ITEM.key]
124
+ }],
125
+ component: function component() {
126
+ return /*#__PURE__*/React.createElement(AddColumnLeftItem, null);
127
+ }
128
+ }, {
129
+ type: ADD_COLUMN_RIGHT_ITEM.type,
130
+ key: ADD_COLUMN_RIGHT_ITEM.key,
131
+ parents: [{
132
+ type: COLUMN_ADD_SECTION.type,
133
+ key: COLUMN_ADD_SECTION.key,
134
+ rank: COLUMN_ADD_SECTION_RANK[ADD_COLUMN_RIGHT_ITEM.key]
135
+ }],
136
+ component: function component() {
137
+ return /*#__PURE__*/React.createElement(AddColumnRightItem, null);
138
+ }
139
+ }, {
140
+ type: MOVE_COLUMN_RIGHT_ITEM.type,
141
+ key: MOVE_COLUMN_RIGHT_ITEM.key,
142
+ parents: [{
143
+ type: COLUMN_ADD_SECTION.type,
144
+ key: COLUMN_ADD_SECTION.key,
145
+ rank: COLUMN_ADD_SECTION_RANK[MOVE_COLUMN_RIGHT_ITEM.key]
146
+ }],
147
+ component: function component() {
148
+ return /*#__PURE__*/React.createElement(MoveColumnRightItem, null);
149
+ }
150
+ }, {
151
+ type: DISTRIBUTE_COLUMNS_ITEM.type,
152
+ key: DISTRIBUTE_COLUMNS_ITEM.key,
153
+ parents: [{
154
+ type: COLUMN_ADD_SECTION.type,
155
+ key: COLUMN_ADD_SECTION.key,
156
+ rank: COLUMN_ADD_SECTION_RANK[DISTRIBUTE_COLUMNS_ITEM.key]
157
+ }],
158
+ component: function component() {
159
+ return /*#__PURE__*/React.createElement(DistributeColumnsItem, null);
160
+ }
161
+ },
162
+ // --- Danger section (Clear cells, Delete column) ---
163
+ {
164
+ type: COLUMN_DANGER_SECTION.type,
165
+ key: COLUMN_DANGER_SECTION.key,
166
+ parents: [{
167
+ type: COLUMN_MENU.type,
168
+ key: COLUMN_MENU.key,
169
+ rank: COLUMN_SECTION_RANK[COLUMN_DANGER_SECTION.key]
170
+ }],
171
+ component: function component(props) {
172
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
173
+ hasSeparator: true
174
+ }, props.children);
175
+ }
176
+ }, {
177
+ type: DELETE_COLUMN_ITEM.type,
178
+ key: DELETE_COLUMN_ITEM.key,
179
+ parents: [{
180
+ type: COLUMN_DANGER_SECTION.type,
181
+ key: COLUMN_DANGER_SECTION.key,
182
+ rank: COLUMN_DANGER_SECTION_RANK[DELETE_COLUMN_ITEM.key]
183
+ }],
184
+ component: function component() {
185
+ return /*#__PURE__*/React.createElement(DeleteColumnItem, null);
186
+ }
187
+ }];
188
+ };
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { useIntl } from 'react-intl';
3
+ import { addColumnBefore, tooltip } from '@atlaskit/editor-common/keymaps';
4
+ import { tableMessages as messages } from '@atlaskit/editor-common/messages';
5
+ import { TableColumnAddLeftIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
6
+ export var AddColumnLeftItem = function AddColumnLeftItem() {
7
+ var _tooltip;
8
+ var _useIntl = useIntl(),
9
+ formatMessage = _useIntl.formatMessage;
10
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
11
+ elemBefore: /*#__PURE__*/React.createElement(TableColumnAddLeftIcon, {
12
+ color: "currentColor",
13
+ label: "",
14
+ size: "small"
15
+ }),
16
+ elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
17
+ shortcut: (_tooltip = tooltip(addColumnBefore)) !== null && _tooltip !== void 0 ? _tooltip : ''
18
+ })
19
+ }, formatMessage(messages.addColumnLeft));
20
+ };
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { useIntl } from 'react-intl';
3
+ import { addColumnAfter, tooltip } from '@atlaskit/editor-common/keymaps';
4
+ import { tableMessages as messages } from '@atlaskit/editor-common/messages';
5
+ import { TableColumnAddRightIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
6
+ export var AddColumnRightItem = function AddColumnRightItem() {
7
+ var _tooltip;
8
+ var _useIntl = useIntl(),
9
+ formatMessage = _useIntl.formatMessage;
10
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
11
+ elemBefore: /*#__PURE__*/React.createElement(TableColumnAddRightIcon, {
12
+ color: "currentColor",
13
+ label: "",
14
+ size: "small"
15
+ }),
16
+ elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
17
+ shortcut: (_tooltip = tooltip(addColumnAfter)) !== null && _tooltip !== void 0 ? _tooltip : ''
18
+ })
19
+ }, formatMessage(messages.addColumnRight));
20
+ };
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { useIntl } from 'react-intl';
3
+ import { deleteColumn, tooltip } from '@atlaskit/editor-common/keymaps';
4
+ import { tableMessages as messages } from '@atlaskit/editor-common/messages';
5
+ import { DeleteIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
6
+ export var DeleteColumnItem = function DeleteColumnItem() {
7
+ var _tooltip;
8
+ var _useIntl = useIntl(),
9
+ formatMessage = _useIntl.formatMessage;
10
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
11
+ elemBefore: /*#__PURE__*/React.createElement(DeleteIcon, {
12
+ color: "currentColor",
13
+ label: "",
14
+ size: "small"
15
+ }),
16
+ elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
17
+ shortcut: (_tooltip = tooltip(deleteColumn)) !== null && _tooltip !== void 0 ? _tooltip : ''
18
+ })
19
+ }, formatMessage(messages.removeColumns, {
20
+ 0: 1
21
+ }));
22
+ };
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { useIntl } from 'react-intl';
3
+ import { tableMessages as messages } from '@atlaskit/editor-common/messages';
4
+ import { TableColumnsDistributeIcon, ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
5
+ export var DistributeColumnsItem = function DistributeColumnsItem() {
6
+ var _useIntl = useIntl(),
7
+ formatMessage = _useIntl.formatMessage;
8
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
9
+ elemBefore: /*#__PURE__*/React.createElement(TableColumnsDistributeIcon, {
10
+ color: "currentColor",
11
+ label: "",
12
+ size: "small"
13
+ })
14
+ }, formatMessage(messages.distributeColumns));
15
+ };
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { useIntl } from 'react-intl';
3
+ import { tableMessages as messages } from '@atlaskit/editor-common/messages';
4
+ import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
5
+ import Toggle from '@atlaskit/toggle';
6
+ export var HeaderColumnToggleItem = function HeaderColumnToggleItem() {
7
+ var _useIntl = useIntl(),
8
+ formatMessage = _useIntl.formatMessage;
9
+ var label = formatMessage(messages.headerColumn);
10
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
11
+ elemAfter: /*#__PURE__*/React.createElement(Toggle, {
12
+ label: label,
13
+ isChecked: false
14
+ })
15
+ }, label);
16
+ };