@atlaskit/editor-plugin-table 7.28.9 → 7.28.10

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 (36) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/ui/FloatingContextualButton/index.js +2 -1
  3. package/dist/cjs/ui/FloatingContextualButton/styles.js +9 -4
  4. package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +76 -45
  5. package/dist/cjs/ui/FloatingContextualMenu/styles.js +1 -10
  6. package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +19 -12
  7. package/dist/cjs/ui/FloatingDragMenu/styles.js +1 -7
  8. package/dist/cjs/utils/drag-menu.js +47 -14
  9. package/dist/es2019/ui/FloatingContextualButton/index.js +2 -1
  10. package/dist/es2019/ui/FloatingContextualButton/styles.js +6 -1
  11. package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +77 -46
  12. package/dist/es2019/ui/FloatingContextualMenu/styles.js +0 -9
  13. package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +20 -13
  14. package/dist/es2019/ui/FloatingDragMenu/styles.js +0 -6
  15. package/dist/es2019/utils/drag-menu.js +50 -17
  16. package/dist/esm/ui/FloatingContextualButton/index.js +2 -1
  17. package/dist/esm/ui/FloatingContextualButton/styles.js +8 -2
  18. package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +77 -46
  19. package/dist/esm/ui/FloatingContextualMenu/styles.js +0 -9
  20. package/dist/esm/ui/FloatingDragMenu/DragMenu.js +20 -13
  21. package/dist/esm/ui/FloatingDragMenu/styles.js +0 -6
  22. package/dist/esm/utils/drag-menu.js +47 -14
  23. package/dist/types/ui/FloatingContextualMenu/styles.d.ts +0 -1
  24. package/dist/types/ui/FloatingDragMenu/styles.d.ts +0 -1
  25. package/dist/types/utils/drag-menu.d.ts +4 -2
  26. package/dist/types-ts4.5/ui/FloatingContextualMenu/styles.d.ts +0 -1
  27. package/dist/types-ts4.5/ui/FloatingDragMenu/styles.d.ts +0 -1
  28. package/dist/types-ts4.5/utils/drag-menu.d.ts +4 -2
  29. package/package.json +5 -2
  30. package/src/ui/FloatingContextualButton/index.tsx +2 -2
  31. package/src/ui/FloatingContextualButton/styles.ts +5 -0
  32. package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +75 -36
  33. package/src/ui/FloatingContextualMenu/styles.ts +0 -8
  34. package/src/ui/FloatingDragMenu/DragMenu.tsx +20 -15
  35. package/src/ui/FloatingDragMenu/styles.ts +0 -6
  36. package/src/utils/drag-menu.ts +73 -43
@@ -19,10 +19,19 @@ import { closestElement } from '@atlaskit/editor-common/utils';
19
19
  import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
20
20
  import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
21
21
  import { splitCell } from '@atlaskit/editor-tables/utils';
22
- import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';
23
- import EditorBackgroundColorIcon from '@atlaskit/icon/glyph/editor/background-color';
24
- import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
22
+ import CrossCircleIcon from '@atlaskit/icon/core/migration/cross-circle';
23
+ import RemoveIcon from '@atlaskit/icon/core/migration/delete--editor-remove';
24
+ import EditorBackgroundColorIcon from '@atlaskit/icon/core/migration/paint-bucket--editor-background-color';
25
+ import PaintBucketIcon from '@atlaskit/icon/core/paint-bucket';
26
+ import TableCellClearIcon from '@atlaskit/icon/core/table-cell-clear';
27
+ import TableCellMergeIcon from '@atlaskit/icon/core/table-cell-merge';
28
+ import TableCellSplitIcon from '@atlaskit/icon/core/table-cell-split';
29
+ import TableColumnAddRightIcon from '@atlaskit/icon/core/table-column-add-right';
30
+ import TableColumnDeleteIcon from '@atlaskit/icon/core/table-column-delete';
31
+ import TableRowAddBelowIcon from '@atlaskit/icon/core/table-row-add-below';
32
+ import TableRowDeleteIcon from '@atlaskit/icon/core/table-row-delete';
25
33
  import { fg } from '@atlaskit/platform-feature-flags';
34
+ import { Box, xcss } from '@atlaskit/primitives';
26
35
  import { clearHoverSelection, hoverColumns, hoverMergedCells, hoverRows, setFocusToCellMenu, toggleContextualMenu } from '../../commands';
27
36
  import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics, distributeColumnsWidthsWithAnalytics, emptyMultipleCellsWithAnalytics, insertColumnWithAnalytics, insertRowWithAnalytics, mergeCellsWithAnalytics, setColorWithAnalytics, sortColumnWithAnalytics, splitCellWithAnalytics } from '../../commands-with-analytics';
28
37
  import { getPluginState } from '../../pm-plugins/plugin-factory';
@@ -33,8 +42,13 @@ import { TableCssClassName as ClassName } from '../../types';
33
42
  import { getMergedCellsPositions, getSelectedColumnIndexes, getSelectedRowIndexes } from '../../utils';
34
43
  import { colorPalletteColumns, contextualMenuDropdownWidth, contextualMenuDropdownWidthDnD } from '../consts';
35
44
  import { AddColRightIcon, AddRowBelowIcon, MergeCellsIcon, SplitCellIcon } from '../icons';
36
- import { cellColourPreviewStyles, elementBeforeIconStyles } from './styles';
45
+ import { cellColourPreviewStyles } from './styles';
37
46
  const arrowsList = new Set(['ArrowRight', 'ArrowLeft']);
47
+ const elementBeforeIconStyles = xcss({
48
+ marginRight: 'space.negative.075',
49
+ display: 'flex'
50
+ });
51
+ // eslint-disable-next-line @repo/internal/react/no-class-components
38
52
  export class ContextualMenu extends Component {
39
53
  constructor(...args) {
40
54
  super(...args);
@@ -90,13 +104,13 @@ export class ContextualMenu extends Component {
90
104
  value: {
91
105
  name: 'background'
92
106
  },
93
- elemBefore: isDragAndDropEnabled ?
94
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
95
- jsx("span", {
96
- css: elementBeforeIconStyles
97
- }, jsx(EditorBackgroundColorIcon, {
107
+ elemBefore: isDragAndDropEnabled ? jsx(Box, {
108
+ xcss: elementBeforeIconStyles
109
+ }, jsx(PaintBucketIcon, {
110
+ color: "currentColor",
111
+ spacing: "spacious",
98
112
  label: formatMessage(messages.backgroundColor),
99
- size: "medium"
113
+ LEGACY_fallbackIcon: EditorBackgroundColorIcon
100
114
  })) : undefined,
101
115
  elemAfter:
102
116
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
@@ -178,22 +192,28 @@ export class ContextualMenu extends Component {
178
192
  name: 'merge'
179
193
  },
180
194
  isDisabled: !canMergeCells(state.tr),
181
- elemBefore: isDragAndDropEnabled ?
182
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
183
- jsx("span", {
184
- css: elementBeforeIconStyles
185
- }, jsx(MergeCellsIcon, null)) : undefined
195
+ elemBefore: isDragAndDropEnabled ? jsx(Box, {
196
+ xcss: elementBeforeIconStyles
197
+ }, jsx(TableCellMergeIcon, {
198
+ color: "currentColor",
199
+ spacing: "spacious",
200
+ label: formatMessage(messages.mergeCells),
201
+ LEGACY_fallbackIcon: MergeCellsIcon
202
+ })) : undefined
186
203
  }, {
187
204
  content: formatMessage(messages.splitCell),
188
205
  value: {
189
206
  name: 'split'
190
207
  },
191
208
  isDisabled: !splitCell(state),
192
- elemBefore: isDragAndDropEnabled ?
193
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
194
- jsx("span", {
195
- css: elementBeforeIconStyles
196
- }, jsx(SplitCellIcon, null)) : undefined
209
+ elemBefore: isDragAndDropEnabled ? jsx(Box, {
210
+ xcss: elementBeforeIconStyles
211
+ }, jsx(TableCellSplitIcon, {
212
+ color: "currentColor",
213
+ spacing: "spacious",
214
+ label: formatMessage(messages.splitCell),
215
+ LEGACY_fallbackIcon: SplitCellIcon
216
+ })) : undefined
197
217
  }];
198
218
  }
199
219
  return [];
@@ -220,9 +240,14 @@ export class ContextualMenu extends Component {
220
240
  }, tooltip(addColumnAfter)),
221
241
  elemBefore: isDragAndDropEnabled ?
222
242
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
223
- jsx("span", {
224
- css: elementBeforeIconStyles
225
- }, jsx(AddColRightIcon, null)) : undefined,
243
+ jsx(Box, {
244
+ xcss: elementBeforeIconStyles
245
+ }, jsx(TableColumnAddRightIcon, {
246
+ color: "currentColor",
247
+ spacing: "spacious",
248
+ label: formatMessage(messages.addColumnRight),
249
+ LEGACY_fallbackIcon: AddColRightIcon
250
+ })) : undefined,
226
251
  'aria-label': fg('platform_editor_announce_cell_options_hotkeys') ? tooltip(addColumnAfter, String(content)) : undefined
227
252
  };
228
253
  });
@@ -246,11 +271,14 @@ export class ContextualMenu extends Component {
246
271
  elemAfter: jsx("div", {
247
272
  css: shortcutStyle
248
273
  }, tooltip(addRowAfter)),
249
- elemBefore: isDragAndDropEnabled ?
250
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
251
- jsx("span", {
252
- css: elementBeforeIconStyles
253
- }, jsx(AddRowBelowIcon, null)) : undefined,
274
+ elemBefore: isDragAndDropEnabled ? jsx(Box, {
275
+ xcss: elementBeforeIconStyles
276
+ }, jsx(TableRowAddBelowIcon, {
277
+ color: "currentColor",
278
+ spacing: "spacious",
279
+ label: formatMessage(messages.addRowBelow),
280
+ LEGACY_fallbackIcon: AddRowBelowIcon
281
+ })) : undefined,
254
282
  'aria-label': fg('platform_editor_announce_cell_options_hotkeys') ? tooltip(addRowAfter, String(content)) : undefined
255
283
  };
256
284
  });
@@ -285,14 +313,15 @@ export class ContextualMenu extends Component {
285
313
  elemAfter: jsx("div", {
286
314
  css: shortcutStyle
287
315
  }, tooltip(backspace)),
288
- elemBefore: isDragAndDropEnabled ?
289
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
290
- jsx("span", {
291
- css: elementBeforeIconStyles
292
- }, jsx(CrossCircleIcon, {
316
+ elemBefore: isDragAndDropEnabled ? jsx(Box, {
317
+ xcss: elementBeforeIconStyles
318
+ }, jsx(TableCellClearIcon, {
319
+ color: "currentColor",
320
+ spacing: "spacious",
293
321
  label: formatMessage(messages.clearCells, {
294
322
  0: Math.max(noOfColumns, noOfRows)
295
- })
323
+ }),
324
+ LEGACY_fallbackIcon: CrossCircleIcon
296
325
  })) : undefined,
297
326
  'aria-label': fg('platform_editor_announce_cell_options_hotkeys') ? tooltip(backspace, String(content)) : undefined
298
327
  };
@@ -320,14 +349,15 @@ export class ContextualMenu extends Component {
320
349
  value: {
321
350
  name: 'delete_column'
322
351
  },
323
- elemBefore: isDragAndDropEnabled ?
324
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
325
- jsx("span", {
326
- css: elementBeforeIconStyles
327
- }, jsx(RemoveIcon, {
352
+ elemBefore: isDragAndDropEnabled ? jsx(Box, {
353
+ xcss: elementBeforeIconStyles
354
+ }, jsx(TableColumnDeleteIcon, {
355
+ color: "currentColor",
356
+ spacing: "spacious",
328
357
  label: formatMessage(messages.removeColumns, {
329
358
  0: noOfColumns
330
- })
359
+ }),
360
+ LEGACY_fallbackIcon: RemoveIcon
331
361
  })) : undefined
332
362
  };
333
363
  });
@@ -354,14 +384,15 @@ export class ContextualMenu extends Component {
354
384
  value: {
355
385
  name: 'delete_row'
356
386
  },
357
- elemBefore: isDragAndDropEnabled ?
358
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
359
- jsx("span", {
360
- css: elementBeforeIconStyles
361
- }, jsx(RemoveIcon, {
387
+ elemBefore: isDragAndDropEnabled ? jsx(Box, {
388
+ xcss: elementBeforeIconStyles
389
+ }, jsx(TableRowDeleteIcon, {
390
+ color: "currentColor",
391
+ spacing: "spacious",
362
392
  label: formatMessage(messages.removeRows, {
363
393
  0: noOfRows
364
- })
394
+ }),
395
+ LEGACY_fallbackIcon: RemoveIcon
365
396
  })) : undefined
366
397
  };
367
398
  });
@@ -10,15 +10,6 @@ export const cellColourPreviewStyles = selectedColor => css({
10
10
  background: selectedColor
11
11
  }
12
12
  });
13
-
14
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
15
- export const elementBeforeIconStyles = css({
16
- marginRight: "var(--ds-space-negative-075, -6px)",
17
- display: 'flex'
18
- });
19
-
20
- // TODO Delete this comment after verifying space token -> previous value `padding: 8px`
21
- // TODO Delete this comment after verifying space token -> previous value `margin-left: 4px`
22
13
  export const tablePopupStyles = (isDragAndDropEnabled
23
14
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
24
15
  ) => css`
@@ -20,7 +20,9 @@ import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
20
20
  import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
21
21
  import { TableMap } from '@atlaskit/editor-tables/table-map';
22
22
  import { findCellRectClosestToPos, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
23
- import EditorBackgroundColorIcon from '@atlaskit/icon/glyph/editor/background-color';
23
+ import EditorBackgroundColorIcon from '@atlaskit/icon/core/migration/paint-bucket--editor-background-color';
24
+ import PaintBucketIcon from '@atlaskit/icon/core/paint-bucket';
25
+ import { Box, xcss } from '@atlaskit/primitives';
24
26
  import Toggle from '@atlaskit/toggle';
25
27
  import { clearHoverSelection, hoverColumns, hoverRows } from '../../commands';
26
28
  import { setColorWithAnalytics, toggleHeaderColumnWithAnalytics, toggleHeaderRowWithAnalytics, toggleNumberColumnWithAnalytics } from '../../commands-with-analytics';
@@ -32,7 +34,7 @@ import { checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColum
32
34
  import { getDragMenuConfig } from '../../utils/drag-menu';
33
35
  import { colorPalletteColumns } from '../consts';
34
36
  import { DropdownMenu } from './DropdownMenu';
35
- import { cellColourPreviewStyles, dragMenuBackgroundColorStyles, elementBeforeIconStyles, toggleStyles } from './styles';
37
+ import { cellColourPreviewStyles, dragMenuBackgroundColorStyles, toggleStyles } from './styles';
36
38
  const MapDragMenuOptionIdToMessage = {
37
39
  add_row_above: {
38
40
  message: messages.addRowAbove,
@@ -97,6 +99,10 @@ const getGroupedDragMenuConfig = tableSortColumnReorder => {
97
99
  tableSortColumnReorder ? groupedDragMenuConfig.unshift(sortColumnItems) : groupedDragMenuConfig.push(sortColumnItems);
98
100
  return groupedDragMenuConfig;
99
101
  };
102
+ const elementBeforeIconStyles = xcss({
103
+ marginRight: 'space.negative.075',
104
+ display: 'flex'
105
+ });
100
106
  const convertToDropdownItems = (dragMenuConfig, formatMessage, tableSortColumnReorder = false, selectionRect) => {
101
107
  const groupedDragMenuConfig = getGroupedDragMenuConfig(tableSortColumnReorder);
102
108
  let menuItemsArr = [...Array(groupedDragMenuConfig.length)].map(() => []);
@@ -144,12 +150,13 @@ const convertToDropdownItems = (dragMenuConfig, formatMessage, tableSortColumnRe
144
150
  name: item.id
145
151
  },
146
152
  isDisabled: item.disabled,
147
- elemBefore: item.icon ?
148
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
149
- jsx("span", {
150
- css: elementBeforeIconStyles
153
+ elemBefore: item.icon ? jsx(Box, {
154
+ xcss: elementBeforeIconStyles
151
155
  }, jsx(item.icon, {
152
- label: formatMessage(MapDragMenuOptionIdToMessage[item.id].message, options)
156
+ color: "currentColor",
157
+ spacing: "spacious",
158
+ label: formatMessage(MapDragMenuOptionIdToMessage[item.id].message, options),
159
+ LEGACY_fallbackIcon: item.iconFallback ? item.iconFallback : undefined
153
160
  })) : undefined,
154
161
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
155
162
  elemAfter: item.keymap ? jsx("div", {
@@ -256,13 +263,13 @@ const DragMenu = /*#__PURE__*/React.memo(({
256
263
  value: {
257
264
  name: 'background'
258
265
  },
259
- elemBefore:
260
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
261
- jsx("span", {
262
- css: elementBeforeIconStyles
263
- }, jsx(EditorBackgroundColorIcon, {
266
+ elemBefore: jsx(Box, {
267
+ xcss: elementBeforeIconStyles
268
+ }, jsx(PaintBucketIcon, {
269
+ color: "currentColor",
270
+ spacing: "spacious",
264
271
  label: formatMessage(messages.backgroundColor),
265
- size: "medium"
272
+ LEGACY_fallbackIcon: EditorBackgroundColorIcon
266
273
  })),
267
274
  elemAfter: jsx("div", {
268
275
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
@@ -11,12 +11,6 @@ export const cellColourPreviewStyles = selectedColor => css({
11
11
  }
12
12
  });
13
13
 
14
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
15
- export const elementBeforeIconStyles = css({
16
- marginRight: "var(--ds-space-negative-075, -6px)",
17
- display: 'flex'
18
- });
19
-
20
14
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
21
15
  export const dragMenuBackgroundColorStyles = (tableSortColumnReorder = false) => css`
22
16
  .${ClassName.DRAG_SUBMENU} {
@@ -1,6 +1,20 @@
1
1
  import { TableSortOrder as SortOrder } from '@atlaskit/custom-steps';
2
2
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import { addColumnAfter, addColumnBefore, addRowAfter, addRowBefore, backspace, deleteColumn, deleteRow, moveColumnLeft, moveColumnRight, moveRowDown, moveRowUp, tooltip } from '@atlaskit/editor-common/keymaps';
4
+ import SortAscendingIcon from '@atlaskit/icon/core/sort-ascending';
5
+ import SortDescendingIcon from '@atlaskit/icon/core/sort-descending';
6
+ import TableCellClearIcon from '@atlaskit/icon/core/table-cell-clear';
7
+ import TableColumnAddLeftIcon from '@atlaskit/icon/core/table-column-add-left';
8
+ import TableColumnAddRightIcon from '@atlaskit/icon/core/table-column-add-right';
9
+ import TableColumnDeleteIcon from '@atlaskit/icon/core/table-column-delete';
10
+ import TableColumnMoveLeftIcon from '@atlaskit/icon/core/table-column-move-left';
11
+ import TableColumnMoveRightIcon from '@atlaskit/icon/core/table-column-move-right';
12
+ import TableColumnsDistributeIcon from '@atlaskit/icon/core/table-columns-distribute';
13
+ import TableRowAddAboveIcon from '@atlaskit/icon/core/table-row-add-above';
14
+ import TableRowAddBelowIcon from '@atlaskit/icon/core/table-row-add-below';
15
+ import TableRowDeleteIcon from '@atlaskit/icon/core/table-row-delete';
16
+ import TableRowMoveDownIcon from '@atlaskit/icon/core/table-row-move-down';
17
+ import TableRowMoveUpIcon from '@atlaskit/icon/core/table-row-move-up';
4
18
  import ArrowDownIcon from '@atlaskit/icon/glyph/arrow-down';
5
19
  import ArrowLeftIcon from '@atlaskit/icon/glyph/arrow-left';
6
20
  import ArrowRightIcon from '@atlaskit/icon/glyph/arrow-right';
@@ -69,48 +83,56 @@ export const getDragMenuConfig = (direction, getEditorContainerWidth, hasMergedC
69
83
  const addOptions = direction === 'row' ? [{
70
84
  label: 'above',
71
85
  offset: 0,
72
- icon: AddRowAboveIcon,
86
+ icon: TableRowAddAboveIcon,
87
+ iconFallback: AddRowAboveIcon,
73
88
  keymap: addRowBefore
74
89
  }, {
75
90
  label: 'below',
76
91
  offset: 1,
77
- icon: AddRowBelowIcon,
92
+ icon: TableRowAddBelowIcon,
93
+ iconFallback: AddRowBelowIcon,
78
94
  keymap: addRowAfter
79
95
  }] : [{
80
96
  label: 'left',
81
97
  offset: 0,
82
- icon: AddColLeftIcon,
98
+ icon: TableColumnAddLeftIcon,
99
+ iconFallback: AddColLeftIcon,
83
100
  keymap: addColumnBefore
84
101
  }, {
85
102
  label: 'right',
86
103
  offset: 1,
87
- icon: AddColRightIcon,
104
+ icon: TableColumnAddRightIcon,
105
+ iconFallback: AddColRightIcon,
88
106
  keymap: addColumnAfter
89
107
  }];
90
108
  const moveOptions = direction === 'row' ? [{
91
109
  label: 'up',
92
- icon: ArrowUpIcon,
110
+ icon: TableRowMoveUpIcon,
111
+ iconFallback: ArrowUpIcon,
93
112
  keymap: moveRowUp,
94
113
  canMove: canMove('table-row', -1, (_tableMap$height = tableMap === null || tableMap === void 0 ? void 0 : tableMap.height) !== null && _tableMap$height !== void 0 ? _tableMap$height : 0, selection, selectionRect),
95
114
  getOriginIndexes: getSelectedRowIndexes,
96
115
  getTargetIndex: selectionRect => selectionRect.top - 1
97
116
  }, {
98
117
  label: 'down',
99
- icon: ArrowDownIcon,
118
+ icon: TableRowMoveDownIcon,
119
+ iconFallback: ArrowDownIcon,
100
120
  keymap: moveRowDown,
101
121
  canMove: canMove('table-row', 1, (_tableMap$height2 = tableMap === null || tableMap === void 0 ? void 0 : tableMap.height) !== null && _tableMap$height2 !== void 0 ? _tableMap$height2 : 0, selection, selectionRect),
102
122
  getOriginIndexes: getSelectedRowIndexes,
103
123
  getTargetIndex: selectionRect => selectionRect.bottom
104
124
  }] : [{
105
125
  label: 'left',
106
- icon: ArrowLeftIcon,
126
+ icon: TableColumnMoveLeftIcon,
127
+ iconFallback: ArrowLeftIcon,
107
128
  keymap: moveColumnLeft,
108
129
  canMove: canMove('table-column', -1, (_tableMap$width = tableMap === null || tableMap === void 0 ? void 0 : tableMap.width) !== null && _tableMap$width !== void 0 ? _tableMap$width : 0, selection, selectionRect),
109
130
  getOriginIndexes: getSelectedColumnIndexes,
110
131
  getTargetIndex: selectionRect => selectionRect.left - 1
111
132
  }, {
112
133
  label: 'right',
113
- icon: ArrowRightIcon,
134
+ icon: TableColumnMoveRightIcon,
135
+ iconFallback: ArrowRightIcon,
114
136
  keymap: moveColumnRight,
115
137
  canMove: canMove('table-column', 1, (_tableMap$width2 = tableMap === null || tableMap === void 0 ? void 0 : tableMap.width) !== null && _tableMap$width2 !== void 0 ? _tableMap$width2 : 0, selection, selectionRect),
116
138
  getOriginIndexes: getSelectedColumnIndexes,
@@ -119,21 +141,25 @@ export const getDragMenuConfig = (direction, getEditorContainerWidth, hasMergedC
119
141
  const sortOptions = direction === 'column' ? [{
120
142
  label: 'increasing',
121
143
  order: SortOrder.ASC,
122
- icon: HipchatChevronDoubleUpIcon
144
+ icon: SortAscendingIcon,
145
+ iconFallback: HipchatChevronDoubleUpIcon
123
146
  }, {
124
147
  label: 'decreasing',
125
148
  order: SortOrder.DESC,
126
- icon: HipchatChevronDoubleDownIcon
149
+ icon: SortDescendingIcon,
150
+ iconFallback: HipchatChevronDoubleDownIcon
127
151
  }] : [];
128
152
  const sortConfigs = [...sortOptions.map(({
129
153
  label,
130
154
  order,
131
- icon
155
+ icon,
156
+ iconFallback
132
157
  }) => ({
133
158
  id: `sort_column_${order}`,
134
159
  title: `Sort ${label}`,
135
160
  disabled: hasMergedCellsInTable,
136
- icon,
161
+ icon: icon,
162
+ iconFallback: iconFallback,
137
163
  onClick: (state, dispatch) => {
138
164
  sortColumnWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.TABLE_CONTEXT_MENU, index !== null && index !== void 0 ? index : 0, order)(state, dispatch);
139
165
  return true;
@@ -143,11 +169,13 @@ export const getDragMenuConfig = (direction, getEditorContainerWidth, hasMergedC
143
169
  label,
144
170
  offset,
145
171
  icon,
172
+ iconFallback,
146
173
  keymap
147
174
  }) => ({
148
175
  id: `add_${direction}_${label}`,
149
176
  title: `Add ${direction} ${label}`,
150
- icon,
177
+ icon: icon,
178
+ iconFallback: iconFallback,
151
179
  onClick: (state, dispatch) => {
152
180
  if (direction === 'row') {
153
181
  insertRowWithAnalytics(editorAnalyticsAPI, tableDuplicateCellColouring)(INPUT_METHOD.TABLE_CONTEXT_MENU, {
@@ -176,7 +204,8 @@ export const getDragMenuConfig = (direction, getEditorContainerWidth, hasMergedC
176
204
  }
177
205
  return false;
178
206
  },
179
- icon: EditorLayoutThreeEqualIcon
207
+ icon: TableColumnsDistributeIcon,
208
+ iconFallback: EditorLayoutThreeEqualIcon
180
209
  } : undefined, {
181
210
  id: 'clear_cells',
182
211
  title: 'Clear cells',
@@ -184,7 +213,8 @@ export const getDragMenuConfig = (direction, getEditorContainerWidth, hasMergedC
184
213
  emptyMultipleCellsWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.TABLE_CONTEXT_MENU, targetCellPosition)(state, dispatch);
185
214
  return true;
186
215
  },
187
- icon: CrossCircleIcon,
216
+ icon: TableCellClearIcon,
217
+ iconFallback: CrossCircleIcon,
188
218
  keymap: tooltip(backspace)
189
219
  }, {
190
220
  id: `delete_${direction}`,
@@ -197,12 +227,14 @@ export const getDragMenuConfig = (direction, getEditorContainerWidth, hasMergedC
197
227
  }
198
228
  return true;
199
229
  },
200
- icon: RemoveIcon,
230
+ icon: direction === 'row' ? TableRowDeleteIcon : TableColumnDeleteIcon,
231
+ iconFallback: RemoveIcon,
201
232
  keymap: direction === 'row' ? tooltip(deleteRow) : tooltip(deleteColumn)
202
233
  }, ...moveOptions.map(({
203
234
  label,
204
235
  canMove,
205
236
  icon,
237
+ iconFallback,
206
238
  keymap,
207
239
  getOriginIndexes,
208
240
  getTargetIndex
@@ -210,7 +242,8 @@ export const getDragMenuConfig = (direction, getEditorContainerWidth, hasMergedC
210
242
  id: `move_${direction}_${label}`,
211
243
  title: `Move ${direction} ${label}`,
212
244
  disabled: !canMove,
213
- icon,
245
+ icon: icon,
246
+ iconFallback: iconFallback,
214
247
  onClick: (state, dispatch) => {
215
248
  if (canMove) {
216
249
  requestAnimationFrame(() => {
@@ -15,7 +15,7 @@ import { Popup } from '@atlaskit/editor-common/ui';
15
15
  import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
16
16
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
17
17
  import { akEditorSmallZIndex } from '@atlaskit/editor-shared-styles';
18
- import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
18
+ import ExpandIcon from '@atlaskit/icon/utility/migration/chevron-down';
19
19
  import { fg } from '@atlaskit/platform-feature-flags';
20
20
  import { toggleContextualMenu } from '../../commands';
21
21
  import { TableCssClassName as ClassName } from '../../types';
@@ -78,6 +78,7 @@ var FloatingContextualButtonInner = /*#__PURE__*/React.memo(function (props) {
78
78
  onClick: handleClick,
79
79
  iconBefore: jsx(ExpandIcon, {
80
80
  label: "",
81
+ color: "currentColor",
81
82
  isFacadeDisabled: true
82
83
  }),
83
84
  "aria-label": labelCellOptions,
@@ -1,11 +1,15 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1
4
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
2
5
  import { css } from '@emotion/react';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
3
7
  import { N0, N20, N30A, N700 } from '@atlaskit/theme/colors';
4
8
  import { contextualMenuTriggerSize } from '../consts';
5
9
  export var tableFloatingCellButtonStyles = function tableFloatingCellButtonStyles() {
6
10
  return css({
7
11
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
8
- '> div': {
12
+ '> div': _objectSpread({
9
13
  // Sits behind button to provide surface-color background
10
14
  background: "var(--ds-surface, ".concat(N20, ")"),
11
15
  borderRadius: "var(--ds-border-radius, 3px)",
@@ -13,7 +17,9 @@ export var tableFloatingCellButtonStyles = function tableFloatingCellButtonStyle
13
17
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
14
18
  height: "".concat(contextualMenuTriggerSize + 2, "px"),
15
19
  flexDirection: 'column'
16
- },
20
+ }, fg('platform-visual-refresh-icons') && {
21
+ width: "var(--ds-space-250, 20px)"
22
+ }),
17
23
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
18
24
  '&& button': {
19
25
  background: "var(--ds-background-neutral, none)",