@atlaskit/editor-plugin-table 28.0.3 → 28.0.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 (46) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/cjs/nodeviews/TableContainer.js +105 -13
  3. package/dist/cjs/ui/DragHandle/index.js +6 -12
  4. package/dist/cjs/ui/TableMenu/column/items/MoveColumnLeftItem.js +1 -4
  5. package/dist/cjs/ui/TableMenu/column/items/MoveColumnRightItem.js +1 -4
  6. package/dist/cjs/ui/TableMenu/column/items/SortDecreasingItem.compiled.css +1 -2
  7. package/dist/cjs/ui/TableMenu/column/items/SortDecreasingItem.js +1 -6
  8. package/dist/cjs/ui/TableMenu/column/items/SortIncreasingItem.compiled.css +1 -2
  9. package/dist/cjs/ui/TableMenu/column/items/SortIncreasingItem.js +1 -6
  10. package/dist/cjs/ui/TableMenu/row/items/MoveRowDownItem.js +1 -4
  11. package/dist/cjs/ui/TableMenu/row/items/MoveRowUpItem.js +1 -4
  12. package/dist/cjs/ui/common-styles.js +2 -4
  13. package/dist/cjs/ui/hooks/useIsTableInLimitedMode.js +20 -0
  14. package/dist/cjs/ui/quick-insert/TableQuickInsertMenuItem.js +5 -2
  15. package/dist/es2019/nodeviews/TableContainer.js +90 -1
  16. package/dist/es2019/ui/DragHandle/index.js +6 -13
  17. package/dist/es2019/ui/TableMenu/column/items/MoveColumnLeftItem.js +1 -4
  18. package/dist/es2019/ui/TableMenu/column/items/MoveColumnRightItem.js +1 -4
  19. package/dist/es2019/ui/TableMenu/column/items/SortDecreasingItem.compiled.css +1 -2
  20. package/dist/es2019/ui/TableMenu/column/items/SortDecreasingItem.js +1 -6
  21. package/dist/es2019/ui/TableMenu/column/items/SortIncreasingItem.compiled.css +1 -2
  22. package/dist/es2019/ui/TableMenu/column/items/SortIncreasingItem.js +1 -6
  23. package/dist/es2019/ui/TableMenu/row/items/MoveRowDownItem.js +1 -4
  24. package/dist/es2019/ui/TableMenu/row/items/MoveRowUpItem.js +1 -4
  25. package/dist/es2019/ui/common-styles.js +8 -6
  26. package/dist/es2019/ui/hooks/useIsTableInLimitedMode.js +14 -0
  27. package/dist/es2019/ui/quick-insert/TableQuickInsertMenuItem.js +4 -2
  28. package/dist/esm/nodeviews/TableContainer.js +106 -14
  29. package/dist/esm/ui/DragHandle/index.js +6 -12
  30. package/dist/esm/ui/TableMenu/column/items/MoveColumnLeftItem.js +1 -4
  31. package/dist/esm/ui/TableMenu/column/items/MoveColumnRightItem.js +1 -4
  32. package/dist/esm/ui/TableMenu/column/items/SortDecreasingItem.compiled.css +1 -2
  33. package/dist/esm/ui/TableMenu/column/items/SortDecreasingItem.js +1 -6
  34. package/dist/esm/ui/TableMenu/column/items/SortIncreasingItem.compiled.css +1 -2
  35. package/dist/esm/ui/TableMenu/column/items/SortIncreasingItem.js +1 -6
  36. package/dist/esm/ui/TableMenu/row/items/MoveRowDownItem.js +1 -4
  37. package/dist/esm/ui/TableMenu/row/items/MoveRowUpItem.js +1 -4
  38. package/dist/esm/ui/common-styles.js +2 -4
  39. package/dist/esm/ui/hooks/useIsTableInLimitedMode.js +14 -0
  40. package/dist/esm/ui/quick-insert/TableQuickInsertMenuItem.js +4 -2
  41. package/dist/types/ui/hooks/useIsTableInLimitedMode.d.ts +8 -0
  42. package/package.json +5 -8
  43. package/dist/cjs/pm-plugins/utils/limited-mode.js +0 -21
  44. package/dist/es2019/pm-plugins/utils/limited-mode.js +0 -14
  45. package/dist/esm/pm-plugins/utils/limited-mode.js +0 -16
  46. package/dist/types/pm-plugins/utils/limited-mode.d.ts +0 -12
@@ -10,7 +10,6 @@ import { TableRowMoveUpIcon } from '@atlaskit/editor-toolbar/row-move-up-icon';
10
10
  import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar/toolbar-dropdown-item';
11
11
  import { ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar/toolbar-keyboard-shortcut-hint';
12
12
  import { Text } from '@atlaskit/primitives/compiled';
13
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
14
13
  import Tooltip from '@atlaskit/tooltip/Tooltip';
15
14
  import { closeActiveTableMenu } from '../../../../pm-plugins/commands';
16
15
  import { moveSourceWithAnalytics } from '../../../../pm-plugins/drag-and-drop/commands-with-analytics';
@@ -59,9 +58,7 @@ export const MoveRowUpItem = props => {
59
58
  const label = formatMessage(messages.moveRowUp, {
60
59
  0: selectedRowCount
61
60
  });
62
- const canMove = Boolean(tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.canMoveRowUp);
63
- const isMoveDisabled = expValEquals('platform_editor_table_menu_updates_patch_2', 'isEnabled', true) && !canMove;
64
- if (isMoveDisabled) {
61
+ if (!Boolean(tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.canMoveRowUp)) {
65
62
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
66
63
  elemBefore: /*#__PURE__*/React.createElement(TableRowMoveUpIcon, {
67
64
  color: "var(--ds-text-disabled, #080F214A)",
@@ -12,7 +12,6 @@ import { akEditorSelectedNodeClassName, akEditorSmallZIndex, akEditorStickyHeade
12
12
  import { akEditorTableContainerBg } from '@atlaskit/editor-shared-styles/consts';
13
13
  import { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
14
14
  import { hideNativeBrowserTextSelectionStyles } from '@atlaskit/editor-shared-styles/selection';
15
- import { fg } from '@atlaskit/platform-feature-flags/fg';
16
15
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
17
16
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
18
17
  import { SORTING_ICON_CLASS_NAME } from '../pm-plugins/view-mode-sort/consts';
@@ -432,11 +431,14 @@ expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? rangeS
432
431
  );
433
432
  z-index: ${rowControlsZIndex + 5};
434
433
  }
435
- ${fg('platform_editor_col_insert_patch_1') ?
436
- // Shift the mask left by the numbered column width so it sits to the left of it.
437
- `.${ClassName.TABLE_CONTAINER}.${ClassName.TABLE_STICKY}[data-number-column='true']:has(tr.sticky)::before {
438
- transform: translateX(calc(-1 * (${DRAG_HANDLE_WIDTH}px + ${"var(--ds-space-150, 12px)"} + ${akEditorTableNumberColumnWidth}px)));
439
- }` : ``}
434
+ /* Shift the mask left by the numbered column width so it sits to the left of it. */
435
+ .${ClassName.TABLE_CONTAINER}.${ClassName.TABLE_STICKY}[data-number-column='true']:has(tr.sticky)::before {
436
+ transform: translateX(
437
+ calc(
438
+ -1 * (${DRAG_HANDLE_WIDTH}px + ${"var(--ds-space-150, 12px)"} + ${akEditorTableNumberColumnWidth}px)
439
+ )
440
+ );
441
+ }
440
442
 
441
443
  /* To fix jumpiness caused in Chrome Browsers for sticky headers */
442
444
  .${ClassName.TABLE_STICKY} .sticky + tr {
@@ -0,0 +1,14 @@
1
+ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
2
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
3
+ /**
4
+ * Limited mode strips expensive behaviour on very large documents. For tables that means dragging
5
+ * rows and columns is turned off, and so is resizing the table as a whole. Column resizing is left
6
+ * alone — only the whole-table resizer goes away.
7
+ */
8
+ export const useIsTableInLimitedMode = (api, editorView) => {
9
+ const enabled = useSharedPluginStateWithSelector(api, ['limitedMode'], states => {
10
+ var _states$limitedModeSt;
11
+ return !!((_states$limitedModeSt = states.limitedModeState) !== null && _states$limitedModeSt !== void 0 && _states$limitedModeSt.enabled);
12
+ });
13
+ return enabled && isExperimentEnabled('platform_editor_table_limited_mode');
14
+ };
@@ -1,9 +1,9 @@
1
1
  import React, { useCallback } from 'react';
2
2
  import { useIntl } from 'react-intl';
3
- import { IconTable } from '@atlaskit/editor-common/icons';
4
3
  import { toggleTable, tooltip } from '@atlaskit/editor-common/keymaps';
5
4
  import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
6
5
  import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
6
+ import GridIcon from '@atlaskit/icon/core/grid';
7
7
  import { insertTableFromQuickInsert } from './insertTableFromQuickInsert';
8
8
  export const TableQuickInsertMenuItem = ({
9
9
  api,
@@ -26,7 +26,9 @@ export const TableQuickInsertMenuItem = ({
26
26
  state: editorView.state
27
27
  }), [api, isTableSelectorEnabled, options]);
28
28
  return /*#__PURE__*/React.createElement(QuickInsertMenuItem, {
29
- iconBefore: /*#__PURE__*/React.createElement(IconTable, null),
29
+ iconBefore: /*#__PURE__*/React.createElement(GridIcon, {
30
+ label: ""
31
+ }),
30
32
  onSelect: onSelect,
31
33
  shortcut: tooltip(toggleTable),
32
34
  title: formatMessage(messages.table)
@@ -5,15 +5,18 @@ import classNames from 'classnames';
5
5
  import { CHANGE_ALIGNMENT_REASON, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
6
6
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
7
7
  import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
8
+ import { resizerHoverZoneClassName, resizerItemClassName } from '@atlaskit/editor-common/styles/resizer';
8
9
  import { akEditorDefaultLayoutWidth, akEditorGutterPaddingDynamic, akEditorGutterPaddingReduced, akEditorFullPageNarrowBreakout, akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
9
10
  import { fg } from '@atlaskit/platform-feature-flags/fg';
10
11
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
11
12
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
12
13
  import { setTableAlignmentWithTableContentWithPosWithAnalytics } from '../pm-plugins/commands/commands-with-analytics';
14
+ import { getResizerMinWidth } from '../pm-plugins/table-resizing/utils/colgroup';
13
15
  import { TABLE_MAX_WIDTH, TABLE_FULL_WIDTH, TABLE_OFFSET_IN_COMMENT_EDITOR, RESIZE_HANDLE_SPACING } from '../pm-plugins/table-resizing/utils/consts';
14
- import { getTableResizerContainerMaxWidthInCSS, getTableResizerContainerForFullPageWidthInCSS } from '../pm-plugins/table-resizing/utils/misc';
16
+ import { getTableResizerContainerMaxWidthInCSS, getTableResizerContainerForFullPageWidthInCSS, getTableResizerItemWidthInCSS } from '../pm-plugins/table-resizing/utils/misc';
15
17
  import { ALIGN_CENTER, ALIGN_START } from '../pm-plugins/utils/alignment';
16
18
  import { TableCssClassName as ClassName } from '../types';
19
+ import { useIsTableInLimitedMode } from '../ui/hooks/useIsTableInLimitedMode';
17
20
  import { getAlignmentStyle } from './table-container-styles';
18
21
  import { TableResizer } from './TableResizer';
19
22
  var InnerContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
@@ -335,29 +338,118 @@ export var ResizableTableContainer = /*#__PURE__*/React.memo(function (_ref4) {
335
338
  node: node
336
339
  }, children))));
337
340
  });
338
- export var TableContainer = function TableContainer(_ref5) {
341
+ /**
342
+ * Stand-in for `ResizableTableContainer`, used when limited mode has disabled resizing the table as
343
+ * a whole. Column resizing is unaffected and keeps working through the cell decorations.
344
+ *
345
+ * It reproduces the same DOM and CSS that `toDOM` renders for a resizable table
346
+ * (`.pm-table-resizer-container` > `.resizer-item` > `.resizer-hover-zone`) so that swapping the
347
+ * nodeView in over the initial ProseMirror render leaves the table exactly where it was — and so
348
+ * that the column resize handles still find the elements they measure against — but it mounts no
349
+ * `TableResizer`, so there is no `re-resizable` instance, no table width handle, no handle tooltip,
350
+ * no `clientHeight` read for the handle size and no per-table subscription to the interaction and
351
+ * table shared states.
352
+ *
353
+ * Every width here comes from the same pure-CSS helpers `toDOM` uses, so unlike
354
+ * `ResizableTableContainer` it needs no measured container width and does no layout maths.
355
+ */
356
+ var StaticTableContainer = function StaticTableContainer(_ref5) {
339
357
  var children = _ref5.children,
340
- node = _ref5.node,
341
358
  className = _ref5.className,
342
- _ref5$containerWidth = _ref5.containerWidth,
343
- editorWidth = _ref5$containerWidth.width,
344
- lineLength = _ref5$containerWidth.lineLength,
359
+ node = _ref5.node,
345
360
  editorView = _ref5.editorView,
346
361
  getPos = _ref5.getPos,
347
- tableRef = _ref5.tableRef,
348
- isNested = _ref5.isNested,
349
- tableWrapperHeight = _ref5.tableWrapperHeight,
350
- isResizing = _ref5.isResizing,
351
362
  pluginInjectionApi = _ref5.pluginInjectionApi,
352
- isWholeTableInDanger = _ref5.isWholeTableInDanger,
353
- isTableResizingEnabled = _ref5.isTableResizingEnabled,
354
363
  isTableScalingEnabled = _ref5.isTableScalingEnabled,
355
- allowFixedColumnWidthOption = _ref5.allowFixedColumnWidthOption,
356
364
  isTableAlignmentEnabled = _ref5.isTableAlignmentEnabled,
357
- shouldUseIncreasedScalingPercent = _ref5.shouldUseIncreasedScalingPercent,
358
365
  isCommentEditor = _ref5.isCommentEditor,
359
366
  isChromelessEditor = _ref5.isChromelessEditor;
367
+ var isFullPageAppearance = !isCommentEditor && !isChromelessEditor;
368
+ var containerStyle = useMemo(function () {
369
+ return {
370
+ '--ak-editor-table-gutter-padding': 'calc(var(--ak-editor--large-gutter-padding) * 2)',
371
+ '--ak-editor-table-width': isFullPageAppearance ? getTableResizerContainerForFullPageWidthInCSS(node, isTableScalingEnabled) : "calc(100cqw - calc(var(--ak-editor--large-gutter-padding) * 2))",
372
+ width: 'var(--ak-editor-table-width)'
373
+ };
374
+ }, [node, isTableScalingEnabled, isFullPageAppearance]);
375
+ var itemStyle = useMemo(function () {
376
+ return {
377
+ position: 'relative',
378
+ boxSizing: 'border-box',
379
+ minWidth: "".concat(getResizerMinWidth(node), "px"),
380
+ maxWidth: getTableResizerContainerMaxWidthInCSS(isCommentEditor, isChromelessEditor, isTableScalingEnabled),
381
+ width: getTableResizerItemWidthInCSS(node, isCommentEditor, isChromelessEditor)
382
+ };
383
+ }, [node, isCommentEditor, isChromelessEditor, isTableScalingEnabled]);
384
+ return /*#__PURE__*/React.createElement(AlignmentTableContainerWrapper, {
385
+ isTableAlignmentEnabled: isTableAlignmentEnabled,
386
+ node: node,
387
+ pluginInjectionApi: pluginInjectionApi,
388
+ getPos: getPos,
389
+ editorView: editorView
390
+ }, /*#__PURE__*/React.createElement("div", {
391
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
392
+ className: ClassName.TABLE_RESIZER_CONTAINER
393
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
394
+ ,
395
+ style: containerStyle
396
+ }, /*#__PURE__*/React.createElement("div", {
397
+ // `display-handle` carries no handle to show here, but it keeps this element matching both
398
+ // `toDOM` and the `.resizer-item.display-handle` lookup in `measureTableWithAutoLayout`.
399
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
400
+ className: classNames(resizerItemClassName, 'display-handle')
401
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
402
+ ,
403
+ style: itemStyle
404
+ }, /*#__PURE__*/React.createElement("span", {
405
+ className: resizerHoverZoneClassName
406
+ }, /*#__PURE__*/React.createElement(InnerContainer
407
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
408
+ , {
409
+ className: className,
410
+ node: node
411
+ }, children)))));
412
+ };
413
+ export var TableContainer = function TableContainer(_ref6) {
414
+ var children = _ref6.children,
415
+ node = _ref6.node,
416
+ className = _ref6.className,
417
+ _ref6$containerWidth = _ref6.containerWidth,
418
+ editorWidth = _ref6$containerWidth.width,
419
+ lineLength = _ref6$containerWidth.lineLength,
420
+ editorView = _ref6.editorView,
421
+ getPos = _ref6.getPos,
422
+ tableRef = _ref6.tableRef,
423
+ isNested = _ref6.isNested,
424
+ tableWrapperHeight = _ref6.tableWrapperHeight,
425
+ isResizing = _ref6.isResizing,
426
+ pluginInjectionApi = _ref6.pluginInjectionApi,
427
+ isWholeTableInDanger = _ref6.isWholeTableInDanger,
428
+ isTableResizingEnabled = _ref6.isTableResizingEnabled,
429
+ isTableScalingEnabled = _ref6.isTableScalingEnabled,
430
+ allowFixedColumnWidthOption = _ref6.allowFixedColumnWidthOption,
431
+ isTableAlignmentEnabled = _ref6.isTableAlignmentEnabled,
432
+ shouldUseIncreasedScalingPercent = _ref6.shouldUseIncreasedScalingPercent,
433
+ isCommentEditor = _ref6.isCommentEditor,
434
+ isChromelessEditor = _ref6.isChromelessEditor;
435
+ // Limited mode drops the whole-table resizer only; column resizing is untouched.
436
+ var isTableWidthResizingDisabled = useIsTableInLimitedMode(pluginInjectionApi, editorView);
360
437
  if (isTableResizingEnabled && !isNested) {
438
+ if (isTableWidthResizingDisabled) {
439
+ return /*#__PURE__*/React.createElement(StaticTableContainer
440
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
441
+ , {
442
+ className: className,
443
+ node: node,
444
+ editorView: editorView,
445
+ getPos: getPos,
446
+ pluginInjectionApi: pluginInjectionApi,
447
+ isTableScalingEnabled: isTableScalingEnabled,
448
+ isTableAlignmentEnabled: isTableAlignmentEnabled,
449
+ isCommentEditor: isCommentEditor,
450
+ isChromelessEditor: isChromelessEditor
451
+ }, children);
452
+ }
361
453
  return /*#__PURE__*/React.createElement(ResizableTableContainer
362
454
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
363
455
  , {
@@ -7,7 +7,6 @@ import classnames from 'classnames';
7
7
  import ReactDOM from 'react-dom';
8
8
  import { injectIntl } from 'react-intl';
9
9
  import { getBrowserInfo } from '@atlaskit/editor-common/browser';
10
- import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
11
10
  import { tableMessages as messages } from '@atlaskit/editor-common/messages';
12
11
  import { TextSelection } from '@atlaskit/editor-prosemirror/state';
13
12
  import { findTable, TableMap } from '@atlaskit/editor-tables';
@@ -17,11 +16,11 @@ import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/ut
17
16
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
18
17
  import { closeActiveTableMenu } from '../../pm-plugins/commands/active-table-menu';
19
18
  import { getPluginState as getDnDPluginState } from '../../pm-plugins/drag-and-drop/plugin-factory';
20
- import { isDragAndDropDisabledInLimitedMode } from '../../pm-plugins/utils/limited-mode';
21
19
  import { findDuplicatePosition, hasMergedCellsInSelection } from '../../pm-plugins/utils/merged-cells';
22
20
  import { TableCssClassName as ClassName } from '../../types';
23
21
  import { dragTableInsertColumnButtonSize } from '../consts';
24
22
  import { DragPreview } from '../DragPreview';
23
+ import { useIsTableInLimitedMode } from '../hooks/useIsTableInLimitedMode';
25
24
  import { HandleIconComponent } from './HandleIconComponent';
26
25
  var DragHandleComponent = function DragHandleComponent(_ref) {
27
26
  var api = _ref.api,
@@ -61,16 +60,11 @@ var DragHandleComponent = function DragHandleComponent(_ref) {
61
60
  setIsHovered = _useState4[1];
62
61
 
63
62
  // Limited mode disables dragging rows and columns, but the handle itself keeps working as the
64
- // selection and menu affordance. Subscribing here (rather than reading the plugin state once) means
65
- // the effect below re-runs and un-registers the draggable if limited mode flips mid-session.
66
- var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['limitedMode'], function (states) {
67
- var _states$limitedModeSt;
68
- return {
69
- limitedModeEnabled: (_states$limitedModeSt = states.limitedModeState) === null || _states$limitedModeSt === void 0 ? void 0 : _states$limitedModeSt.enabled
70
- };
71
- }),
72
- limitedModeEnabled = _useSharedPluginState.limitedModeEnabled;
73
- var isDraggingEnabled = !isDragAndDropDisabledInLimitedMode(limitedModeEnabled);
63
+ // selection and menu affordance. The hook subscribes to limited mode (rather than reading the
64
+ // plugin state once) so the effect below re-runs and un-registers the draggable if limited mode
65
+ // flips mid-session.
66
+ var isInLimitedMode = useIsTableInLimitedMode(api, editorView);
67
+ var isDraggingEnabled = !isInLimitedMode;
74
68
  var isRow = direction === 'row';
75
69
  var isColumn = direction === 'column';
76
70
  var hasMergedCells = useMemo(function () {
@@ -10,7 +10,6 @@ import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar/toolbar-dropdown-i
10
10
  import { ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar/toolbar-keyboard-shortcut-hint';
11
11
  import TableColumnMoveLeftIcon from '@atlaskit/icon/core/table-column-move-left';
12
12
  import { Text } from '@atlaskit/primitives/compiled';
13
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
14
13
  import Tooltip from '@atlaskit/tooltip/Tooltip';
15
14
  import { closeActiveTableMenu } from '../../../../pm-plugins/commands';
16
15
  import { moveSourceWithAnalytics } from '../../../../pm-plugins/drag-and-drop/commands-with-analytics';
@@ -56,9 +55,7 @@ export var MoveColumnLeftItem = function MoveColumnLeftItem(props) {
56
55
  var label = formatMessage(messages.moveColumnLeft, {
57
56
  0: selectedColumnCount
58
57
  });
59
- var canMove = Boolean(tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.canMoveColumnLeft);
60
- var isMoveDisabled = expValEquals('platform_editor_table_menu_updates_patch_2', 'isEnabled', true) && !canMove;
61
- if (isMoveDisabled) {
58
+ if (!Boolean(tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.canMoveColumnLeft)) {
62
59
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
63
60
  elemBefore: /*#__PURE__*/React.createElement(TableColumnMoveLeftIcon, {
64
61
  color: "var(--ds-text-disabled, #080F214A)",
@@ -10,7 +10,6 @@ import { InformationCircleIcon } from '@atlaskit/editor-toolbar/information-circ
10
10
  import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar/toolbar-dropdown-item';
11
11
  import { ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar/toolbar-keyboard-shortcut-hint';
12
12
  import { Text } from '@atlaskit/primitives/compiled';
13
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
14
13
  import Tooltip from '@atlaskit/tooltip/Tooltip';
15
14
  import { closeActiveTableMenu } from '../../../../pm-plugins/commands';
16
15
  import { moveSourceWithAnalytics } from '../../../../pm-plugins/drag-and-drop/commands-with-analytics';
@@ -56,9 +55,7 @@ export var MoveColumnRightItem = function MoveColumnRightItem(props) {
56
55
  var label = formatMessage(messages.moveColumnRight, {
57
56
  0: selectedColumnCount
58
57
  });
59
- var canMove = Boolean(tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.canMoveColumnRight);
60
- var isMoveDisabled = expValEquals('platform_editor_table_menu_updates_patch_2', 'isEnabled', true) && !canMove;
61
- if (isMoveDisabled) {
58
+ if (!Boolean(tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.canMoveColumnRight)) {
62
59
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
63
60
  elemBefore: /*#__PURE__*/React.createElement(TableColumnMoveRightIcon, {
64
61
  color: "var(--ds-text-disabled, #080F214A)",
@@ -1,3 +1,2 @@
1
1
  ._1e0c116y{display:inline-flex}
2
- ._4cvr1h6o{align-items:center}
3
- ._syaz1gmx{color:var(--ds-text-disabled,#080f214a)}
2
+ ._4cvr1h6o{align-items:center}
@@ -11,13 +11,11 @@ import { getSelectionRect } from '@atlaskit/editor-tables/utils';
11
11
  import { InformationCircleIcon, SortDescendingIcon, ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
12
12
  import { fg } from '@atlaskit/platform-feature-flags/fg';
13
13
  import { Box, Text } from '@atlaskit/primitives/compiled';
14
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
15
14
  import Tooltip from '@atlaskit/tooltip/Tooltip';
16
15
  import { closeActiveTableMenu } from '../../../../pm-plugins/commands';
17
16
  import { sortColumnWithAnalytics } from '../../../../pm-plugins/commands/commands-with-analytics';
18
17
  import { useTableMenuContext } from '../../shared/TableMenuContext';
19
18
  var styles = {
20
- disabledLabel: "_syaz1gmx",
21
19
  infoIconTrigger: "_1e0c116y _4cvr1h6o"
22
20
  };
23
21
  export var SortDecreasingItem = function SortDecreasingItem(_ref) {
@@ -66,11 +64,8 @@ export var SortDecreasingItem = function SortDecreasingItem(_ref) {
66
64
  color: "var(--ds-icon, #292A2E)"
67
65
  }));
68
66
  })
69
- }, expValEquals('platform_editor_table_menu_updates_patch_2', 'isEnabled', true) ? /*#__PURE__*/React.createElement(Text, {
67
+ }, /*#__PURE__*/React.createElement(Text, {
70
68
  color: "color.text.disabled"
71
- }, formatMessage(messages.sortColumnDecreasing)) : /*#__PURE__*/React.createElement(Box, {
72
- as: "span",
73
- xcss: styles.disabledLabel
74
69
  }, formatMessage(messages.sortColumnDecreasing)));
75
70
  }
76
71
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
@@ -1,3 +1,2 @@
1
1
  ._1e0c116y{display:inline-flex}
2
- ._4cvr1h6o{align-items:center}
3
- ._syaz1gmx{color:var(--ds-text-disabled,#080f214a)}
2
+ ._4cvr1h6o{align-items:center}
@@ -11,13 +11,11 @@ import { getSelectionRect } from '@atlaskit/editor-tables/utils';
11
11
  import { InformationCircleIcon, SortAscendingIcon, ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
12
12
  import { fg } from '@atlaskit/platform-feature-flags/fg';
13
13
  import { Box, Text } from '@atlaskit/primitives/compiled';
14
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
15
14
  import Tooltip from '@atlaskit/tooltip/Tooltip';
16
15
  import { closeActiveTableMenu } from '../../../../pm-plugins/commands';
17
16
  import { sortColumnWithAnalytics } from '../../../../pm-plugins/commands/commands-with-analytics';
18
17
  import { useTableMenuContext } from '../../shared/TableMenuContext';
19
18
  var styles = {
20
- disabledLabel: "_syaz1gmx",
21
19
  infoIconTrigger: "_1e0c116y _4cvr1h6o"
22
20
  };
23
21
  export var SortIncreasingItem = function SortIncreasingItem(_ref) {
@@ -66,11 +64,8 @@ export var SortIncreasingItem = function SortIncreasingItem(_ref) {
66
64
  color: "var(--ds-icon, #292A2E)"
67
65
  }));
68
66
  })
69
- }, expValEquals('platform_editor_table_menu_updates_patch_2', 'isEnabled', true) ? /*#__PURE__*/React.createElement(Text, {
67
+ }, /*#__PURE__*/React.createElement(Text, {
70
68
  color: "color.text.disabled"
71
- }, formatMessage(messages.sortColumnIncreasing)) : /*#__PURE__*/React.createElement(Box, {
72
- as: "span",
73
- xcss: styles.disabledLabel
74
69
  }, formatMessage(messages.sortColumnIncreasing)));
75
70
  }
76
71
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
@@ -10,7 +10,6 @@ import { TableRowMoveDownIcon } from '@atlaskit/editor-toolbar/row-move-down-ico
10
10
  import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar/toolbar-dropdown-item';
11
11
  import { ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar/toolbar-keyboard-shortcut-hint';
12
12
  import { Text } from '@atlaskit/primitives/compiled';
13
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
14
13
  import Tooltip from '@atlaskit/tooltip/Tooltip';
15
14
  import { closeActiveTableMenu } from '../../../../pm-plugins/commands';
16
15
  import { moveSourceWithAnalytics } from '../../../../pm-plugins/drag-and-drop/commands-with-analytics';
@@ -56,9 +55,7 @@ export var MoveRowDownItem = function MoveRowDownItem(props) {
56
55
  var label = formatMessage(messages.moveRowDown, {
57
56
  0: selectedRowCount
58
57
  });
59
- var canMove = Boolean(tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.canMoveRowDown);
60
- var isMoveDisabled = expValEquals('platform_editor_table_menu_updates_patch_2', 'isEnabled', true) && !canMove;
61
- if (isMoveDisabled) {
58
+ if (!Boolean(tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.canMoveRowDown)) {
62
59
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
63
60
  elemBefore: /*#__PURE__*/React.createElement(TableRowMoveDownIcon, {
64
61
  color: "var(--ds-text-disabled, #080F214A)",
@@ -10,7 +10,6 @@ import { TableRowMoveUpIcon } from '@atlaskit/editor-toolbar/row-move-up-icon';
10
10
  import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar/toolbar-dropdown-item';
11
11
  import { ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar/toolbar-keyboard-shortcut-hint';
12
12
  import { Text } from '@atlaskit/primitives/compiled';
13
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
14
13
  import Tooltip from '@atlaskit/tooltip/Tooltip';
15
14
  import { closeActiveTableMenu } from '../../../../pm-plugins/commands';
16
15
  import { moveSourceWithAnalytics } from '../../../../pm-plugins/drag-and-drop/commands-with-analytics';
@@ -56,9 +55,7 @@ export var MoveRowUpItem = function MoveRowUpItem(props) {
56
55
  var label = formatMessage(messages.moveRowUp, {
57
56
  0: selectedRowCount
58
57
  });
59
- var canMove = Boolean(tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.canMoveRowUp);
60
- var isMoveDisabled = expValEquals('platform_editor_table_menu_updates_patch_2', 'isEnabled', true) && !canMove;
61
- if (isMoveDisabled) {
58
+ if (!Boolean(tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.canMoveRowUp)) {
62
59
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
63
60
  elemBefore: /*#__PURE__*/React.createElement(TableRowMoveUpIcon, {
64
61
  color: "var(--ds-text-disabled, #080F214A)",