@atlaskit/editor-plugin-table 7.19.10 → 7.19.12

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 (64) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/cjs/commands/column-resize.js +1 -1
  3. package/dist/cjs/commands/selection.js +25 -4
  4. package/dist/cjs/plugin.js +59 -56
  5. package/dist/cjs/pm-plugins/drag-and-drop/commands-with-analytics.js +23 -9
  6. package/dist/cjs/pm-plugins/keymap.js +6 -6
  7. package/dist/cjs/pm-plugins/main.js +1 -1
  8. package/dist/cjs/pm-plugins/table-selection-keymap.js +6 -3
  9. package/dist/cjs/toolbar.js +8 -5
  10. package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +3 -2
  11. package/dist/cjs/ui/FloatingDragMenu/index.js +5 -3
  12. package/dist/cjs/ui/TableFloatingControls/index.js +8 -2
  13. package/dist/cjs/utils/drag-menu.js +5 -1
  14. package/dist/es2019/commands/column-resize.js +2 -2
  15. package/dist/es2019/commands/selection.js +25 -4
  16. package/dist/es2019/plugin.js +11 -7
  17. package/dist/es2019/pm-plugins/drag-and-drop/commands-with-analytics.js +18 -3
  18. package/dist/es2019/pm-plugins/keymap.js +7 -7
  19. package/dist/es2019/pm-plugins/main.js +2 -2
  20. package/dist/es2019/pm-plugins/table-selection-keymap.js +6 -3
  21. package/dist/es2019/toolbar.js +8 -5
  22. package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +3 -2
  23. package/dist/es2019/ui/FloatingDragMenu/index.js +6 -4
  24. package/dist/es2019/ui/TableFloatingControls/index.js +9 -3
  25. package/dist/es2019/utils/drag-menu.js +6 -2
  26. package/dist/esm/commands/column-resize.js +2 -2
  27. package/dist/esm/commands/selection.js +25 -4
  28. package/dist/esm/plugin.js +60 -57
  29. package/dist/esm/pm-plugins/drag-and-drop/commands-with-analytics.js +23 -9
  30. package/dist/esm/pm-plugins/keymap.js +7 -7
  31. package/dist/esm/pm-plugins/main.js +2 -2
  32. package/dist/esm/pm-plugins/table-selection-keymap.js +6 -3
  33. package/dist/esm/toolbar.js +8 -5
  34. package/dist/esm/ui/FloatingDragMenu/DragMenu.js +3 -2
  35. package/dist/esm/ui/FloatingDragMenu/index.js +6 -4
  36. package/dist/esm/ui/TableFloatingControls/index.js +9 -3
  37. package/dist/esm/utils/drag-menu.js +5 -1
  38. package/dist/types/commands/selection.d.ts +4 -2
  39. package/dist/types/pm-plugins/drag-and-drop/commands-with-analytics.d.ts +4 -2
  40. package/dist/types/pm-plugins/table-selection-keymap.d.ts +3 -3
  41. package/dist/types/toolbar.d.ts +2 -2
  42. package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +3 -1
  43. package/dist/types/ui/FloatingDragMenu/index.d.ts +3 -1
  44. package/dist/types/utils/drag-menu.d.ts +2 -1
  45. package/dist/types-ts4.5/commands/selection.d.ts +4 -2
  46. package/dist/types-ts4.5/pm-plugins/drag-and-drop/commands-with-analytics.d.ts +4 -2
  47. package/dist/types-ts4.5/pm-plugins/table-selection-keymap.d.ts +3 -3
  48. package/dist/types-ts4.5/toolbar.d.ts +2 -2
  49. package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +3 -1
  50. package/dist/types-ts4.5/ui/FloatingDragMenu/index.d.ts +3 -1
  51. package/dist/types-ts4.5/utils/drag-menu.d.ts +2 -1
  52. package/package.json +9 -6
  53. package/src/commands/column-resize.ts +2 -2
  54. package/src/commands/selection.ts +49 -4
  55. package/src/plugin.tsx +8 -7
  56. package/src/pm-plugins/drag-and-drop/commands-with-analytics.ts +43 -3
  57. package/src/pm-plugins/keymap.ts +23 -7
  58. package/src/pm-plugins/main.ts +2 -2
  59. package/src/pm-plugins/table-selection-keymap.ts +18 -6
  60. package/src/toolbar.tsx +7 -1
  61. package/src/ui/FloatingDragMenu/DragMenu.tsx +7 -0
  62. package/src/ui/FloatingDragMenu/index.tsx +9 -2
  63. package/src/ui/TableFloatingControls/index.tsx +12 -4
  64. package/src/utils/drag-menu.ts +8 -1
@@ -18,7 +18,7 @@ type AlignmentIcon = {
18
18
  value: AlignmentOptions;
19
19
  icon: React.ComponentClass<any>;
20
20
  };
21
- export declare const getAlignmentOptionsConfig: (editorState: EditorState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorContainerWidth: GetEditorContainerWidth, getDomRef: (editorView: EditorView) => HTMLElement | undefined, editorView: EditorView | null, shouldUseIncreasedScalingPercent: boolean) => Array<FloatingToolbarDropdown<Command>>;
21
+ export declare const getAlignmentOptionsConfig: (editorState: EditorState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorContainerWidth: GetEditorContainerWidth, getDomRef: (editorView: EditorView) => HTMLElement | undefined, editorView: EditorView | null, shouldUseIncreasedScalingPercent: boolean, isFullWidthEditor?: boolean) => Array<FloatingToolbarDropdown<Command>>;
22
22
  export declare const getSelectedAlignmentIcon: (alignmentIcons: AlignmentIcon[], selectedNode: PMNode) => AlignmentIcon | undefined;
23
- export declare const isLayoutOptionDisabled: (selectedNode: PMNode, getEditorContainerWidth: GetEditorContainerWidth, getDomRef: (editorView: EditorView) => HTMLElement | undefined, editorView: EditorView | null, shouldUseIncreasedScalingPercent: boolean) => boolean;
23
+ export declare const isLayoutOptionDisabled: (selectedNode: PMNode, getEditorContainerWidth: GetEditorContainerWidth, getDomRef: (editorView: EditorView) => HTMLElement | undefined, editorView: EditorView | null, shouldUseIncreasedScalingPercent: boolean, isFullWidthEditor: boolean | undefined) => boolean;
24
24
  export {};
@@ -5,6 +5,7 @@ import { jsx } from '@emotion/react';
5
5
  import type { WrappedComponentProps } from 'react-intl-next';
6
6
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
7
7
  import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
8
+ import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
8
9
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
9
10
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
10
11
  import type { PluginConfig, TableDirection } from '../../types';
@@ -29,8 +30,9 @@ type DragMenuProps = {
29
30
  shouldUseIncreasedScalingPercent?: boolean;
30
31
  isTableFixedColumnWidthsOptionEnabled?: boolean;
31
32
  tableSortColumnReorder?: boolean;
33
+ ariaNotifyPlugin?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void;
32
34
  };
33
- export declare const DragMenu: React.MemoExoticComponent<({ direction, index, target, isOpen, editorView, tableNode, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, fitHeight, fitWidth, mountPoint, scrollableElement, boundariesElement, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent, isTableFixedColumnWidthsOptionEnabled, tableSortColumnReorder, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
35
+ export declare const DragMenu: React.MemoExoticComponent<({ direction, index, target, isOpen, editorView, tableNode, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, fitHeight, fitWidth, mountPoint, scrollableElement, boundariesElement, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent, isTableFixedColumnWidthsOptionEnabled, tableSortColumnReorder, ariaNotifyPlugin, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
34
36
  declare const _default: React.FC<import("react-intl-next").WithIntlProps<DragMenuProps & WrappedComponentProps>> & {
35
37
  WrappedComponent: React.ComponentType<DragMenuProps & WrappedComponentProps>;
36
38
  };
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
3
  import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
4
+ import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
4
5
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
5
6
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
7
  import type { RowStickyState } from '../../pm-plugins/sticky-headers';
@@ -22,9 +23,10 @@ export interface Props {
22
23
  pluginConfig?: PluginConfig;
23
24
  isTableScalingEnabled?: boolean;
24
25
  getEditorFeatureFlags?: GetEditorFeatureFlags;
26
+ ariaNotifyPlugin?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void;
25
27
  }
26
28
  declare const FloatingDragMenu: {
27
- ({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, tableNode, direction, index, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, stickyHeaders, pluginConfig, isTableScalingEnabled, getEditorFeatureFlags, }: Props): JSX.Element | null;
29
+ ({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, tableNode, direction, index, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, stickyHeaders, pluginConfig, isTableScalingEnabled, getEditorFeatureFlags, ariaNotifyPlugin, }: Props): JSX.Element | null;
28
30
  displayName: string;
29
31
  };
30
32
  export default FloatingDragMenu;
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
3
  import type { Command, DropdownOptionT, GetEditorContainerWidth, IconProps } from '@atlaskit/editor-common/types';
4
+ import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
4
5
  import type { Selection } from '@atlaskit/editor-prosemirror/state';
5
6
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
7
  import type { Rect, TableMap } from '@atlaskit/editor-tables/table-map';
@@ -13,4 +14,4 @@ export interface DragMenuConfig extends Omit<DropdownOptionT<Command>, 'icon'> {
13
14
  icon?: React.ComponentType<React.PropsWithChildren<IconProps>>;
14
15
  keymap?: string;
15
16
  }
16
- export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, hasMergedCellsInTable: boolean, editorView: EditorView, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean, tableDuplicateCellColouring?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, tableSortColumnReorder?: boolean) => DragMenuConfig[];
17
+ export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, hasMergedCellsInTable: boolean, editorView: EditorView, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean, tableDuplicateCellColouring?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, tableSortColumnReorder?: boolean, ariaNotifyPlugin?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined) => DragMenuConfig[];
@@ -1,4 +1,6 @@
1
+ import { type IntlShape } from 'react-intl-next/src/types';
1
2
  import type { Command, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
+ import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
2
4
  import type tablePlugin from '../plugin';
3
5
  export declare enum TableSelectionDirection {
4
6
  TopToBottom = "TopToBottom",
@@ -6,7 +8,7 @@ export declare enum TableSelectionDirection {
6
8
  }
7
9
  export declare const arrowLeftFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
8
10
  export declare const arrowRightFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
9
- export declare const selectColumns: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => (triggeredByKeyboard?: boolean) => Command;
10
- export declare const selectRows: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => (triggeredByKeyboard?: boolean) => Command;
11
+ export declare const selectColumns: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined, ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined, getIntl?: () => IntlShape) => (triggeredByKeyboard?: boolean) => Command;
12
+ export declare const selectRows: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined, ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined, getIntl?: () => IntlShape) => (triggeredByKeyboard?: boolean) => Command;
11
13
  export declare const shiftArrowUpFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
12
14
  export declare const modASelectTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
@@ -1,9 +1,11 @@
1
+ import { type IntlShape } from 'react-intl-next/src/types';
1
2
  import { INPUT_METHOD, TABLE_STATUS } from '@atlaskit/editor-common/analytics';
2
3
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
4
  import type { Command } from '@atlaskit/editor-common/types';
5
+ import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
4
6
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
5
7
  import type { DraggableData, DraggableType } from '../../types';
6
8
  export declare const clearDropTargetWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.TABLE_CONTEXT_MENU | INPUT_METHOD.DRAG_AND_DROP, sourceType: DraggableType, sourceIndexes: number[] | undefined, status: TABLE_STATUS.CANCELLED | TABLE_STATUS.INVALID, tr?: Transaction) => Command;
7
- export declare const moveSourceWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.TABLE_CONTEXT_MENU | INPUT_METHOD.DRAG_AND_DROP | INPUT_METHOD.SHORTCUT, sourceType: DraggableType, sourceIndexes: number[], targetIndex: number, tr?: Transaction) => Command;
8
- export declare const moveSourceWithAnalyticsViaShortcut: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (sourceType: DraggableType, direction: DraggableData['direction']) => Command;
9
+ export declare const moveSourceWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined, getIntl?: () => IntlShape) => (inputMethod: INPUT_METHOD.TABLE_CONTEXT_MENU | INPUT_METHOD.DRAG_AND_DROP | INPUT_METHOD.SHORTCUT, sourceType: DraggableType, sourceIndexes: number[], targetIndex: number, tr?: Transaction) => Command;
10
+ export declare const moveSourceWithAnalyticsViaShortcut: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined, getIntl?: () => IntlShape) => (sourceType: DraggableType, direction: DraggableData['direction']) => Command;
9
11
  export declare const cloneSourceWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.TABLE_CONTEXT_MENU | INPUT_METHOD.DRAG_AND_DROP | INPUT_METHOD.SHORTCUT, sourceType: DraggableType, sourceIndexes: number[], targetIndex: number, targetDirection: 'start' | 'end', tr?: Transaction) => Command;
@@ -1,5 +1,5 @@
1
+ import { type IntlShape } from 'react-intl-next/src/types';
1
2
  import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type tablePlugin from '../plugin';
4
- export declare function tableSelectionKeymapPlugin(editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined): SafePlugin;
3
+ import { type PluginInjectionAPI } from '../types';
4
+ export declare function tableSelectionKeymapPlugin(pluginInjectionApi?: PluginInjectionAPI, getIntl?: () => IntlShape): SafePlugin;
5
5
  export default tableSelectionKeymapPlugin;
@@ -18,7 +18,7 @@ type AlignmentIcon = {
18
18
  value: AlignmentOptions;
19
19
  icon: React.ComponentClass<any>;
20
20
  };
21
- export declare const getAlignmentOptionsConfig: (editorState: EditorState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorContainerWidth: GetEditorContainerWidth, getDomRef: (editorView: EditorView) => HTMLElement | undefined, editorView: EditorView | null, shouldUseIncreasedScalingPercent: boolean) => Array<FloatingToolbarDropdown<Command>>;
21
+ export declare const getAlignmentOptionsConfig: (editorState: EditorState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorContainerWidth: GetEditorContainerWidth, getDomRef: (editorView: EditorView) => HTMLElement | undefined, editorView: EditorView | null, shouldUseIncreasedScalingPercent: boolean, isFullWidthEditor?: boolean) => Array<FloatingToolbarDropdown<Command>>;
22
22
  export declare const getSelectedAlignmentIcon: (alignmentIcons: AlignmentIcon[], selectedNode: PMNode) => AlignmentIcon | undefined;
23
- export declare const isLayoutOptionDisabled: (selectedNode: PMNode, getEditorContainerWidth: GetEditorContainerWidth, getDomRef: (editorView: EditorView) => HTMLElement | undefined, editorView: EditorView | null, shouldUseIncreasedScalingPercent: boolean) => boolean;
23
+ export declare const isLayoutOptionDisabled: (selectedNode: PMNode, getEditorContainerWidth: GetEditorContainerWidth, getDomRef: (editorView: EditorView) => HTMLElement | undefined, editorView: EditorView | null, shouldUseIncreasedScalingPercent: boolean, isFullWidthEditor: boolean | undefined) => boolean;
24
24
  export {};
@@ -5,6 +5,7 @@ import { jsx } from '@emotion/react';
5
5
  import type { WrappedComponentProps } from 'react-intl-next';
6
6
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
7
7
  import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
8
+ import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
8
9
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
9
10
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
10
11
  import type { PluginConfig, TableDirection } from '../../types';
@@ -29,8 +30,9 @@ type DragMenuProps = {
29
30
  shouldUseIncreasedScalingPercent?: boolean;
30
31
  isTableFixedColumnWidthsOptionEnabled?: boolean;
31
32
  tableSortColumnReorder?: boolean;
33
+ ariaNotifyPlugin?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void;
32
34
  };
33
- export declare const DragMenu: React.MemoExoticComponent<({ direction, index, target, isOpen, editorView, tableNode, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, fitHeight, fitWidth, mountPoint, scrollableElement, boundariesElement, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent, isTableFixedColumnWidthsOptionEnabled, tableSortColumnReorder, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
35
+ export declare const DragMenu: React.MemoExoticComponent<({ direction, index, target, isOpen, editorView, tableNode, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, fitHeight, fitWidth, mountPoint, scrollableElement, boundariesElement, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent, isTableFixedColumnWidthsOptionEnabled, tableSortColumnReorder, ariaNotifyPlugin, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
34
36
  declare const _default: React.FC<import("react-intl-next").WithIntlProps<DragMenuProps & WrappedComponentProps>> & {
35
37
  WrappedComponent: React.ComponentType<DragMenuProps & WrappedComponentProps>;
36
38
  };
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
3
  import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
4
+ import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
4
5
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
5
6
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
7
  import type { RowStickyState } from '../../pm-plugins/sticky-headers';
@@ -22,9 +23,10 @@ export interface Props {
22
23
  pluginConfig?: PluginConfig;
23
24
  isTableScalingEnabled?: boolean;
24
25
  getEditorFeatureFlags?: GetEditorFeatureFlags;
26
+ ariaNotifyPlugin?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void;
25
27
  }
26
28
  declare const FloatingDragMenu: {
27
- ({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, tableNode, direction, index, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, stickyHeaders, pluginConfig, isTableScalingEnabled, getEditorFeatureFlags, }: Props): JSX.Element | null;
29
+ ({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, tableNode, direction, index, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, stickyHeaders, pluginConfig, isTableScalingEnabled, getEditorFeatureFlags, ariaNotifyPlugin, }: Props): JSX.Element | null;
28
30
  displayName: string;
29
31
  };
30
32
  export default FloatingDragMenu;
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
3
  import type { Command, DropdownOptionT, GetEditorContainerWidth, IconProps } from '@atlaskit/editor-common/types';
4
+ import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
4
5
  import type { Selection } from '@atlaskit/editor-prosemirror/state';
5
6
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
7
  import type { Rect, TableMap } from '@atlaskit/editor-tables/table-map';
@@ -13,4 +14,4 @@ export interface DragMenuConfig extends Omit<DropdownOptionT<Command>, 'icon'> {
13
14
  icon?: React.ComponentType<React.PropsWithChildren<IconProps>>;
14
15
  keymap?: string;
15
16
  }
16
- export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, hasMergedCellsInTable: boolean, editorView: EditorView, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean, tableDuplicateCellColouring?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, tableSortColumnReorder?: boolean) => DragMenuConfig[];
17
+ export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, hasMergedCellsInTable: boolean, editorView: EditorView, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean, tableDuplicateCellColouring?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, tableSortColumnReorder?: boolean, ariaNotifyPlugin?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined) => DragMenuConfig[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "7.19.10",
3
+ "version": "7.19.12",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -29,9 +29,9 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@atlaskit/adf-schema": "^39.0.3",
32
- "@atlaskit/button": "^18.2.0",
32
+ "@atlaskit/button": "^18.4.0",
33
33
  "@atlaskit/custom-steps": "^0.4.0",
34
- "@atlaskit/editor-common": "^84.3.0",
34
+ "@atlaskit/editor-common": "^84.5.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",
@@ -41,7 +41,7 @@
41
41
  "@atlaskit/editor-plugin-selection": "^1.2.0",
42
42
  "@atlaskit/editor-plugin-width": "^1.1.0",
43
43
  "@atlaskit/editor-prosemirror": "4.0.1",
44
- "@atlaskit/editor-shared-styles": "^2.12.0",
44
+ "@atlaskit/editor-shared-styles": "^2.13.0",
45
45
  "@atlaskit/editor-tables": "^2.7.0",
46
46
  "@atlaskit/icon": "^22.6.0",
47
47
  "@atlaskit/menu": "^2.7.0",
@@ -49,10 +49,10 @@
49
49
  "@atlaskit/pragmatic-drag-and-drop": "^1.2.0",
50
50
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^1.4.0",
51
51
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.0",
52
- "@atlaskit/primitives": "^10.1.0",
52
+ "@atlaskit/primitives": "^11.0.0",
53
53
  "@atlaskit/theme": "^12.11.0",
54
54
  "@atlaskit/toggle": "^13.2.0",
55
- "@atlaskit/tokens": "^1.53.0",
55
+ "@atlaskit/tokens": "^1.54.0",
56
56
  "@atlaskit/tooltip": "^18.5.0",
57
57
  "@babel/runtime": "^7.0.0",
58
58
  "@emotion/react": "^11.7.1",
@@ -122,6 +122,9 @@
122
122
  },
123
123
  "platform.editor.a11y-table-context-menu_y4c9c": {
124
124
  "type": "boolean"
125
+ },
126
+ "platform_editor_element_drag_and_drop_ed_24041": {
127
+ "type": "boolean"
125
128
  }
126
129
  }
127
130
  }
@@ -15,7 +15,7 @@ import {
15
15
  isSelectionType,
16
16
  nextCell,
17
17
  } from '@atlaskit/editor-tables/utils';
18
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
18
+ import { fg } from '@atlaskit/platform-feature-flags';
19
19
 
20
20
  import { getDecorations } from '../pm-plugins/decorations/plugin';
21
21
  import {
@@ -320,7 +320,7 @@ export const changeColumnWidthByStep =
320
320
  }
321
321
  const shouldUseIncreasedScalingPercent =
322
322
  isTableScalingWithFixedColumnWidthsOptionEnabled &&
323
- getBooleanFF('platform.editor.table.use-increased-scaling-percent');
323
+ fg('platform.editor.table.use-increased-scaling-percent');
324
324
 
325
325
  const initialResizeState = getResizeState({
326
326
  minWidth: tableCellMinWidth,
@@ -1,3 +1,6 @@
1
+ import { type IntlShape } from 'react-intl-next/src/types';
2
+
3
+ import { tableMessages as messages } from '@atlaskit/editor-common/messages';
1
4
  import type { SelectionSharedState } from '@atlaskit/editor-common/selection';
2
5
  import {
3
6
  GapCursorSelection,
@@ -7,6 +10,7 @@ import {
7
10
  Side,
8
11
  } from '@atlaskit/editor-common/selection';
9
12
  import type { Command, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
13
+ import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
10
14
  import type { Node as PmNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
11
15
  import { Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
12
16
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
@@ -106,7 +110,11 @@ const arrowRightFromCellSelection =
106
110
  };
107
111
 
108
112
  export const selectColumns =
109
- (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) =>
113
+ (
114
+ editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined,
115
+ ariaNotify?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void,
116
+ getIntl?: () => IntlShape,
117
+ ) =>
110
118
  (triggeredByKeyboard = false): Command =>
111
119
  (state, dispatch) => {
112
120
  const { selection } = state;
@@ -120,13 +128,36 @@ export const selectColumns =
120
128
  })(state, dispatch);
121
129
  }
122
130
  if (table && rect) {
123
- return selectColumn(rect.left, undefined, triggeredByKeyboard)(state, dispatch);
131
+ const selectColumnCommand = selectColumn(
132
+ rect.left,
133
+ undefined,
134
+ triggeredByKeyboard,
135
+ )(state, dispatch);
136
+ const map = TableMap.get(table.node);
137
+
138
+ if (ariaNotify && getIntl) {
139
+ ariaNotify(
140
+ getIntl().formatMessage(messages.columnSelected, {
141
+ index: rect.left + 1,
142
+ total: map.width,
143
+ }),
144
+ {
145
+ priority: 'important',
146
+ },
147
+ );
148
+ }
149
+
150
+ return selectColumnCommand;
124
151
  }
125
152
  return false;
126
153
  };
127
154
 
128
155
  export const selectRows =
129
- (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) =>
156
+ (
157
+ editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined,
158
+ ariaNotify?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void,
159
+ getIntl?: () => IntlShape,
160
+ ) =>
130
161
  (triggeredByKeyboard = false): Command =>
131
162
  (state, dispatch) => {
132
163
  const { selection } = state;
@@ -140,7 +171,21 @@ export const selectRows =
140
171
  })(state, dispatch);
141
172
  }
142
173
  if (table && rect) {
143
- return selectRow(rect.top, undefined, triggeredByKeyboard)(state, dispatch);
174
+ const selectRowCommand = selectRow(rect.top, undefined, triggeredByKeyboard)(state, dispatch);
175
+ const map = TableMap.get(table.node);
176
+
177
+ if (ariaNotify && getIntl) {
178
+ ariaNotify(
179
+ getIntl().formatMessage(messages.rowSelected, {
180
+ index: rect.top + 1,
181
+ total: map.height,
182
+ }),
183
+ {
184
+ priority: 'important',
185
+ },
186
+ );
187
+ }
188
+ return selectRowCommand;
144
189
  }
145
190
  return false;
146
191
  };
package/src/plugin.tsx CHANGED
@@ -38,7 +38,7 @@ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
38
38
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
39
39
  import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
40
40
  import { tableEditing } from '@atlaskit/editor-tables/pm-plugins';
41
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
41
+ import { fg } from '@atlaskit/platform-feature-flags';
42
42
 
43
43
  import { insertTableWithSize } from './commands/insert';
44
44
  import { pluginConfig } from './create-plugin-config';
@@ -155,13 +155,14 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
155
155
  );
156
156
  };
157
157
  const editorAnalyticsAPI = api?.analytics?.actions;
158
+ const ariaNotifyPlugin = api?.accessibilityUtils?.actions.ariaNotify;
158
159
 
159
160
  const isTableFixedColumnWidthsOptionEnabled =
160
161
  options?.getEditorFeatureFlags?.().tableWithFixedColumnWidthsOption || false;
161
162
  const shouldUseIncreasedScalingPercent =
162
163
  options?.isTableScalingEnabled &&
163
164
  isTableFixedColumnWidthsOptionEnabled &&
164
- getBooleanFF('platform.editor.table.use-increased-scaling-percent');
165
+ fg('platform.editor.table.use-increased-scaling-percent');
165
166
 
166
167
  const isCellBackgroundDuplicated =
167
168
  options?.getEditorFeatureFlags?.().tableDuplicateCellColouring || false;
@@ -353,7 +354,7 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
353
354
  },
354
355
  {
355
356
  name: 'tableSelectionKeymap',
356
- plugin: () => tableSelectionKeymapPlugin(api?.selection),
357
+ plugin: ({ getIntl }) => tableSelectionKeymapPlugin(api, getIntl),
357
358
  },
358
359
  {
359
360
  name: 'tableEditing',
@@ -399,8 +400,7 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
399
400
  {
400
401
  name: 'tableViewModeSort',
401
402
  plugin: () => {
402
- return getBooleanFF('platform.editor.table.live-pages-sorting_4malx') &&
403
- api?.editorViewMode
403
+ return api?.editorViewMode && fg('platform.editor.table.live-pages-sorting_4malx')
404
404
  ? createViewModeSortPlugin(api.editorViewMode)
405
405
  : undefined;
406
406
  },
@@ -530,8 +530,8 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
530
530
  <>
531
531
  {targetCellPosition &&
532
532
  (tableRef ||
533
- (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') &&
534
- isCellMenuOpenByKeyboard)) &&
533
+ (isCellMenuOpenByKeyboard &&
534
+ fg('platform.editor.a11y-table-context-menu_y4c9c'))) &&
535
535
  !isResizing &&
536
536
  options &&
537
537
  options.allowContextualMenu && (
@@ -607,6 +607,7 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
607
607
  getEditorFeatureFlags={
608
608
  options?.getEditorFeatureFlags || defaultGetEditorFeatureFlags
609
609
  }
610
+ ariaNotifyPlugin={ariaNotifyPlugin}
610
611
  />
611
612
  )}
612
613
  {allowControls && !isDragAndDropEnabled && !isResizing && (
@@ -1,3 +1,5 @@
1
+ import { type IntlShape } from 'react-intl-next/src/types';
2
+
1
3
  import {
2
4
  ACTION_SUBJECT,
3
5
  EVENT_TYPE,
@@ -6,7 +8,9 @@ import {
6
8
  TABLE_STATUS,
7
9
  } from '@atlaskit/editor-common/analytics';
8
10
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
11
+ import { tableMessages as messages } from '@atlaskit/editor-common/messages';
9
12
  import type { Command } from '@atlaskit/editor-common/types';
13
+ import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
10
14
  import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
11
15
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
12
16
  import { findCellRectClosestToPos, getSelectionRect } from '@atlaskit/editor-tables/utils';
@@ -52,7 +56,11 @@ export const clearDropTargetWithAnalytics =
52
56
  };
53
57
 
54
58
  export const moveSourceWithAnalytics =
55
- (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) =>
59
+ (
60
+ editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null,
61
+ ariaNotify?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void,
62
+ getIntl?: () => IntlShape,
63
+ ) =>
56
64
  (
57
65
  inputMethod:
58
66
  | INPUT_METHOD.TABLE_CONTEXT_MENU
@@ -88,13 +96,45 @@ export const moveSourceWithAnalytics =
88
96
  })(editorAnalyticsAPI)((state, dispatch) => {
89
97
  if (dispatch) {
90
98
  moveSource(sourceType, sourceIndexes, targetIndex, tr)(state, dispatch);
99
+ // Only considering single row/column movement for screen reader as only single row/column selection is supported via keyboard atm.
100
+ if (
101
+ (inputMethod === INPUT_METHOD.TABLE_CONTEXT_MENU || INPUT_METHOD.SHORTCUT) &&
102
+ sourceIndexes.length === 1 &&
103
+ ariaNotify &&
104
+ getIntl
105
+ ) {
106
+ const direction = sourceIndexes[0] > targetIndex ? -1 : 1; // -1 for left/up , 1 for right/down
107
+ const { totalRowCount, totalColumnCount } = getSelectedTableInfo(state.selection);
108
+ ariaNotify(
109
+ getIntl().formatMessage(
110
+ sourceType === 'table-row'
111
+ ? direction > 0
112
+ ? messages.rowMovedDown
113
+ : messages.rowMovedUp
114
+ : direction > 0
115
+ ? messages.columnMovedRight
116
+ : messages.columnMovedLeft,
117
+ {
118
+ index: targetIndex + 1,
119
+ total: sourceType === 'table-row' ? totalRowCount : totalColumnCount,
120
+ },
121
+ ),
122
+ {
123
+ priority: 'important',
124
+ },
125
+ );
126
+ }
91
127
  }
92
128
  return true;
93
129
  });
94
130
  };
95
131
 
96
132
  export const moveSourceWithAnalyticsViaShortcut =
97
- (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) =>
133
+ (
134
+ editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null,
135
+ ariaNotify?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void,
136
+ getIntl?: () => IntlShape,
137
+ ) =>
98
138
  (sourceType: DraggableType, direction: DraggableData['direction']): Command =>
99
139
  (state, dispatch) => {
100
140
  const { selection } = state;
@@ -130,7 +170,7 @@ export const moveSourceWithAnalyticsViaShortcut =
130
170
 
131
171
  const targetIndex = getTargetIndex(selectedIndexes, direction);
132
172
 
133
- return moveSourceWithAnalytics(editorAnalyticsAPI)(
173
+ return moveSourceWithAnalytics(editorAnalyticsAPI, ariaNotify, getIntl)(
134
174
  INPUT_METHOD.SHORTCUT,
135
175
  sourceType,
136
176
  selectedIndexes,
@@ -34,7 +34,7 @@ import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
34
34
  import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
35
35
  import { chainCommands } from '@atlaskit/editor-prosemirror/commands';
36
36
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
37
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
37
+ import { fg } from '@atlaskit/platform-feature-flags';
38
38
 
39
39
  import { goToNextCell, moveCursorBackward, setFocusToCellMenu } from '../commands';
40
40
  import {
@@ -139,7 +139,7 @@ export function keymapPlugin(
139
139
  list,
140
140
  );
141
141
 
142
- if (getBooleanFF('platform.editor.a11y-help-dialog-shortcut-keys-position_aghfg')) {
142
+ if (fg('platform.editor.a11y-help-dialog-shortcut-keys-position_aghfg')) {
143
143
  bindKeymapWithCommand(
144
144
  addRowBeforeVO.common!,
145
145
  addRowAroundSelection(editorAnalyticsAPI)('TOP'),
@@ -186,25 +186,41 @@ export function keymapPlugin(
186
186
 
187
187
  bindKeymapWithCommand(
188
188
  moveRowDown.common!,
189
- moveSourceWithAnalyticsViaShortcut(editorAnalyticsAPI)('table-row', 1),
189
+ moveSourceWithAnalyticsViaShortcut(
190
+ editorAnalyticsAPI,
191
+ ariaNotifyPlugin,
192
+ getIntl,
193
+ )('table-row', 1),
190
194
  list,
191
195
  );
192
196
 
193
197
  bindKeymapWithCommand(
194
198
  moveRowUp.common!,
195
- moveSourceWithAnalyticsViaShortcut(editorAnalyticsAPI)('table-row', -1),
199
+ moveSourceWithAnalyticsViaShortcut(
200
+ editorAnalyticsAPI,
201
+ ariaNotifyPlugin,
202
+ getIntl,
203
+ )('table-row', -1),
196
204
  list,
197
205
  );
198
206
 
199
207
  bindKeymapWithCommand(
200
208
  moveColumnLeft.common!,
201
- moveSourceWithAnalyticsViaShortcut(editorAnalyticsAPI)('table-column', -1),
209
+ moveSourceWithAnalyticsViaShortcut(
210
+ editorAnalyticsAPI,
211
+ ariaNotifyPlugin,
212
+ getIntl,
213
+ )('table-column', -1),
202
214
  list,
203
215
  );
204
216
 
205
217
  bindKeymapWithCommand(
206
218
  moveColumnRight.common!,
207
- moveSourceWithAnalyticsViaShortcut(editorAnalyticsAPI)('table-column', 1),
219
+ moveSourceWithAnalyticsViaShortcut(
220
+ editorAnalyticsAPI,
221
+ ariaNotifyPlugin,
222
+ getIntl,
223
+ )('table-column', 1),
208
224
  list,
209
225
  );
210
226
 
@@ -297,7 +313,7 @@ export function keymapPlugin(
297
313
  list,
298
314
  );
299
315
 
300
- if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')) {
316
+ if (fg('platform.editor.a11y-table-context-menu_y4c9c')) {
301
317
  bindKeymapWithCommand(focusToContextMenuTrigger.common!, setFocusToCellMenu(), list);
302
318
  }
303
319
 
@@ -26,7 +26,7 @@ import { findParentDomRefOfType, findParentNodeOfType } from '@atlaskit/editor-p
26
26
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
27
27
  import { TableMap } from '@atlaskit/editor-tables';
28
28
  import { findTable } from '@atlaskit/editor-tables/utils';
29
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
29
+ import { fg } from '@atlaskit/platform-feature-flags';
30
30
 
31
31
  import { addBoldInEmptyHeaderCells, clearHoverSelection, setTableRef } from '../commands';
32
32
  import { stopKeyboardColumnResizing } from '../commands/column-resize';
@@ -292,7 +292,7 @@ export const createPlugin = (
292
292
  }
293
293
 
294
294
  // If a partial paste of nested expand, paste only nested-expand's content */
295
- if (getBooleanFF('platform.editor.transform-slice-for-nested-expand')) {
295
+ if (fg('platform.editor.transform-slice-for-nested-expand')) {
296
296
  slice = transformSliceToRemoveOpenNestedExpand(slice, schema);
297
297
  }
298
298
 
@@ -1,3 +1,5 @@
1
+ import { type IntlShape } from 'react-intl-next/src/types';
2
+
1
3
  import {
2
4
  bindKeymapArrayWithCommand,
3
5
  bindKeymapWithCommand,
@@ -9,7 +11,6 @@ import {
9
11
  shiftArrowUp,
10
12
  } from '@atlaskit/editor-common/keymaps';
11
13
  import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
12
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
13
14
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
14
15
 
15
16
  import {
@@ -20,20 +21,31 @@ import {
20
21
  selectRows,
21
22
  shiftArrowUpFromTable,
22
23
  } from '../commands/selection';
23
- import type tablePlugin from '../plugin';
24
+ import { type PluginInjectionAPI } from '../types';
24
25
 
25
26
  export function tableSelectionKeymapPlugin(
26
- editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined,
27
+ pluginInjectionApi?: PluginInjectionAPI,
28
+ getIntl?: () => IntlShape,
27
29
  ): SafePlugin {
28
30
  const list = {};
31
+ const editorSelectionAPI = pluginInjectionApi?.selection;
32
+ const ariaNotifyPlugin = pluginInjectionApi?.accessibilityUtils?.actions.ariaNotify;
29
33
 
30
34
  bindKeymapWithCommand(moveRight.common!, arrowRightFromTable(editorSelectionAPI)(), list);
31
35
 
32
36
  bindKeymapWithCommand(moveLeft.common!, arrowLeftFromTable(editorSelectionAPI)(), list);
33
37
 
34
- bindKeymapArrayWithCommand(selectColumn, selectColumns(editorSelectionAPI)(true), list);
35
-
36
- bindKeymapArrayWithCommand(selectRow, selectRows(editorSelectionAPI)(true), list);
38
+ bindKeymapArrayWithCommand(
39
+ selectColumn,
40
+ selectColumns(editorSelectionAPI, ariaNotifyPlugin, getIntl)(true),
41
+ list,
42
+ );
43
+
44
+ bindKeymapArrayWithCommand(
45
+ selectRow,
46
+ selectRows(editorSelectionAPI, ariaNotifyPlugin, getIntl)(true),
47
+ list,
48
+ );
37
49
 
38
50
  bindKeymapWithCommand(shiftArrowUp.common!, shiftArrowUpFromTable(editorSelectionAPI)(), list);
39
51