@atlaskit/editor-plugin-table 7.19.8 → 7.19.9
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,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 7.19.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#117916](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/117916)
|
|
8
|
+
[`49fc126d779b0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/49fc126d779b0) -
|
|
9
|
+
ECA11Y-111: A11y table resizing feature flag removal
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 7.19.8
|
|
4
13
|
|
|
5
14
|
### 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 (
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
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 (
|
|
379
|
-
|
|
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
|
-
|
|
383
|
-
|
|
384
|
-
|
|
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
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 || resizeHandleThumbEl.
|
|
404
|
-
|
|
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
|
-
|
|
414
|
-
|
|
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:
|
|
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
|
-
}
|
|
439
|
+
}
|
|
447
440
|
}, children));
|
|
448
441
|
};
|
|
@@ -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 (
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
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 (
|
|
375
|
-
|
|
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
|
-
|
|
379
|
-
|
|
380
|
-
|
|
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
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 ? void 0 : resizeHandleThumbEl.
|
|
400
|
-
|
|
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
|
-
|
|
410
|
-
|
|
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:
|
|
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
|
-
}
|
|
436
|
+
}
|
|
444
437
|
}, children));
|
|
445
438
|
};
|
|
@@ -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 (
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
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 (
|
|
369
|
-
|
|
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
|
-
|
|
373
|
-
|
|
374
|
-
|
|
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
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 || resizeHandleThumbEl.
|
|
394
|
-
|
|
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
|
-
|
|
404
|
-
|
|
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:
|
|
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
|
-
}
|
|
429
|
+
}
|
|
437
430
|
}, children));
|
|
438
431
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "7.19.
|
|
3
|
+
"version": "7.19.9",
|
|
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.
|
|
34
|
+
"@atlaskit/editor-common": "^84.2.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,9 +102,6 @@
|
|
|
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
|
},
|
|
@@ -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 (
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
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 (
|
|
662
|
-
|
|
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
|
-
|
|
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 (!
|
|
672
|
+
if (!resizeHandleThumbEl) {
|
|
671
673
|
return;
|
|
672
674
|
}
|
|
673
|
-
|
|
674
|
-
|
|
675
|
+
resizeHandleThumbEl.focus();
|
|
676
|
+
resizeHandleThumbEl.scrollIntoView({
|
|
677
|
+
behavior: 'smooth',
|
|
678
|
+
block: 'center',
|
|
679
|
+
inline: 'nearest',
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
};
|
|
675
683
|
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
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
|
-
|
|
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
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
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>
|