@atlaskit/editor-plugin-table 7.6.6 → 7.6.8

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 (33) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/afm-cc/tsconfig.json +3 -0
  3. package/dist/cjs/commands/column-resize.js +6 -6
  4. package/dist/cjs/nodeviews/TableComponent.js +4 -3
  5. package/dist/cjs/nodeviews/TableResizer.js +15 -46
  6. package/dist/cjs/pm-plugins/table-selection-keymap.js +2 -4
  7. package/dist/cjs/ui/ui-styles.js +1 -1
  8. package/dist/es2019/commands/column-resize.js +6 -6
  9. package/dist/es2019/nodeviews/TableComponent.js +4 -3
  10. package/dist/es2019/nodeviews/TableResizer.js +15 -43
  11. package/dist/es2019/pm-plugins/table-selection-keymap.js +2 -4
  12. package/dist/es2019/ui/ui-styles.js +5 -7
  13. package/dist/esm/commands/column-resize.js +6 -6
  14. package/dist/esm/nodeviews/TableComponent.js +4 -3
  15. package/dist/esm/nodeviews/TableResizer.js +15 -46
  16. package/dist/esm/pm-plugins/table-selection-keymap.js +2 -4
  17. package/dist/esm/ui/ui-styles.js +2 -2
  18. package/dist/types/plugin.d.ts +2 -0
  19. package/dist/types/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +18 -2
  20. package/dist/types/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +36 -4
  21. package/dist/types/ui/TableFloatingControls/index.d.ts +18 -2
  22. package/dist/types-ts4.5/plugin.d.ts +2 -0
  23. package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +20 -0
  24. package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +40 -0
  25. package/dist/types-ts4.5/ui/TableFloatingControls/index.d.ts +20 -0
  26. package/package.json +5 -10
  27. package/src/commands/column-resize.ts +11 -10
  28. package/src/nodeviews/TableComponent.tsx +3 -6
  29. package/src/nodeviews/TableResizer.tsx +18 -60
  30. package/src/plugin.tsx +2 -0
  31. package/src/pm-plugins/table-selection-keymap.ts +10 -12
  32. package/src/ui/ui-styles.ts +5 -28
  33. package/tsconfig.app.json +3 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 7.6.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [#84955](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84955) [`f5eded0ecb9d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f5eded0ecb9d) - ECA11Y-192: Fix table resize screen reader announcement for NVDA Windows
8
+
9
+ ## 7.6.7
10
+
11
+ ### Patch Changes
12
+
13
+ - [#86408](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/86408) [`6bff86c31d81`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6bff86c31d81) - Clean up feature flag for increasing visibility of table scroll shadows
14
+
3
15
  ## 7.6.6
4
16
 
5
17
  ### Patch Changes
@@ -27,6 +27,9 @@
27
27
  {
28
28
  "path": "../../editor-palette/afm-cc/tsconfig.json"
29
29
  },
30
+ {
31
+ "path": "../../editor-plugin-accessibility-utils/afm-cc/tsconfig.json"
32
+ },
30
33
  {
31
34
  "path": "../../editor-plugin-analytics/afm-cc/tsconfig.json"
32
35
  },
@@ -119,16 +119,16 @@ var activateNextResizeArea = exports.activateNextResizeArea = function activateN
119
119
  var currentCellRect = tableMap.findCell($currentCell.pos - $currentCell.start(-1));
120
120
  var $nextCell = (0, _utils.nextCell)($currentCell, 'horiz', direction);
121
121
  if (ariaNotify && getIntl) {
122
- var columnDirection = '';
123
122
  if (direction === 1) {
124
- columnDirection = getIntl().formatMessage(_messages.tableMessages.columnRightResize);
123
+ ariaNotify(getIntl().formatMessage(_messages.tableMessages.focusedOtherResize, {
124
+ direction: 'right'
125
+ }));
125
126
  }
126
127
  if (direction === -1) {
127
- columnDirection = getIntl().formatMessage(_messages.tableMessages.columnLeftResize);
128
+ ariaNotify(getIntl().formatMessage(_messages.tableMessages.focusedOtherResize, {
129
+ direction: 'left'
130
+ }));
128
131
  }
129
- ariaNotify(getIntl().formatMessage(_messages.tableMessages.focusedOtherResize, {
130
- direction: columnDirection
131
- }));
132
132
  }
133
133
  if ($nextCell) {
134
134
  // we are somewhere in between the side columns of the table
@@ -784,9 +784,10 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
784
784
  }), this.state.stickyHeader && /*#__PURE__*/_react.default.createElement("div", {
785
785
  style: {
786
786
  position: 'absolute',
787
- right: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') ? "".concat((0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.increase-shadow-visibility_lh89r') ? "var(--ds-space-400, 32px)" // tableOverflowShadowWidthWide
788
- : "var(--ds-space-100, 8px)" // tableOverflowShadowWidth
789
- ) : "var(--ds-space-negative-025, -2px)"
787
+ right: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') ? "var(--ds-space-400, 32px)" // tableOverflowShadowWidthWide
788
+ :
789
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
790
+ '22px'
790
791
  }
791
792
  }, /*#__PURE__*/_react.default.createElement("div", {
792
793
  className: "".concat(_types.TableCssClassName.TABLE_RIGHT_SHADOW, " ").concat(_types.TableCssClassName.TABLE_STICKY_SHADOW),
@@ -9,7 +9,6 @@ exports.TableResizer = void 0;
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
11
  var _react = _interopRequireWildcard(require("react"));
12
- var _debounce = _interopRequireDefault(require("lodash/debounce"));
13
12
  var _rafSchd = _interopRequireDefault(require("raf-schd"));
14
13
  var _reactIntlNext = require("react-intl-next");
15
14
  var _analytics = require("@atlaskit/editor-common/analytics");
@@ -33,7 +32,6 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
33
32
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
34
33
  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; }
35
34
  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) { (0, _defineProperty2.default)(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; }
36
- var DEBOUNCE_TIME_FOR_SCREEN_READER_ANNOUNCER = 1000;
37
35
  var RESIZE_STEP_VALUE = 10;
38
36
  var handles = {
39
37
  right: true
@@ -122,26 +120,8 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
122
120
  _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
123
121
  snappingEnabled = _useState4[0],
124
122
  setSnappingEnabled = _useState4[1];
125
-
126
- // we don't want to update aria-live region on each width change, it might provide bad experience for screen reader users
127
- var _useState5 = (0, _react.useState)({
128
- type: 'none',
129
- width: width
130
- }),
131
- _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
132
- screenReaderResizeInformation = _useState6[0],
133
- setScreenReaderResizeInformation = _useState6[1];
134
123
  var _useIntl = (0, _reactIntlNext.useIntl)(),
135
124
  formatMessage = _useIntl.formatMessage;
136
- var screenReaderResizeAnnouncerMessages = {
137
- increase: formatMessage(_messages.tableMessages.tableSizeIncreaseScreenReaderInformation, {
138
- newWidth: screenReaderResizeInformation.width
139
- }),
140
- decrease: formatMessage(_messages.tableMessages.tableSizeDecreaseScreenReaderInformation, {
141
- newWidth: screenReaderResizeInformation.width
142
- }),
143
- none: ''
144
- };
145
125
  var isTableSelected = ((_findTable = (0, _utils2.findTable)((_editorView$state = editorView.state) === null || _editorView$state === void 0 ? void 0 : _editorView$state.selection)) === null || _findTable === void 0 ? void 0 : _findTable.pos) === getPos();
146
126
  var resizerMinWidth = getResizerMinWidth(node);
147
127
  var handleSize = getResizerHandleHeight(tableRef);
@@ -282,6 +262,19 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
282
262
  }
283
263
  displayGapCursor(true);
284
264
  dispatch(tr);
265
+ if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-resizing_uapcv')) {
266
+ if (delta.width < 0) {
267
+ var _pluginInjectionApi$a;
268
+ pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a === void 0 || _pluginInjectionApi$a.actions.ariaNotify(formatMessage(_messages.tableMessages.tableSizeDecreaseScreenReaderInformation, {
269
+ newWidth: newWidth
270
+ }));
271
+ } else if (delta.width > 0) {
272
+ var _pluginInjectionApi$a2;
273
+ pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a2 = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a2 === void 0 || _pluginInjectionApi$a2.actions.ariaNotify(formatMessage(_messages.tableMessages.tableSizeIncreaseScreenReaderInformation, {
274
+ newWidth: newWidth
275
+ }));
276
+ }
277
+ }
285
278
 
286
279
  // Hide guidelines when resizing stops
287
280
  displayGuideline([]);
@@ -291,7 +284,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
291
284
  onResizeStop();
292
285
  }
293
286
  return newWidth;
294
- }, [displayGapCursor, updateWidth, editorView, getPos, node, tableRef, scheduleResize, displayGuideline, attachAnalyticsEvent, endMeasure, onResizeStop, isTableScalingEnabled, widthToWidest]);
287
+ }, [displayGapCursor, updateWidth, editorView, getPos, node, tableRef, scheduleResize, displayGuideline, attachAnalyticsEvent, endMeasure, onResizeStop, isTableScalingEnabled, widthToWidest, formatMessage, pluginInjectionApi]);
295
288
  var handleTableSizeChangeOnKeypress = (0, _react.useCallback)(function (step) {
296
289
  var newWidth = width + step;
297
290
  if (newWidth > maxWidth || newWidth < resizerMinWidth) {
@@ -373,27 +366,6 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
373
366
  (_updateTooltip$curren = updateTooltip.current) === null || _updateTooltip$curren === void 0 || _updateTooltip$curren.call(updateTooltip);
374
367
  }
375
368
  }, [width]);
376
- (0, _react.useEffect)(function () {
377
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-resizing_uapcv')) {
378
- var debouncedSetWidth = (0, _debounce.default)(setScreenReaderResizeInformation, DEBOUNCE_TIME_FOR_SCREEN_READER_ANNOUNCER);
379
- debouncedSetWidth(function (prevState) {
380
- var type = 'none';
381
- if (prevState.width > width) {
382
- type = 'decrease';
383
- }
384
- if (prevState.width < width) {
385
- type = 'increase';
386
- }
387
- return {
388
- type: type,
389
- width: width
390
- };
391
- });
392
- return function () {
393
- debouncedSetWidth.cancel();
394
- };
395
- }
396
- }, [width]);
397
369
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_resizer.ResizerNext, {
398
370
  ref: resizerRef,
399
371
  enable: handles,
@@ -422,8 +394,5 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
422
394
  keymap: _keymaps.focusTableResizer
423
395
  });
424
396
  } : formatMessage(_messages.tableMessages.resizeTable)
425
- }, children), (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-resizing_uapcv') && /*#__PURE__*/_react.default.createElement("div", {
426
- className: "assistive",
427
- role: "status"
428
- }, screenReaderResizeAnnouncerMessages[screenReaderResizeInformation.type]));
397
+ }, children));
429
398
  };
@@ -13,10 +13,8 @@ function tableSelectionKeymapPlugin(editorSelectionAPI) {
13
13
  var list = {};
14
14
  (0, _keymaps.bindKeymapWithCommand)(_keymaps.moveRight.common, (0, _selection.arrowRightFromTable)(editorSelectionAPI)(), list);
15
15
  (0, _keymaps.bindKeymapWithCommand)(_keymaps.moveLeft.common, (0, _selection.arrowLeftFromTable)(editorSelectionAPI)(), list);
16
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y.table-selection_9uv33')) {
17
- (0, _keymaps.bindKeymapArrayWithCommand)(_keymaps.selectColumn, (0, _selection.selectColumns)(editorSelectionAPI)(true), list);
18
- (0, _keymaps.bindKeymapArrayWithCommand)(_keymaps.selectRow, (0, _selection.selectRows)(editorSelectionAPI)(true), list);
19
- }
16
+ (0, _keymaps.bindKeymapArrayWithCommand)(_keymaps.selectColumn, (0, _selection.selectColumns)(editorSelectionAPI)(true), list);
17
+ (0, _keymaps.bindKeymapArrayWithCommand)(_keymaps.selectRow, (0, _selection.selectRows)(editorSelectionAPI)(true), list);
20
18
  if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.shift-arrowup-fix')) {
21
19
  (0, _keymaps.bindKeymapWithCommand)(_keymaps.shiftArrowUp.common, (0, _selection.shiftArrowUpFromTable)(editorSelectionAPI)(), list);
22
20
  }
@@ -73,7 +73,7 @@ var DeleteButton = exports.DeleteButton = function DeleteButton() {
73
73
  return (0, _react.css)(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2.default)(["\n .", ",\n .", " {\n height: ", "px;\n width: ", "px;\n }\n .", " {\n .", " {\n ", "\n }\n }\n\n .", ":hover {\n background: ", ";\n color: ", ";\n cursor: pointer;\n }\n"])), _types.TableCssClassName.CONTROLS_DELETE_BUTTON_WRAP, _types.TableCssClassName.CONTROLS_DELETE_BUTTON, _consts.tableDeleteButtonSize, _consts.tableDeleteButtonSize, _types.TableCssClassName.CONTROLS_DELETE_BUTTON_WRAP, _types.TableCssClassName.CONTROLS_DELETE_BUTTON, Button("\n background: ".concat(_consts.tableCellSelectedDeleteIconBackground, ";\n color: ").concat(_consts.tableCellSelectedDeleteIconColor, ";\n ")), _types.TableCssClassName.CONTROLS_DELETE_BUTTON, _consts.tableCellHoverDeleteIconBackground, _consts.tableCellHoverDeleteIconColor);
74
74
  };
75
75
  var OverflowShadow = exports.OverflowShadow = function OverflowShadow(isDragAndDropEnabled) {
76
- return (0, _react.css)(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n .", ", .", " {\n display: block;\n height: calc(100% - ", "px);\n position: absolute;\n pointer-events: none;\n top: ", "px;\n z-index: ", ";\n width: ", "px;\n }\n .", " {\n background: linear-gradient(\n to left,\n transparent 0,\n ", "\n ", "%\n ),\n linear-gradient(\n to right,\n ", " 0px,\n transparent 1px\n );\n left: 0px;\n }\n .", "[data-number-column='true'] > :not(.", ").", " {\n left: ", "px;\n }\n .", " {\n background: linear-gradient(\n to right,\n transparent 0,\n ", "\n ", "%\n ),\n linear-gradient(\n to left,\n ", " 0px,\n transparent 1px\n );\n left: ", ";\n }\n .", " {\n ", "\n .", " {\n border-left: 1px solid ", ";\n }\n }\n"])), _types.TableCssClassName.TABLE_RIGHT_SHADOW, _types.TableCssClassName.TABLE_LEFT_SHADOW, _styles.tableMarginTop, _styles.tableMarginTop, _editorSharedStyles.akEditorShadowZIndex, (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.increase-shadow-visibility_lh89r') ? _consts.tableOverflowShadowWidthWide : _consts.tableOverflowShadowWidth, _types.TableCssClassName.TABLE_LEFT_SHADOW, "var(--ds-shadow-overflow-spread, ".concat(_colors.N40A, ")"), (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.increase-shadow-visibility_lh89r') ? 140 : 100, "var(--ds-shadow-overflow-perimeter, transparent)", _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.TABLE_STICKY_SHADOW, _types.TableCssClassName.TABLE_LEFT_SHADOW, _editorSharedStyles.akEditorTableNumberColumnWidth - 1, _types.TableCssClassName.TABLE_RIGHT_SHADOW, "var(--ds-shadow-overflow-spread, ".concat(_colors.N40A, ")"), (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.increase-shadow-visibility_lh89r') ? 140 : 100, "var(--ds-shadow-overflow-perimeter, transparent)", (0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') ? "calc(100% - ".concat((0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.increase-shadow-visibility_lh89r') ? _consts.tableOverflowShadowWidthWide : _consts.tableOverflowShadowWidth, "px)") : "calc(100% - ".concat((0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.increase-shadow-visibility_lh89r') ? _consts.tableOverflowShadowWidthWide - 10 : -2, "px)"), _types.TableCssClassName.WITH_CONTROLS, overflowShadowWidhoutDnD(isDragAndDropEnabled), _types.TableCssClassName.TABLE_LEFT_SHADOW, _consts.tableBorderColor);
76
+ return (0, _react.css)(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n .", ", .", " {\n display: block;\n height: calc(100% - ", "px);\n position: absolute;\n pointer-events: none;\n top: ", "px;\n z-index: ", ";\n width: ", "px;\n }\n .", " {\n background: linear-gradient(\n to left,\n transparent 0,\n ", " 140%\n ),\n linear-gradient(\n to right,\n ", " 0px,\n transparent 1px\n );\n left: 0px;\n }\n .", "[data-number-column='true'] > :not(.", ").", " {\n left: ", "px;\n }\n .", " {\n background: linear-gradient(\n to right,\n transparent 0,\n ", " 140%\n ),\n linear-gradient(\n to left,\n ", " 0px,\n transparent 1px\n );\n left: ", ";\n }\n .", " {\n ", "\n .", " {\n border-left: 1px solid ", ";\n }\n }\n"])), _types.TableCssClassName.TABLE_RIGHT_SHADOW, _types.TableCssClassName.TABLE_LEFT_SHADOW, _styles.tableMarginTop, _styles.tableMarginTop, _editorSharedStyles.akEditorShadowZIndex, _consts.tableOverflowShadowWidthWide, _types.TableCssClassName.TABLE_LEFT_SHADOW, "var(--ds-shadow-overflow-spread, ".concat(_colors.N40A, ")"), "var(--ds-shadow-overflow-perimeter, transparent)", _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.TABLE_STICKY_SHADOW, _types.TableCssClassName.TABLE_LEFT_SHADOW, _editorSharedStyles.akEditorTableNumberColumnWidth - 1, _types.TableCssClassName.TABLE_RIGHT_SHADOW, "var(--ds-shadow-overflow-spread, ".concat(_colors.N40A, ")"), "var(--ds-shadow-overflow-perimeter, transparent)", (0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') ? "calc(100% - ".concat(_consts.tableOverflowShadowWidthWide, "px)") : "calc(100% - ".concat(_consts.tableOverflowShadowWidthWide - 10, "px)"), _types.TableCssClassName.WITH_CONTROLS, overflowShadowWidhoutDnD(isDragAndDropEnabled), _types.TableCssClassName.TABLE_LEFT_SHADOW, _consts.tableBorderColor);
77
77
  };
78
78
  var overflowShadowWidhoutDnD = function overflowShadowWidhoutDnD(isDragAndDropEnabled) {
79
79
  if (!isDragAndDropEnabled) {
@@ -114,16 +114,16 @@ export const activateNextResizeArea = ({
114
114
  const currentCellRect = tableMap.findCell($currentCell.pos - $currentCell.start(-1));
115
115
  const $nextCell = nextCell($currentCell, 'horiz', direction);
116
116
  if (ariaNotify && getIntl) {
117
- let columnDirection = '';
118
117
  if (direction === 1) {
119
- columnDirection = getIntl().formatMessage(messages.columnRightResize);
118
+ ariaNotify(getIntl().formatMessage(messages.focusedOtherResize, {
119
+ direction: 'right'
120
+ }));
120
121
  }
121
122
  if (direction === -1) {
122
- columnDirection = getIntl().formatMessage(messages.columnLeftResize);
123
+ ariaNotify(getIntl().formatMessage(messages.focusedOtherResize, {
124
+ direction: 'left'
125
+ }));
123
126
  }
124
- ariaNotify(getIntl().formatMessage(messages.focusedOtherResize, {
125
- direction: columnDirection
126
- }));
127
127
  }
128
128
  if ($nextCell) {
129
129
  // we are somewhere in between the side columns of the table
@@ -773,9 +773,10 @@ class TableComponent extends React.Component {
773
773
  }), this.state.stickyHeader && /*#__PURE__*/React.createElement("div", {
774
774
  style: {
775
775
  position: 'absolute',
776
- right: getBooleanFF('platform.editor.custom-table-width') ? `${getBooleanFF('platform.editor.table.increase-shadow-visibility_lh89r') ? "var(--ds-space-400, 32px)" // tableOverflowShadowWidthWide
777
- : "var(--ds-space-100, 8px)" // tableOverflowShadowWidth
778
- }` : "var(--ds-space-negative-025, -2px)"
776
+ right: getBooleanFF('platform.editor.custom-table-width') ? `${"var(--ds-space-400, 32px)" // tableOverflowShadowWidthWide
777
+ }` :
778
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
779
+ '22px'
779
780
  }
780
781
  }, /*#__PURE__*/React.createElement("div", {
781
782
  className: `${ClassName.TABLE_RIGHT_SHADOW} ${ClassName.TABLE_STICKY_SHADOW}`,
@@ -1,5 +1,4 @@
1
1
  import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
2
- import debounce from 'lodash/debounce';
3
2
  import rafSchd from 'raf-schd';
4
3
  import { useIntl } from 'react-intl-next';
5
4
  import { TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
@@ -19,7 +18,6 @@ import { TABLE_GUIDELINE_VISIBLE_ADJUSTMENT, TABLE_HIGHLIGHT_GAP, TABLE_HIGHLIGH
19
18
  import { generateResizedPayload, generateResizeFrameRatePayloads, useMeasureFramerate } from '../utils/analytics';
20
19
  import { defaultGuidelines, defaultGuidelinesForPreserveTable } from '../utils/guidelines';
21
20
  import { defaultSnappingWidths, defaultTablePreserveSnappingWidths, findClosestSnap } from '../utils/snapping';
22
- const DEBOUNCE_TIME_FOR_SCREEN_READER_ANNOUNCER = 1000;
23
21
  const RESIZE_STEP_VALUE = 10;
24
22
  const handles = {
25
23
  right: true
@@ -105,24 +103,9 @@ export const TableResizer = ({
105
103
  // used to reposition tooltip when table is resizing via keyboard
106
104
  const updateTooltip = React.useRef();
107
105
  const [snappingEnabled, setSnappingEnabled] = useState(false);
108
-
109
- // we don't want to update aria-live region on each width change, it might provide bad experience for screen reader users
110
- const [screenReaderResizeInformation, setScreenReaderResizeInformation] = useState({
111
- type: 'none',
112
- width
113
- });
114
106
  const {
115
107
  formatMessage
116
108
  } = useIntl();
117
- const screenReaderResizeAnnouncerMessages = {
118
- increase: formatMessage(messages.tableSizeIncreaseScreenReaderInformation, {
119
- newWidth: screenReaderResizeInformation.width
120
- }),
121
- decrease: formatMessage(messages.tableSizeDecreaseScreenReaderInformation, {
122
- newWidth: screenReaderResizeInformation.width
123
- }),
124
- none: ''
125
- };
126
109
  const isTableSelected = ((_findTable = findTable((_editorView$state = editorView.state) === null || _editorView$state === void 0 ? void 0 : _editorView$state.selection)) === null || _findTable === void 0 ? void 0 : _findTable.pos) === getPos();
127
110
  const resizerMinWidth = getResizerMinWidth(node);
128
111
  const handleSize = getResizerHandleHeight(tableRef);
@@ -274,6 +257,19 @@ export const TableResizer = ({
274
257
  }
275
258
  displayGapCursor(true);
276
259
  dispatch(tr);
260
+ if (getBooleanFF('platform.editor.a11y-table-resizing_uapcv')) {
261
+ if (delta.width < 0) {
262
+ var _pluginInjectionApi$a;
263
+ pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.ariaNotify(formatMessage(messages.tableSizeDecreaseScreenReaderInformation, {
264
+ newWidth: newWidth
265
+ }));
266
+ } else if (delta.width > 0) {
267
+ var _pluginInjectionApi$a2;
268
+ pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a2 = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions.ariaNotify(formatMessage(messages.tableSizeIncreaseScreenReaderInformation, {
269
+ newWidth: newWidth
270
+ }));
271
+ }
272
+ }
277
273
 
278
274
  // Hide guidelines when resizing stops
279
275
  displayGuideline([]);
@@ -283,7 +279,7 @@ export const TableResizer = ({
283
279
  onResizeStop();
284
280
  }
285
281
  return newWidth;
286
- }, [displayGapCursor, updateWidth, editorView, getPos, node, tableRef, scheduleResize, displayGuideline, attachAnalyticsEvent, endMeasure, onResizeStop, isTableScalingEnabled, widthToWidest]);
282
+ }, [displayGapCursor, updateWidth, editorView, getPos, node, tableRef, scheduleResize, displayGuideline, attachAnalyticsEvent, endMeasure, onResizeStop, isTableScalingEnabled, widthToWidest, formatMessage, pluginInjectionApi]);
287
283
  const handleTableSizeChangeOnKeypress = useCallback(step => {
288
284
  const newWidth = width + step;
289
285
  if (newWidth > maxWidth || newWidth < resizerMinWidth) {
@@ -365,27 +361,6 @@ export const TableResizer = ({
365
361
  (_updateTooltip$curren = updateTooltip.current) === null || _updateTooltip$curren === void 0 ? void 0 : _updateTooltip$curren.call(updateTooltip);
366
362
  }
367
363
  }, [width]);
368
- useEffect(() => {
369
- if (getBooleanFF('platform.editor.a11y-table-resizing_uapcv')) {
370
- const debouncedSetWidth = debounce(setScreenReaderResizeInformation, DEBOUNCE_TIME_FOR_SCREEN_READER_ANNOUNCER);
371
- debouncedSetWidth(prevState => {
372
- let type = 'none';
373
- if (prevState.width > width) {
374
- type = 'decrease';
375
- }
376
- if (prevState.width < width) {
377
- type = 'increase';
378
- }
379
- return {
380
- type,
381
- width
382
- };
383
- });
384
- return () => {
385
- debouncedSetWidth.cancel();
386
- };
387
- }
388
- }, [width]);
389
364
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ResizerNext, {
390
365
  ref: resizerRef,
391
366
  enable: handles,
@@ -415,8 +390,5 @@ export const TableResizer = ({
415
390
  keymap: focusTableResizer
416
391
  });
417
392
  } : formatMessage(messages.resizeTable)
418
- }, children), getBooleanFF('platform.editor.a11y-table-resizing_uapcv') && /*#__PURE__*/React.createElement("div", {
419
- className: "assistive",
420
- role: "status"
421
- }, screenReaderResizeAnnouncerMessages[screenReaderResizeInformation.type]));
393
+ }, children));
422
394
  };
@@ -6,10 +6,8 @@ export function tableSelectionKeymapPlugin(editorSelectionAPI) {
6
6
  const list = {};
7
7
  bindKeymapWithCommand(moveRight.common, arrowRightFromTable(editorSelectionAPI)(), list);
8
8
  bindKeymapWithCommand(moveLeft.common, arrowLeftFromTable(editorSelectionAPI)(), list);
9
- if (getBooleanFF('platform.editor.a11y.table-selection_9uv33')) {
10
- bindKeymapArrayWithCommand(selectColumn, selectColumns(editorSelectionAPI)(true), list);
11
- bindKeymapArrayWithCommand(selectRow, selectRows(editorSelectionAPI)(true), list);
12
- }
9
+ bindKeymapArrayWithCommand(selectColumn, selectColumns(editorSelectionAPI)(true), list);
10
+ bindKeymapArrayWithCommand(selectRow, selectRows(editorSelectionAPI)(true), list);
13
11
  if (getBooleanFF('platform.editor.table.shift-arrowup-fix')) {
14
12
  bindKeymapWithCommand(shiftArrowUp.common, shiftArrowUpFromTable(editorSelectionAPI)(), list);
15
13
  }
@@ -4,7 +4,7 @@ import { akEditorShadowZIndex, akEditorTableBorder, akEditorTableNumberColumnWid
4
4
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
5
5
  import { B300, N0, N300, N40A, N60A, Y200, Y50 } from '@atlaskit/theme/colors';
6
6
  import { TableCssClassName as ClassName } from '../types';
7
- import { columnControlsDecorationHeight, columnControlsSelectedZIndex, columnControlsZIndex, dragTableInsertColumnButtonSize, insertLineWidth, lineMarkerSize, resizeHandlerAreaWidth, resizeHandlerZIndex, resizeLineWidth, tableBorderColor, tableBorderDeleteColor, tableBorderSelectedColor, tableCellDeleteColor, tableCellHoverDeleteIconBackground, tableCellHoverDeleteIconColor, tableCellSelectedDeleteIconBackground, tableCellSelectedDeleteIconColor, tableDeleteButtonSize, tableHeaderCellBackgroundColor, tableInsertColumnButtonSize, tableOverflowShadowWidth, tableOverflowShadowWidthWide, tableToolbarDeleteColor, tableToolbarSelectedColor, tableToolbarSize } from './consts';
7
+ import { columnControlsDecorationHeight, columnControlsSelectedZIndex, columnControlsZIndex, dragTableInsertColumnButtonSize, insertLineWidth, lineMarkerSize, resizeHandlerAreaWidth, resizeHandlerZIndex, resizeLineWidth, tableBorderColor, tableBorderDeleteColor, tableBorderSelectedColor, tableCellDeleteColor, tableCellHoverDeleteIconBackground, tableCellHoverDeleteIconColor, tableCellSelectedDeleteIconBackground, tableCellSelectedDeleteIconColor, tableDeleteButtonSize, tableHeaderCellBackgroundColor, tableInsertColumnButtonSize, tableOverflowShadowWidthWide, tableToolbarDeleteColor, tableToolbarSelectedColor, tableToolbarSize } from './consts';
8
8
  const InsertLine = cssString => css`
9
9
  .${ClassName.CONTROLS_INSERT_LINE} {
10
10
  background: ${tableBorderSelectedColor};
@@ -267,14 +267,13 @@ export const OverflowShadow = isDragAndDropEnabled => css`
267
267
  pointer-events: none;
268
268
  top: ${tableMarginTop}px;
269
269
  z-index: ${akEditorShadowZIndex};
270
- width: ${getBooleanFF('platform.editor.table.increase-shadow-visibility_lh89r') ? tableOverflowShadowWidthWide : tableOverflowShadowWidth}px;
270
+ width: ${tableOverflowShadowWidthWide}px;
271
271
  }
272
272
  .${ClassName.TABLE_LEFT_SHADOW} {
273
273
  background: linear-gradient(
274
274
  to left,
275
275
  transparent 0,
276
- ${`var(--ds-shadow-overflow-spread, ${N40A})`}
277
- ${getBooleanFF('platform.editor.table.increase-shadow-visibility_lh89r') ? 140 : 100}%
276
+ ${`var(--ds-shadow-overflow-spread, ${N40A})`} 140%
278
277
  ),
279
278
  linear-gradient(
280
279
  to right,
@@ -290,15 +289,14 @@ export const OverflowShadow = isDragAndDropEnabled => css`
290
289
  background: linear-gradient(
291
290
  to right,
292
291
  transparent 0,
293
- ${`var(--ds-shadow-overflow-spread, ${N40A})`}
294
- ${getBooleanFF('platform.editor.table.increase-shadow-visibility_lh89r') ? 140 : 100}%
292
+ ${`var(--ds-shadow-overflow-spread, ${N40A})`} 140%
295
293
  ),
296
294
  linear-gradient(
297
295
  to left,
298
296
  ${"var(--ds-shadow-overflow-perimeter, transparent)"} 0px,
299
297
  transparent 1px
300
298
  );
301
- left: ${getBooleanFF('platform.editor.custom-table-width') ? `calc(100% - ${getBooleanFF('platform.editor.table.increase-shadow-visibility_lh89r') ? tableOverflowShadowWidthWide : tableOverflowShadowWidth}px)` : `calc(100% - ${getBooleanFF('platform.editor.table.increase-shadow-visibility_lh89r') ? tableOverflowShadowWidthWide - 10 : -2}px)`};
299
+ left: ${getBooleanFF('platform.editor.custom-table-width') ? `calc(100% - ${tableOverflowShadowWidthWide}px)` : `calc(100% - ${tableOverflowShadowWidthWide - 10}px)`};
302
300
  }
303
301
  .${ClassName.WITH_CONTROLS} {
304
302
  ${overflowShadowWidhoutDnD(isDragAndDropEnabled)}
@@ -113,16 +113,16 @@ export var activateNextResizeArea = function activateNextResizeArea(_ref2) {
113
113
  var currentCellRect = tableMap.findCell($currentCell.pos - $currentCell.start(-1));
114
114
  var $nextCell = nextCell($currentCell, 'horiz', direction);
115
115
  if (ariaNotify && getIntl) {
116
- var columnDirection = '';
117
116
  if (direction === 1) {
118
- columnDirection = getIntl().formatMessage(messages.columnRightResize);
117
+ ariaNotify(getIntl().formatMessage(messages.focusedOtherResize, {
118
+ direction: 'right'
119
+ }));
119
120
  }
120
121
  if (direction === -1) {
121
- columnDirection = getIntl().formatMessage(messages.columnLeftResize);
122
+ ariaNotify(getIntl().formatMessage(messages.focusedOtherResize, {
123
+ direction: 'left'
124
+ }));
122
125
  }
123
- ariaNotify(getIntl().formatMessage(messages.focusedOtherResize, {
124
- direction: columnDirection
125
- }));
126
126
  }
127
127
  if ($nextCell) {
128
128
  // we are somewhere in between the side columns of the table
@@ -777,9 +777,10 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
777
777
  }), this.state.stickyHeader && /*#__PURE__*/React.createElement("div", {
778
778
  style: {
779
779
  position: 'absolute',
780
- right: getBooleanFF('platform.editor.custom-table-width') ? "".concat(getBooleanFF('platform.editor.table.increase-shadow-visibility_lh89r') ? "var(--ds-space-400, 32px)" // tableOverflowShadowWidthWide
781
- : "var(--ds-space-100, 8px)" // tableOverflowShadowWidth
782
- ) : "var(--ds-space-negative-025, -2px)"
780
+ right: getBooleanFF('platform.editor.custom-table-width') ? "var(--ds-space-400, 32px)" // tableOverflowShadowWidthWide
781
+ :
782
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
783
+ '22px'
783
784
  }
784
785
  }, /*#__PURE__*/React.createElement("div", {
785
786
  className: "".concat(ClassName.TABLE_RIGHT_SHADOW, " ").concat(ClassName.TABLE_STICKY_SHADOW),
@@ -3,7 +3,6 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  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; }
4
4
  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; }
5
5
  import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
6
- import debounce from 'lodash/debounce';
7
6
  import rafSchd from 'raf-schd';
8
7
  import { useIntl } from 'react-intl-next';
9
8
  import { TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
@@ -23,7 +22,6 @@ import { TABLE_GUIDELINE_VISIBLE_ADJUSTMENT, TABLE_HIGHLIGHT_GAP, TABLE_HIGHLIGH
23
22
  import { generateResizedPayload, generateResizeFrameRatePayloads, useMeasureFramerate } from '../utils/analytics';
24
23
  import { defaultGuidelines, defaultGuidelinesForPreserveTable } from '../utils/guidelines';
25
24
  import { defaultSnappingWidths, defaultTablePreserveSnappingWidths, findClosestSnap } from '../utils/snapping';
26
- var DEBOUNCE_TIME_FOR_SCREEN_READER_ANNOUNCER = 1000;
27
25
  var RESIZE_STEP_VALUE = 10;
28
26
  var handles = {
29
27
  right: true
@@ -112,26 +110,8 @@ export var TableResizer = function TableResizer(_ref) {
112
110
  _useState4 = _slicedToArray(_useState3, 2),
113
111
  snappingEnabled = _useState4[0],
114
112
  setSnappingEnabled = _useState4[1];
115
-
116
- // we don't want to update aria-live region on each width change, it might provide bad experience for screen reader users
117
- var _useState5 = useState({
118
- type: 'none',
119
- width: width
120
- }),
121
- _useState6 = _slicedToArray(_useState5, 2),
122
- screenReaderResizeInformation = _useState6[0],
123
- setScreenReaderResizeInformation = _useState6[1];
124
113
  var _useIntl = useIntl(),
125
114
  formatMessage = _useIntl.formatMessage;
126
- var screenReaderResizeAnnouncerMessages = {
127
- increase: formatMessage(messages.tableSizeIncreaseScreenReaderInformation, {
128
- newWidth: screenReaderResizeInformation.width
129
- }),
130
- decrease: formatMessage(messages.tableSizeDecreaseScreenReaderInformation, {
131
- newWidth: screenReaderResizeInformation.width
132
- }),
133
- none: ''
134
- };
135
115
  var isTableSelected = ((_findTable = findTable((_editorView$state = editorView.state) === null || _editorView$state === void 0 ? void 0 : _editorView$state.selection)) === null || _findTable === void 0 ? void 0 : _findTable.pos) === getPos();
136
116
  var resizerMinWidth = getResizerMinWidth(node);
137
117
  var handleSize = getResizerHandleHeight(tableRef);
@@ -272,6 +252,19 @@ export var TableResizer = function TableResizer(_ref) {
272
252
  }
273
253
  displayGapCursor(true);
274
254
  dispatch(tr);
255
+ if (getBooleanFF('platform.editor.a11y-table-resizing_uapcv')) {
256
+ if (delta.width < 0) {
257
+ var _pluginInjectionApi$a;
258
+ pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a === void 0 || _pluginInjectionApi$a.actions.ariaNotify(formatMessage(messages.tableSizeDecreaseScreenReaderInformation, {
259
+ newWidth: newWidth
260
+ }));
261
+ } else if (delta.width > 0) {
262
+ var _pluginInjectionApi$a2;
263
+ pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a2 = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a2 === void 0 || _pluginInjectionApi$a2.actions.ariaNotify(formatMessage(messages.tableSizeIncreaseScreenReaderInformation, {
264
+ newWidth: newWidth
265
+ }));
266
+ }
267
+ }
275
268
 
276
269
  // Hide guidelines when resizing stops
277
270
  displayGuideline([]);
@@ -281,7 +274,7 @@ export var TableResizer = function TableResizer(_ref) {
281
274
  onResizeStop();
282
275
  }
283
276
  return newWidth;
284
- }, [displayGapCursor, updateWidth, editorView, getPos, node, tableRef, scheduleResize, displayGuideline, attachAnalyticsEvent, endMeasure, onResizeStop, isTableScalingEnabled, widthToWidest]);
277
+ }, [displayGapCursor, updateWidth, editorView, getPos, node, tableRef, scheduleResize, displayGuideline, attachAnalyticsEvent, endMeasure, onResizeStop, isTableScalingEnabled, widthToWidest, formatMessage, pluginInjectionApi]);
285
278
  var handleTableSizeChangeOnKeypress = useCallback(function (step) {
286
279
  var newWidth = width + step;
287
280
  if (newWidth > maxWidth || newWidth < resizerMinWidth) {
@@ -363,27 +356,6 @@ export var TableResizer = function TableResizer(_ref) {
363
356
  (_updateTooltip$curren = updateTooltip.current) === null || _updateTooltip$curren === void 0 || _updateTooltip$curren.call(updateTooltip);
364
357
  }
365
358
  }, [width]);
366
- useEffect(function () {
367
- if (getBooleanFF('platform.editor.a11y-table-resizing_uapcv')) {
368
- var debouncedSetWidth = debounce(setScreenReaderResizeInformation, DEBOUNCE_TIME_FOR_SCREEN_READER_ANNOUNCER);
369
- debouncedSetWidth(function (prevState) {
370
- var type = 'none';
371
- if (prevState.width > width) {
372
- type = 'decrease';
373
- }
374
- if (prevState.width < width) {
375
- type = 'increase';
376
- }
377
- return {
378
- type: type,
379
- width: width
380
- };
381
- });
382
- return function () {
383
- debouncedSetWidth.cancel();
384
- };
385
- }
386
- }, [width]);
387
359
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ResizerNext, {
388
360
  ref: resizerRef,
389
361
  enable: handles,
@@ -412,8 +384,5 @@ export var TableResizer = function TableResizer(_ref) {
412
384
  keymap: focusTableResizer
413
385
  });
414
386
  } : formatMessage(messages.resizeTable)
415
- }, children), getBooleanFF('platform.editor.a11y-table-resizing_uapcv') && /*#__PURE__*/React.createElement("div", {
416
- className: "assistive",
417
- role: "status"
418
- }, screenReaderResizeAnnouncerMessages[screenReaderResizeInformation.type]));
387
+ }, children));
419
388
  };
@@ -6,10 +6,8 @@ export function tableSelectionKeymapPlugin(editorSelectionAPI) {
6
6
  var list = {};
7
7
  bindKeymapWithCommand(moveRight.common, arrowRightFromTable(editorSelectionAPI)(), list);
8
8
  bindKeymapWithCommand(moveLeft.common, arrowLeftFromTable(editorSelectionAPI)(), list);
9
- if (getBooleanFF('platform.editor.a11y.table-selection_9uv33')) {
10
- bindKeymapArrayWithCommand(selectColumn, selectColumns(editorSelectionAPI)(true), list);
11
- bindKeymapArrayWithCommand(selectRow, selectRows(editorSelectionAPI)(true), list);
12
- }
9
+ bindKeymapArrayWithCommand(selectColumn, selectColumns(editorSelectionAPI)(true), list);
10
+ bindKeymapArrayWithCommand(selectRow, selectRows(editorSelectionAPI)(true), list);
13
11
  if (getBooleanFF('platform.editor.table.shift-arrowup-fix')) {
14
12
  bindKeymapWithCommand(shiftArrowUp.common, shiftArrowUpFromTable(editorSelectionAPI)(), list);
15
13
  }
@@ -6,7 +6,7 @@ import { akEditorShadowZIndex, akEditorTableBorder, akEditorTableNumberColumnWid
6
6
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
7
7
  import { B300, N0, N300, N40A, N60A, Y200, Y50 } from '@atlaskit/theme/colors';
8
8
  import { TableCssClassName as ClassName } from '../types';
9
- import { columnControlsDecorationHeight, columnControlsSelectedZIndex, columnControlsZIndex, dragTableInsertColumnButtonSize, insertLineWidth, lineMarkerSize, resizeHandlerAreaWidth, resizeHandlerZIndex, resizeLineWidth, tableBorderColor, tableBorderDeleteColor, tableBorderSelectedColor, tableCellDeleteColor, tableCellHoverDeleteIconBackground, tableCellHoverDeleteIconColor, tableCellSelectedDeleteIconBackground, tableCellSelectedDeleteIconColor, tableDeleteButtonSize, tableHeaderCellBackgroundColor, tableInsertColumnButtonSize, tableOverflowShadowWidth, tableOverflowShadowWidthWide, tableToolbarDeleteColor, tableToolbarSelectedColor, tableToolbarSize } from './consts';
9
+ import { columnControlsDecorationHeight, columnControlsSelectedZIndex, columnControlsZIndex, dragTableInsertColumnButtonSize, insertLineWidth, lineMarkerSize, resizeHandlerAreaWidth, resizeHandlerZIndex, resizeLineWidth, tableBorderColor, tableBorderDeleteColor, tableBorderSelectedColor, tableCellDeleteColor, tableCellHoverDeleteIconBackground, tableCellHoverDeleteIconColor, tableCellSelectedDeleteIconBackground, tableCellSelectedDeleteIconColor, tableDeleteButtonSize, tableHeaderCellBackgroundColor, tableInsertColumnButtonSize, tableOverflowShadowWidthWide, tableToolbarDeleteColor, tableToolbarSelectedColor, tableToolbarSize } from './consts';
10
10
  var InsertLine = function InsertLine(cssString) {
11
11
  return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n background: ", ";\n display: none;\n position: absolute;\n z-index: ", ";\n ", "\n }\n"])), ClassName.CONTROLS_INSERT_LINE, tableBorderSelectedColor, akEditorUnitZIndex, cssString);
12
12
  };
@@ -66,7 +66,7 @@ export var DeleteButton = function DeleteButton() {
66
66
  return css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n .", ",\n .", " {\n height: ", "px;\n width: ", "px;\n }\n .", " {\n .", " {\n ", "\n }\n }\n\n .", ":hover {\n background: ", ";\n color: ", ";\n cursor: pointer;\n }\n"])), ClassName.CONTROLS_DELETE_BUTTON_WRAP, ClassName.CONTROLS_DELETE_BUTTON, tableDeleteButtonSize, tableDeleteButtonSize, ClassName.CONTROLS_DELETE_BUTTON_WRAP, ClassName.CONTROLS_DELETE_BUTTON, Button("\n background: ".concat(tableCellSelectedDeleteIconBackground, ";\n color: ").concat(tableCellSelectedDeleteIconColor, ";\n ")), ClassName.CONTROLS_DELETE_BUTTON, tableCellHoverDeleteIconBackground, tableCellHoverDeleteIconColor);
67
67
  };
68
68
  export var OverflowShadow = function OverflowShadow(isDragAndDropEnabled) {
69
- return css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n .", ", .", " {\n display: block;\n height: calc(100% - ", "px);\n position: absolute;\n pointer-events: none;\n top: ", "px;\n z-index: ", ";\n width: ", "px;\n }\n .", " {\n background: linear-gradient(\n to left,\n transparent 0,\n ", "\n ", "%\n ),\n linear-gradient(\n to right,\n ", " 0px,\n transparent 1px\n );\n left: 0px;\n }\n .", "[data-number-column='true'] > :not(.", ").", " {\n left: ", "px;\n }\n .", " {\n background: linear-gradient(\n to right,\n transparent 0,\n ", "\n ", "%\n ),\n linear-gradient(\n to left,\n ", " 0px,\n transparent 1px\n );\n left: ", ";\n }\n .", " {\n ", "\n .", " {\n border-left: 1px solid ", ";\n }\n }\n"])), ClassName.TABLE_RIGHT_SHADOW, ClassName.TABLE_LEFT_SHADOW, tableMarginTop, tableMarginTop, akEditorShadowZIndex, getBooleanFF('platform.editor.table.increase-shadow-visibility_lh89r') ? tableOverflowShadowWidthWide : tableOverflowShadowWidth, ClassName.TABLE_LEFT_SHADOW, "var(--ds-shadow-overflow-spread, ".concat(N40A, ")"), getBooleanFF('platform.editor.table.increase-shadow-visibility_lh89r') ? 140 : 100, "var(--ds-shadow-overflow-perimeter, transparent)", ClassName.TABLE_CONTAINER, ClassName.TABLE_STICKY_SHADOW, ClassName.TABLE_LEFT_SHADOW, akEditorTableNumberColumnWidth - 1, ClassName.TABLE_RIGHT_SHADOW, "var(--ds-shadow-overflow-spread, ".concat(N40A, ")"), getBooleanFF('platform.editor.table.increase-shadow-visibility_lh89r') ? 140 : 100, "var(--ds-shadow-overflow-perimeter, transparent)", getBooleanFF('platform.editor.custom-table-width') ? "calc(100% - ".concat(getBooleanFF('platform.editor.table.increase-shadow-visibility_lh89r') ? tableOverflowShadowWidthWide : tableOverflowShadowWidth, "px)") : "calc(100% - ".concat(getBooleanFF('platform.editor.table.increase-shadow-visibility_lh89r') ? tableOverflowShadowWidthWide - 10 : -2, "px)"), ClassName.WITH_CONTROLS, overflowShadowWidhoutDnD(isDragAndDropEnabled), ClassName.TABLE_LEFT_SHADOW, tableBorderColor);
69
+ return css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n .", ", .", " {\n display: block;\n height: calc(100% - ", "px);\n position: absolute;\n pointer-events: none;\n top: ", "px;\n z-index: ", ";\n width: ", "px;\n }\n .", " {\n background: linear-gradient(\n to left,\n transparent 0,\n ", " 140%\n ),\n linear-gradient(\n to right,\n ", " 0px,\n transparent 1px\n );\n left: 0px;\n }\n .", "[data-number-column='true'] > :not(.", ").", " {\n left: ", "px;\n }\n .", " {\n background: linear-gradient(\n to right,\n transparent 0,\n ", " 140%\n ),\n linear-gradient(\n to left,\n ", " 0px,\n transparent 1px\n );\n left: ", ";\n }\n .", " {\n ", "\n .", " {\n border-left: 1px solid ", ";\n }\n }\n"])), ClassName.TABLE_RIGHT_SHADOW, ClassName.TABLE_LEFT_SHADOW, tableMarginTop, tableMarginTop, akEditorShadowZIndex, tableOverflowShadowWidthWide, ClassName.TABLE_LEFT_SHADOW, "var(--ds-shadow-overflow-spread, ".concat(N40A, ")"), "var(--ds-shadow-overflow-perimeter, transparent)", ClassName.TABLE_CONTAINER, ClassName.TABLE_STICKY_SHADOW, ClassName.TABLE_LEFT_SHADOW, akEditorTableNumberColumnWidth - 1, ClassName.TABLE_RIGHT_SHADOW, "var(--ds-shadow-overflow-spread, ".concat(N40A, ")"), "var(--ds-shadow-overflow-perimeter, transparent)", getBooleanFF('platform.editor.custom-table-width') ? "calc(100% - ".concat(tableOverflowShadowWidthWide, "px)") : "calc(100% - ".concat(tableOverflowShadowWidthWide - 10, "px)"), ClassName.WITH_CONTROLS, overflowShadowWidhoutDnD(isDragAndDropEnabled), ClassName.TABLE_LEFT_SHADOW, tableBorderColor);
70
70
  };
71
71
  var overflowShadowWidhoutDnD = function overflowShadowWidhoutDnD(isDragAndDropEnabled) {
72
72
  if (!isDragAndDropEnabled) {
@@ -1,6 +1,7 @@
1
1
  import type { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
2
2
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import type { Command, EditorCommand, GetEditorFeatureFlags, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
4
+ import type { AccessibilityUtilsPlugin } from '@atlaskit/editor-plugin-accessibility-utils';
4
5
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
5
6
  import type { ContentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
6
7
  import type { GuidelinePlugin } from '@atlaskit/editor-plugin-guideline';
@@ -35,6 +36,7 @@ export type TablePlugin = NextEditorPlugin<'table', {
35
36
  insertTableWithSize: (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
36
37
  };
37
38
  dependencies: [
39
+ OptionalPlugin<AccessibilityUtilsPlugin>,
38
40
  AnalyticsPlugin,
39
41
  ContentInsertionPlugin,
40
42
  WidthPlugin,