@atlaskit/editor-plugin-table 7.19.8 → 7.19.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 7.19.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [#118104](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/118104)
8
+ [`700333187f53a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/700333187f53a) -
9
+ Remove feature flag where cmd+A selects the table rather than the document.
10
+
11
+ ## 7.19.9
12
+
13
+ ### Patch Changes
14
+
15
+ - [#117916](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/117916)
16
+ [`49fc126d779b0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/49fc126d779b0) -
17
+ ECA11Y-111: A11y table resizing feature flag removal
18
+ - Updated dependencies
19
+
3
20
  ## 7.19.8
4
21
 
5
22
  ### Patch Changes
@@ -21,7 +21,6 @@ var _utils = require("@atlaskit/editor-common/utils");
21
21
  var _commands = require("@atlaskit/editor-prosemirror/commands");
22
22
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
23
23
  var _utils2 = require("@atlaskit/editor-tables/utils");
24
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
25
24
  var _commandsWithAnalytics = require("../commands-with-analytics");
26
25
  var _misc = require("../commands/misc");
27
26
  var _tableAnalytics = require("../pm-plugins/table-analytics");
@@ -312,18 +311,16 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
312
311
  }
313
312
  displayGapCursor(true);
314
313
  dispatch(tr);
315
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-resizing_uapcv')) {
316
- if (delta.width < 0) {
317
- var _pluginInjectionApi$a3;
318
- pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a3 = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a3 === void 0 || _pluginInjectionApi$a3.actions.ariaNotify(formatMessage(_messages.tableMessages.tableSizeDecreaseScreenReaderInformation, {
319
- newWidth: newWidth
320
- }));
321
- } else if (delta.width > 0) {
322
- var _pluginInjectionApi$a4;
323
- pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a4 = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a4 === void 0 || _pluginInjectionApi$a4.actions.ariaNotify(formatMessage(_messages.tableMessages.tableSizeIncreaseScreenReaderInformation, {
324
- newWidth: newWidth
325
- }));
326
- }
314
+ if (delta.width < 0) {
315
+ var _pluginInjectionApi$a3;
316
+ pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a3 = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a3 === void 0 || _pluginInjectionApi$a3.actions.ariaNotify(formatMessage(_messages.tableMessages.tableSizeDecreaseScreenReaderInformation, {
317
+ newWidth: newWidth
318
+ }));
319
+ } else if (delta.width > 0) {
320
+ var _pluginInjectionApi$a4;
321
+ pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a4 = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a4 === void 0 || _pluginInjectionApi$a4.actions.ariaNotify(formatMessage(_messages.tableMessages.tableSizeIncreaseScreenReaderInformation, {
322
+ newWidth: newWidth
323
+ }));
327
324
  }
328
325
 
329
326
  // Hide guidelines when resizing stops
@@ -375,45 +372,41 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
375
372
  return;
376
373
  }, [areResizeMetaKeysPressed]);
377
374
  (0, _react.useLayoutEffect)(function () {
378
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-resizing_uapcv')) {
379
- if (!resizerRef.current) {
375
+ if (!resizerRef.current) {
376
+ return;
377
+ }
378
+ var resizeHandleThumbEl = resizerRef.current.getResizerThumbEl();
379
+ var globalKeyDownHandler = function globalKeyDownHandler(event) {
380
+ var metaKey = _utils.browser.mac ? event.metaKey : event.ctrlKey;
381
+ if (!isTableSelected) {
380
382
  return;
381
383
  }
382
- var resizeHandleThumbEl = resizerRef.current.getResizerThumbEl();
383
- var globalKeyDownHandler = function globalKeyDownHandler(event) {
384
- var metaKey = _utils.browser.mac ? event.metaKey : event.ctrlKey;
385
- if (!isTableSelected) {
384
+ if (event.altKey && event.shiftKey && metaKey && event.code === 'KeyR') {
385
+ event.preventDefault();
386
+ if (!resizeHandleThumbEl) {
386
387
  return;
387
388
  }
388
- if (event.altKey && event.shiftKey && metaKey && event.code === 'KeyR') {
389
- event.preventDefault();
390
- if (!resizeHandleThumbEl) {
391
- return;
392
- }
393
- resizeHandleThumbEl.focus();
394
- resizeHandleThumbEl.scrollIntoView({
395
- behavior: 'smooth',
396
- block: 'center',
397
- inline: 'nearest'
398
- });
399
- }
400
- };
401
- var editorViewDom = editorView === null || editorView === void 0 ? void 0 : editorView.dom;
402
- editorViewDom === null || editorViewDom === void 0 || editorViewDom.addEventListener('keydown', globalKeyDownHandler);
403
- resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 || resizeHandleThumbEl.addEventListener('keydown', handleKeyDown);
404
- resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 || resizeHandleThumbEl.addEventListener('keyup', handleKeyUp);
405
- return function () {
406
- editorViewDom === null || editorViewDom === void 0 || editorViewDom.removeEventListener('keydown', globalKeyDownHandler);
407
- resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 || resizeHandleThumbEl.removeEventListener('keydown', handleKeyDown);
408
- resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 || resizeHandleThumbEl.removeEventListener('keyup', handleKeyUp);
409
- };
410
- }
389
+ resizeHandleThumbEl.focus();
390
+ resizeHandleThumbEl.scrollIntoView({
391
+ behavior: 'smooth',
392
+ block: 'center',
393
+ inline: 'nearest'
394
+ });
395
+ }
396
+ };
397
+ var editorViewDom = editorView === null || editorView === void 0 ? void 0 : editorView.dom;
398
+ editorViewDom === null || editorViewDom === void 0 || editorViewDom.addEventListener('keydown', globalKeyDownHandler);
399
+ resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 || resizeHandleThumbEl.addEventListener('keydown', handleKeyDown);
400
+ resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 || resizeHandleThumbEl.addEventListener('keyup', handleKeyUp);
401
+ return function () {
402
+ editorViewDom === null || editorViewDom === void 0 || editorViewDom.removeEventListener('keydown', globalKeyDownHandler);
403
+ resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 || resizeHandleThumbEl.removeEventListener('keydown', handleKeyDown);
404
+ resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 || resizeHandleThumbEl.removeEventListener('keyup', handleKeyUp);
405
+ };
411
406
  }, [resizerRef, editorView, handleResizeStop, isTableSelected, handleKeyDown, handleKeyUp]);
412
407
  (0, _react.useLayoutEffect)(function () {
413
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-resizing_uapcv')) {
414
- var _updateTooltip$curren;
415
- (_updateTooltip$curren = updateTooltip.current) === null || _updateTooltip$curren === void 0 || _updateTooltip$curren.call(updateTooltip);
416
- }
408
+ var _updateTooltip$curren;
409
+ (_updateTooltip$curren = updateTooltip.current) === null || _updateTooltip$curren === void 0 || _updateTooltip$curren.call(updateTooltip);
417
410
  }, [width]);
418
411
  var resizeRatio = !isTableAlignmentEnabled || isTableAlignmentEnabled && (0, _alignment.normaliseAlignment)(node.attrs.layout) === _alignment.ALIGN_CENTER ? 2 : 1;
419
412
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_resizer.ResizerNext, {
@@ -436,13 +429,13 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
436
429
  needExtendedResizeZone: !isTableSelected,
437
430
  appearance: isTableSelected && isWholeTableInDanger ? 'danger' : undefined,
438
431
  handleHighlight: "shadow",
439
- handleTooltipContent: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-resizing_uapcv') ? function (_ref4) {
432
+ handleTooltipContent: function handleTooltipContent(_ref4) {
440
433
  var update = _ref4.update;
441
434
  updateTooltip.current = update;
442
435
  return /*#__PURE__*/_react.default.createElement(_keymaps.ToolTipContent, {
443
436
  description: formatMessage(_messages.tableMessages.resizeTable),
444
437
  keymap: _keymaps.focusTableResizer
445
438
  });
446
- } : formatMessage(_messages.tableMessages.resizeTable)
439
+ }
447
440
  }, children));
448
441
  };
@@ -7,7 +7,6 @@ exports.default = void 0;
7
7
  exports.tableSelectionKeymapPlugin = tableSelectionKeymapPlugin;
8
8
  var _keymaps = require("@atlaskit/editor-common/keymaps");
9
9
  var _keymap = require("@atlaskit/editor-prosemirror/keymap");
10
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
10
  var _selection = require("../commands/selection");
12
11
  function tableSelectionKeymapPlugin(editorSelectionAPI) {
13
12
  var list = {};
@@ -16,9 +15,7 @@ function tableSelectionKeymapPlugin(editorSelectionAPI) {
16
15
  (0, _keymaps.bindKeymapArrayWithCommand)(_keymaps.selectColumn, (0, _selection.selectColumns)(editorSelectionAPI)(true), list);
17
16
  (0, _keymaps.bindKeymapArrayWithCommand)(_keymaps.selectRow, (0, _selection.selectRows)(editorSelectionAPI)(true), list);
18
17
  (0, _keymaps.bindKeymapWithCommand)(_keymaps.shiftArrowUp.common, (0, _selection.shiftArrowUpFromTable)(editorSelectionAPI)(), list);
19
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.cmd-a-select-table')) {
20
- (0, _keymaps.bindKeymapWithCommand)(_keymaps.selectTable.common, (0, _selection.modASelectTable)(editorSelectionAPI)(), list);
21
- }
18
+ (0, _keymaps.bindKeymapWithCommand)(_keymaps.selectTable.common, (0, _selection.modASelectTable)(editorSelectionAPI)(), list);
22
19
  return (0, _keymap.keymap)(list);
23
20
  }
24
21
  var _default = exports.default = tableSelectionKeymapPlugin;
@@ -11,7 +11,6 @@ import { browser } from '@atlaskit/editor-common/utils';
11
11
  import { chainCommands } from '@atlaskit/editor-prosemirror/commands';
12
12
  import { akEditorGutterPaddingDynamic } from '@atlaskit/editor-shared-styles';
13
13
  import { findTable } from '@atlaskit/editor-tables/utils';
14
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
15
14
  import { setTableAlignmentWithTableContentWithPosWithAnalytics } from '../commands-with-analytics';
16
15
  import { updateWidthToWidest } from '../commands/misc';
17
16
  import { META_KEYS } from '../pm-plugins/table-analytics';
@@ -308,18 +307,16 @@ export const TableResizer = ({
308
307
  }
309
308
  displayGapCursor(true);
310
309
  dispatch(tr);
311
- if (getBooleanFF('platform.editor.a11y-table-resizing_uapcv')) {
312
- if (delta.width < 0) {
313
- var _pluginInjectionApi$a3;
314
- pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a3 = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.actions.ariaNotify(formatMessage(messages.tableSizeDecreaseScreenReaderInformation, {
315
- newWidth: newWidth
316
- }));
317
- } else if (delta.width > 0) {
318
- var _pluginInjectionApi$a4;
319
- pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a4 = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.actions.ariaNotify(formatMessage(messages.tableSizeIncreaseScreenReaderInformation, {
320
- newWidth: newWidth
321
- }));
322
- }
310
+ if (delta.width < 0) {
311
+ var _pluginInjectionApi$a3;
312
+ pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a3 = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.actions.ariaNotify(formatMessage(messages.tableSizeDecreaseScreenReaderInformation, {
313
+ newWidth: newWidth
314
+ }));
315
+ } else if (delta.width > 0) {
316
+ var _pluginInjectionApi$a4;
317
+ pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a4 = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.actions.ariaNotify(formatMessage(messages.tableSizeIncreaseScreenReaderInformation, {
318
+ newWidth: newWidth
319
+ }));
323
320
  }
324
321
 
325
322
  // Hide guidelines when resizing stops
@@ -371,45 +368,41 @@ export const TableResizer = ({
371
368
  return;
372
369
  }, [areResizeMetaKeysPressed]);
373
370
  useLayoutEffect(() => {
374
- if (getBooleanFF('platform.editor.a11y-table-resizing_uapcv')) {
375
- if (!resizerRef.current) {
371
+ if (!resizerRef.current) {
372
+ return;
373
+ }
374
+ const resizeHandleThumbEl = resizerRef.current.getResizerThumbEl();
375
+ const globalKeyDownHandler = event => {
376
+ const metaKey = browser.mac ? event.metaKey : event.ctrlKey;
377
+ if (!isTableSelected) {
376
378
  return;
377
379
  }
378
- const resizeHandleThumbEl = resizerRef.current.getResizerThumbEl();
379
- const globalKeyDownHandler = event => {
380
- const metaKey = browser.mac ? event.metaKey : event.ctrlKey;
381
- if (!isTableSelected) {
380
+ if (event.altKey && event.shiftKey && metaKey && event.code === 'KeyR') {
381
+ event.preventDefault();
382
+ if (!resizeHandleThumbEl) {
382
383
  return;
383
384
  }
384
- if (event.altKey && event.shiftKey && metaKey && event.code === 'KeyR') {
385
- event.preventDefault();
386
- if (!resizeHandleThumbEl) {
387
- return;
388
- }
389
- resizeHandleThumbEl.focus();
390
- resizeHandleThumbEl.scrollIntoView({
391
- behavior: 'smooth',
392
- block: 'center',
393
- inline: 'nearest'
394
- });
395
- }
396
- };
397
- const editorViewDom = editorView === null || editorView === void 0 ? void 0 : editorView.dom;
398
- editorViewDom === null || editorViewDom === void 0 ? void 0 : editorViewDom.addEventListener('keydown', globalKeyDownHandler);
399
- resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 ? void 0 : resizeHandleThumbEl.addEventListener('keydown', handleKeyDown);
400
- resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 ? void 0 : resizeHandleThumbEl.addEventListener('keyup', handleKeyUp);
401
- return () => {
402
- editorViewDom === null || editorViewDom === void 0 ? void 0 : editorViewDom.removeEventListener('keydown', globalKeyDownHandler);
403
- resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 ? void 0 : resizeHandleThumbEl.removeEventListener('keydown', handleKeyDown);
404
- resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 ? void 0 : resizeHandleThumbEl.removeEventListener('keyup', handleKeyUp);
405
- };
406
- }
385
+ resizeHandleThumbEl.focus();
386
+ resizeHandleThumbEl.scrollIntoView({
387
+ behavior: 'smooth',
388
+ block: 'center',
389
+ inline: 'nearest'
390
+ });
391
+ }
392
+ };
393
+ const editorViewDom = editorView === null || editorView === void 0 ? void 0 : editorView.dom;
394
+ editorViewDom === null || editorViewDom === void 0 ? void 0 : editorViewDom.addEventListener('keydown', globalKeyDownHandler);
395
+ resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 ? void 0 : resizeHandleThumbEl.addEventListener('keydown', handleKeyDown);
396
+ resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 ? void 0 : resizeHandleThumbEl.addEventListener('keyup', handleKeyUp);
397
+ return () => {
398
+ editorViewDom === null || editorViewDom === void 0 ? void 0 : editorViewDom.removeEventListener('keydown', globalKeyDownHandler);
399
+ resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 ? void 0 : resizeHandleThumbEl.removeEventListener('keydown', handleKeyDown);
400
+ resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 ? void 0 : resizeHandleThumbEl.removeEventListener('keyup', handleKeyUp);
401
+ };
407
402
  }, [resizerRef, editorView, handleResizeStop, isTableSelected, handleKeyDown, handleKeyUp]);
408
403
  useLayoutEffect(() => {
409
- if (getBooleanFF('platform.editor.a11y-table-resizing_uapcv')) {
410
- var _updateTooltip$curren;
411
- (_updateTooltip$curren = updateTooltip.current) === null || _updateTooltip$curren === void 0 ? void 0 : _updateTooltip$curren.call(updateTooltip);
412
- }
404
+ var _updateTooltip$curren;
405
+ (_updateTooltip$curren = updateTooltip.current) === null || _updateTooltip$curren === void 0 ? void 0 : _updateTooltip$curren.call(updateTooltip);
413
406
  }, [width]);
414
407
  const resizeRatio = !isTableAlignmentEnabled || isTableAlignmentEnabled && normaliseAlignment(node.attrs.layout) === ALIGN_CENTER ? 2 : 1;
415
408
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ResizerNext, {
@@ -432,7 +425,7 @@ export const TableResizer = ({
432
425
  needExtendedResizeZone: !isTableSelected,
433
426
  appearance: isTableSelected && isWholeTableInDanger ? 'danger' : undefined,
434
427
  handleHighlight: "shadow",
435
- handleTooltipContent: getBooleanFF('platform.editor.a11y-table-resizing_uapcv') ? ({
428
+ handleTooltipContent: ({
436
429
  update
437
430
  }) => {
438
431
  updateTooltip.current = update;
@@ -440,6 +433,6 @@ export const TableResizer = ({
440
433
  description: formatMessage(messages.resizeTable),
441
434
  keymap: focusTableResizer
442
435
  });
443
- } : formatMessage(messages.resizeTable)
436
+ }
444
437
  }, children));
445
438
  };
@@ -1,6 +1,5 @@
1
1
  import { bindKeymapArrayWithCommand, bindKeymapWithCommand, moveLeft, moveRight, selectColumn, selectRow, selectTable, shiftArrowUp } from '@atlaskit/editor-common/keymaps';
2
2
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
3
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
4
3
  import { arrowLeftFromTable, arrowRightFromTable, modASelectTable, selectColumns, selectRows, shiftArrowUpFromTable } from '../commands/selection';
5
4
  export function tableSelectionKeymapPlugin(editorSelectionAPI) {
6
5
  const list = {};
@@ -9,9 +8,7 @@ export function tableSelectionKeymapPlugin(editorSelectionAPI) {
9
8
  bindKeymapArrayWithCommand(selectColumn, selectColumns(editorSelectionAPI)(true), list);
10
9
  bindKeymapArrayWithCommand(selectRow, selectRows(editorSelectionAPI)(true), list);
11
10
  bindKeymapWithCommand(shiftArrowUp.common, shiftArrowUpFromTable(editorSelectionAPI)(), list);
12
- if (getBooleanFF('platform.editor.table.cmd-a-select-table')) {
13
- bindKeymapWithCommand(selectTable.common, modASelectTable(editorSelectionAPI)(), list);
14
- }
11
+ bindKeymapWithCommand(selectTable.common, modASelectTable(editorSelectionAPI)(), list);
15
12
  return keymap(list);
16
13
  }
17
14
  export default tableSelectionKeymapPlugin;
@@ -15,7 +15,6 @@ import { browser } from '@atlaskit/editor-common/utils';
15
15
  import { chainCommands } from '@atlaskit/editor-prosemirror/commands';
16
16
  import { akEditorGutterPaddingDynamic } from '@atlaskit/editor-shared-styles';
17
17
  import { findTable } from '@atlaskit/editor-tables/utils';
18
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
19
18
  import { setTableAlignmentWithTableContentWithPosWithAnalytics } from '../commands-with-analytics';
20
19
  import { updateWidthToWidest } from '../commands/misc';
21
20
  import { META_KEYS } from '../pm-plugins/table-analytics';
@@ -302,18 +301,16 @@ export var TableResizer = function TableResizer(_ref) {
302
301
  }
303
302
  displayGapCursor(true);
304
303
  dispatch(tr);
305
- if (getBooleanFF('platform.editor.a11y-table-resizing_uapcv')) {
306
- if (delta.width < 0) {
307
- var _pluginInjectionApi$a3;
308
- pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a3 = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a3 === void 0 || _pluginInjectionApi$a3.actions.ariaNotify(formatMessage(messages.tableSizeDecreaseScreenReaderInformation, {
309
- newWidth: newWidth
310
- }));
311
- } else if (delta.width > 0) {
312
- var _pluginInjectionApi$a4;
313
- pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a4 = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a4 === void 0 || _pluginInjectionApi$a4.actions.ariaNotify(formatMessage(messages.tableSizeIncreaseScreenReaderInformation, {
314
- newWidth: newWidth
315
- }));
316
- }
304
+ if (delta.width < 0) {
305
+ var _pluginInjectionApi$a3;
306
+ pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a3 = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a3 === void 0 || _pluginInjectionApi$a3.actions.ariaNotify(formatMessage(messages.tableSizeDecreaseScreenReaderInformation, {
307
+ newWidth: newWidth
308
+ }));
309
+ } else if (delta.width > 0) {
310
+ var _pluginInjectionApi$a4;
311
+ pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a4 = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a4 === void 0 || _pluginInjectionApi$a4.actions.ariaNotify(formatMessage(messages.tableSizeIncreaseScreenReaderInformation, {
312
+ newWidth: newWidth
313
+ }));
317
314
  }
318
315
 
319
316
  // Hide guidelines when resizing stops
@@ -365,45 +362,41 @@ export var TableResizer = function TableResizer(_ref) {
365
362
  return;
366
363
  }, [areResizeMetaKeysPressed]);
367
364
  useLayoutEffect(function () {
368
- if (getBooleanFF('platform.editor.a11y-table-resizing_uapcv')) {
369
- if (!resizerRef.current) {
365
+ if (!resizerRef.current) {
366
+ return;
367
+ }
368
+ var resizeHandleThumbEl = resizerRef.current.getResizerThumbEl();
369
+ var globalKeyDownHandler = function globalKeyDownHandler(event) {
370
+ var metaKey = browser.mac ? event.metaKey : event.ctrlKey;
371
+ if (!isTableSelected) {
370
372
  return;
371
373
  }
372
- var resizeHandleThumbEl = resizerRef.current.getResizerThumbEl();
373
- var globalKeyDownHandler = function globalKeyDownHandler(event) {
374
- var metaKey = browser.mac ? event.metaKey : event.ctrlKey;
375
- if (!isTableSelected) {
374
+ if (event.altKey && event.shiftKey && metaKey && event.code === 'KeyR') {
375
+ event.preventDefault();
376
+ if (!resizeHandleThumbEl) {
376
377
  return;
377
378
  }
378
- if (event.altKey && event.shiftKey && metaKey && event.code === 'KeyR') {
379
- event.preventDefault();
380
- if (!resizeHandleThumbEl) {
381
- return;
382
- }
383
- resizeHandleThumbEl.focus();
384
- resizeHandleThumbEl.scrollIntoView({
385
- behavior: 'smooth',
386
- block: 'center',
387
- inline: 'nearest'
388
- });
389
- }
390
- };
391
- var editorViewDom = editorView === null || editorView === void 0 ? void 0 : editorView.dom;
392
- editorViewDom === null || editorViewDom === void 0 || editorViewDom.addEventListener('keydown', globalKeyDownHandler);
393
- resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 || resizeHandleThumbEl.addEventListener('keydown', handleKeyDown);
394
- resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 || resizeHandleThumbEl.addEventListener('keyup', handleKeyUp);
395
- return function () {
396
- editorViewDom === null || editorViewDom === void 0 || editorViewDom.removeEventListener('keydown', globalKeyDownHandler);
397
- resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 || resizeHandleThumbEl.removeEventListener('keydown', handleKeyDown);
398
- resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 || resizeHandleThumbEl.removeEventListener('keyup', handleKeyUp);
399
- };
400
- }
379
+ resizeHandleThumbEl.focus();
380
+ resizeHandleThumbEl.scrollIntoView({
381
+ behavior: 'smooth',
382
+ block: 'center',
383
+ inline: 'nearest'
384
+ });
385
+ }
386
+ };
387
+ var editorViewDom = editorView === null || editorView === void 0 ? void 0 : editorView.dom;
388
+ editorViewDom === null || editorViewDom === void 0 || editorViewDom.addEventListener('keydown', globalKeyDownHandler);
389
+ resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 || resizeHandleThumbEl.addEventListener('keydown', handleKeyDown);
390
+ resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 || resizeHandleThumbEl.addEventListener('keyup', handleKeyUp);
391
+ return function () {
392
+ editorViewDom === null || editorViewDom === void 0 || editorViewDom.removeEventListener('keydown', globalKeyDownHandler);
393
+ resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 || resizeHandleThumbEl.removeEventListener('keydown', handleKeyDown);
394
+ resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 || resizeHandleThumbEl.removeEventListener('keyup', handleKeyUp);
395
+ };
401
396
  }, [resizerRef, editorView, handleResizeStop, isTableSelected, handleKeyDown, handleKeyUp]);
402
397
  useLayoutEffect(function () {
403
- if (getBooleanFF('platform.editor.a11y-table-resizing_uapcv')) {
404
- var _updateTooltip$curren;
405
- (_updateTooltip$curren = updateTooltip.current) === null || _updateTooltip$curren === void 0 || _updateTooltip$curren.call(updateTooltip);
406
- }
398
+ var _updateTooltip$curren;
399
+ (_updateTooltip$curren = updateTooltip.current) === null || _updateTooltip$curren === void 0 || _updateTooltip$curren.call(updateTooltip);
407
400
  }, [width]);
408
401
  var resizeRatio = !isTableAlignmentEnabled || isTableAlignmentEnabled && normaliseAlignment(node.attrs.layout) === ALIGN_CENTER ? 2 : 1;
409
402
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ResizerNext, {
@@ -426,13 +419,13 @@ export var TableResizer = function TableResizer(_ref) {
426
419
  needExtendedResizeZone: !isTableSelected,
427
420
  appearance: isTableSelected && isWholeTableInDanger ? 'danger' : undefined,
428
421
  handleHighlight: "shadow",
429
- handleTooltipContent: getBooleanFF('platform.editor.a11y-table-resizing_uapcv') ? function (_ref4) {
422
+ handleTooltipContent: function handleTooltipContent(_ref4) {
430
423
  var update = _ref4.update;
431
424
  updateTooltip.current = update;
432
425
  return /*#__PURE__*/React.createElement(ToolTipContent, {
433
426
  description: formatMessage(messages.resizeTable),
434
427
  keymap: focusTableResizer
435
428
  });
436
- } : formatMessage(messages.resizeTable)
429
+ }
437
430
  }, children));
438
431
  };
@@ -1,6 +1,5 @@
1
1
  import { bindKeymapArrayWithCommand, bindKeymapWithCommand, moveLeft, moveRight, selectColumn, selectRow, selectTable, shiftArrowUp } from '@atlaskit/editor-common/keymaps';
2
2
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
3
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
4
3
  import { arrowLeftFromTable, arrowRightFromTable, modASelectTable, selectColumns, selectRows, shiftArrowUpFromTable } from '../commands/selection';
5
4
  export function tableSelectionKeymapPlugin(editorSelectionAPI) {
6
5
  var list = {};
@@ -9,9 +8,7 @@ export function tableSelectionKeymapPlugin(editorSelectionAPI) {
9
8
  bindKeymapArrayWithCommand(selectColumn, selectColumns(editorSelectionAPI)(true), list);
10
9
  bindKeymapArrayWithCommand(selectRow, selectRows(editorSelectionAPI)(true), list);
11
10
  bindKeymapWithCommand(shiftArrowUp.common, shiftArrowUpFromTable(editorSelectionAPI)(), list);
12
- if (getBooleanFF('platform.editor.table.cmd-a-select-table')) {
13
- bindKeymapWithCommand(selectTable.common, modASelectTable(editorSelectionAPI)(), list);
14
- }
11
+ bindKeymapWithCommand(selectTable.common, modASelectTable(editorSelectionAPI)(), list);
15
12
  return keymap(list);
16
13
  }
17
14
  export default tableSelectionKeymapPlugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "7.19.8",
3
+ "version": "7.19.10",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -31,7 +31,7 @@
31
31
  "@atlaskit/adf-schema": "^39.0.3",
32
32
  "@atlaskit/button": "^18.2.0",
33
33
  "@atlaskit/custom-steps": "^0.4.0",
34
- "@atlaskit/editor-common": "^84.1.0",
34
+ "@atlaskit/editor-common": "^84.3.0",
35
35
  "@atlaskit/editor-palette": "1.6.0",
36
36
  "@atlaskit/editor-plugin-accessibility-utils": "^1.1.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^1.4.0",
@@ -102,18 +102,12 @@
102
102
  }
103
103
  },
104
104
  "platform-feature-flags": {
105
- "platform.editor.a11y-table-resizing_uapcv": {
106
- "type": "boolean"
107
- },
108
105
  "platform.editor.a11y-help-dialog-shortcut-keys-position_aghfg": {
109
106
  "type": "boolean"
110
107
  },
111
108
  "platform.editor.transform-slice-for-nested-expand": {
112
109
  "type": "boolean"
113
110
  },
114
- "platform.editor.table.cmd-a-select-table": {
115
- "type": "boolean"
116
- },
117
111
  "platform.editor.table.use-shared-state-hook": {
118
112
  "type": "boolean"
119
113
  },
@@ -24,7 +24,6 @@ import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/stat
24
24
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
25
25
  import { akEditorGutterPaddingDynamic } from '@atlaskit/editor-shared-styles';
26
26
  import { findTable } from '@atlaskit/editor-tables/utils';
27
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
28
27
  import { token } from '@atlaskit/tokens';
29
28
 
30
29
  import { setTableAlignmentWithTableContentWithPosWithAnalytics } from '../commands-with-analytics';
@@ -560,20 +559,18 @@ export const TableResizer = ({
560
559
  displayGapCursor(true);
561
560
  dispatch(tr);
562
561
 
563
- if (getBooleanFF('platform.editor.a11y-table-resizing_uapcv')) {
564
- if (delta.width < 0) {
565
- pluginInjectionApi?.accessibilityUtils?.actions.ariaNotify(
566
- formatMessage(messages.tableSizeDecreaseScreenReaderInformation, {
567
- newWidth: newWidth,
568
- }),
569
- );
570
- } else if (delta.width > 0) {
571
- pluginInjectionApi?.accessibilityUtils?.actions.ariaNotify(
572
- formatMessage(messages.tableSizeIncreaseScreenReaderInformation, {
573
- newWidth: newWidth,
574
- }),
575
- );
576
- }
562
+ if (delta.width < 0) {
563
+ pluginInjectionApi?.accessibilityUtils?.actions.ariaNotify(
564
+ formatMessage(messages.tableSizeDecreaseScreenReaderInformation, {
565
+ newWidth: newWidth,
566
+ }),
567
+ );
568
+ } else if (delta.width > 0) {
569
+ pluginInjectionApi?.accessibilityUtils?.actions.ariaNotify(
570
+ formatMessage(messages.tableSizeIncreaseScreenReaderInformation, {
571
+ newWidth: newWidth,
572
+ }),
573
+ );
577
574
  }
578
575
 
579
576
  // Hide guidelines when resizing stops
@@ -658,49 +655,45 @@ export const TableResizer = ({
658
655
  );
659
656
 
660
657
  useLayoutEffect(() => {
661
- if (getBooleanFF('platform.editor.a11y-table-resizing_uapcv')) {
662
- if (!resizerRef.current) {
658
+ if (!resizerRef.current) {
659
+ return;
660
+ }
661
+ const resizeHandleThumbEl = resizerRef.current.getResizerThumbEl();
662
+
663
+ const globalKeyDownHandler = (event: KeyboardEvent): void => {
664
+ const metaKey = browser.mac ? event.metaKey : event.ctrlKey;
665
+
666
+ if (!isTableSelected) {
663
667
  return;
664
668
  }
665
- const resizeHandleThumbEl = resizerRef.current.getResizerThumbEl();
666
-
667
- const globalKeyDownHandler = (event: KeyboardEvent): void => {
668
- const metaKey = browser.mac ? event.metaKey : event.ctrlKey;
669
+ if (event.altKey && event.shiftKey && metaKey && event.code === 'KeyR') {
670
+ event.preventDefault();
669
671
 
670
- if (!isTableSelected) {
672
+ if (!resizeHandleThumbEl) {
671
673
  return;
672
674
  }
673
- if (event.altKey && event.shiftKey && metaKey && event.code === 'KeyR') {
674
- event.preventDefault();
675
+ resizeHandleThumbEl.focus();
676
+ resizeHandleThumbEl.scrollIntoView({
677
+ behavior: 'smooth',
678
+ block: 'center',
679
+ inline: 'nearest',
680
+ });
681
+ }
682
+ };
675
683
 
676
- if (!resizeHandleThumbEl) {
677
- return;
678
- }
679
- resizeHandleThumbEl.focus();
680
- resizeHandleThumbEl.scrollIntoView({
681
- behavior: 'smooth',
682
- block: 'center',
683
- inline: 'nearest',
684
- });
685
- }
686
- };
687
-
688
- const editorViewDom = editorView?.dom as HTMLElement | undefined;
689
- editorViewDom?.addEventListener('keydown', globalKeyDownHandler);
690
- resizeHandleThumbEl?.addEventListener('keydown', handleKeyDown);
691
- resizeHandleThumbEl?.addEventListener('keyup', handleKeyUp);
692
- return () => {
693
- editorViewDom?.removeEventListener('keydown', globalKeyDownHandler);
694
- resizeHandleThumbEl?.removeEventListener('keydown', handleKeyDown);
695
- resizeHandleThumbEl?.removeEventListener('keyup', handleKeyUp);
696
- };
697
- }
684
+ const editorViewDom = editorView?.dom as HTMLElement | undefined;
685
+ editorViewDom?.addEventListener('keydown', globalKeyDownHandler);
686
+ resizeHandleThumbEl?.addEventListener('keydown', handleKeyDown);
687
+ resizeHandleThumbEl?.addEventListener('keyup', handleKeyUp);
688
+ return () => {
689
+ editorViewDom?.removeEventListener('keydown', globalKeyDownHandler);
690
+ resizeHandleThumbEl?.removeEventListener('keydown', handleKeyDown);
691
+ resizeHandleThumbEl?.removeEventListener('keyup', handleKeyUp);
692
+ };
698
693
  }, [resizerRef, editorView, handleResizeStop, isTableSelected, handleKeyDown, handleKeyUp]);
699
694
 
700
695
  useLayoutEffect(() => {
701
- if (getBooleanFF('platform.editor.a11y-table-resizing_uapcv')) {
702
- updateTooltip.current?.();
703
- }
696
+ updateTooltip.current?.();
704
697
  }, [width]);
705
698
 
706
699
  const resizeRatio =
@@ -731,19 +724,15 @@ export const TableResizer = ({
731
724
  needExtendedResizeZone={!isTableSelected}
732
725
  appearance={isTableSelected && isWholeTableInDanger ? 'danger' : undefined}
733
726
  handleHighlight="shadow"
734
- handleTooltipContent={
735
- getBooleanFF('platform.editor.a11y-table-resizing_uapcv')
736
- ? ({ update }) => {
737
- updateTooltip.current = update;
738
- return (
739
- <ToolTipContent
740
- description={formatMessage(messages.resizeTable)}
741
- keymap={focusTableResizer}
742
- />
743
- );
744
- }
745
- : formatMessage(messages.resizeTable)
746
- }
727
+ handleTooltipContent={({ update }) => {
728
+ updateTooltip.current = update;
729
+ return (
730
+ <ToolTipContent
731
+ description={formatMessage(messages.resizeTable)}
732
+ keymap={focusTableResizer}
733
+ />
734
+ );
735
+ }}
747
736
  >
748
737
  {children}
749
738
  </ResizerNext>
@@ -11,7 +11,6 @@ import {
11
11
  import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
12
12
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
13
13
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
14
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
15
14
 
16
15
  import {
17
16
  arrowLeftFromTable,
@@ -38,9 +37,7 @@ export function tableSelectionKeymapPlugin(
38
37
 
39
38
  bindKeymapWithCommand(shiftArrowUp.common!, shiftArrowUpFromTable(editorSelectionAPI)(), list);
40
39
 
41
- if (getBooleanFF('platform.editor.table.cmd-a-select-table')) {
42
- bindKeymapWithCommand(selectTable.common!, modASelectTable(editorSelectionAPI)(), list);
43
- }
40
+ bindKeymapWithCommand(selectTable.common!, modASelectTable(editorSelectionAPI)(), list);
44
41
 
45
42
  return keymap(list) as SafePlugin;
46
43
  }