@atlaskit/editor-plugin-table 7.25.2 → 7.25.4

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 (104) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cjs/commands/column-resize.js +4 -1
  3. package/dist/cjs/commands-with-analytics.js +2 -1
  4. package/dist/cjs/event-handlers.js +3 -2
  5. package/dist/cjs/nodeviews/TableComponent.js +18 -19
  6. package/dist/cjs/nodeviews/TableResizer.js +1 -1
  7. package/dist/cjs/nodeviews/lazy-node-views.js +1 -5
  8. package/dist/cjs/nodeviews/table.js +18 -8
  9. package/dist/cjs/plugin.js +6 -4
  10. package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +10 -5
  11. package/dist/cjs/pm-plugins/keymap.js +2 -2
  12. package/dist/cjs/pm-plugins/main.js +0 -1
  13. package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +6 -4
  14. package/dist/cjs/pm-plugins/table-resizing/plugin.js +2 -2
  15. package/dist/cjs/pm-plugins/table-resizing/utils/resize-state.js +2 -1
  16. package/dist/cjs/pm-plugins/table-resizing/utils/scale-table.js +4 -1
  17. package/dist/cjs/toolbar.js +10 -6
  18. package/dist/cjs/ui/DragHandle/index.js +2 -1
  19. package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +5 -2
  20. package/dist/cjs/ui/FloatingContextualMenu/index.js +4 -2
  21. package/dist/es2019/commands/column-resize.js +4 -1
  22. package/dist/es2019/commands-with-analytics.js +2 -1
  23. package/dist/es2019/event-handlers.js +2 -2
  24. package/dist/es2019/nodeviews/TableComponent.js +17 -19
  25. package/dist/es2019/nodeviews/TableResizer.js +1 -1
  26. package/dist/es2019/nodeviews/lazy-node-views.js +1 -5
  27. package/dist/es2019/nodeviews/table.js +21 -8
  28. package/dist/es2019/plugin.js +6 -4
  29. package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +8 -6
  30. package/dist/es2019/pm-plugins/keymap.js +2 -2
  31. package/dist/es2019/pm-plugins/main.js +1 -2
  32. package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +6 -4
  33. package/dist/es2019/pm-plugins/table-resizing/plugin.js +2 -2
  34. package/dist/es2019/pm-plugins/table-resizing/utils/resize-state.js +3 -3
  35. package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +5 -3
  36. package/dist/es2019/toolbar.js +10 -10
  37. package/dist/es2019/ui/DragHandle/index.js +1 -1
  38. package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +5 -2
  39. package/dist/es2019/ui/FloatingContextualMenu/index.js +4 -2
  40. package/dist/esm/commands/column-resize.js +4 -1
  41. package/dist/esm/commands-with-analytics.js +2 -1
  42. package/dist/esm/event-handlers.js +3 -2
  43. package/dist/esm/nodeviews/TableComponent.js +18 -19
  44. package/dist/esm/nodeviews/TableResizer.js +1 -1
  45. package/dist/esm/nodeviews/lazy-node-views.js +1 -5
  46. package/dist/esm/nodeviews/table.js +18 -8
  47. package/dist/esm/plugin.js +6 -4
  48. package/dist/esm/pm-plugins/drag-and-drop/plugin.js +10 -5
  49. package/dist/esm/pm-plugins/keymap.js +2 -2
  50. package/dist/esm/pm-plugins/main.js +1 -2
  51. package/dist/esm/pm-plugins/table-resizing/event-handlers.js +6 -4
  52. package/dist/esm/pm-plugins/table-resizing/plugin.js +2 -2
  53. package/dist/esm/pm-plugins/table-resizing/utils/resize-state.js +3 -2
  54. package/dist/esm/pm-plugins/table-resizing/utils/scale-table.js +5 -2
  55. package/dist/esm/toolbar.js +10 -6
  56. package/dist/esm/ui/DragHandle/index.js +2 -1
  57. package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +5 -2
  58. package/dist/esm/ui/FloatingContextualMenu/index.js +4 -2
  59. package/dist/types/commands/column-resize.d.ts +2 -1
  60. package/dist/types/commands-with-analytics.d.ts +1 -1
  61. package/dist/types/pm-plugins/drag-and-drop/plugin.d.ts +1 -1
  62. package/dist/types/pm-plugins/table-resizing/event-handlers.d.ts +1 -1
  63. package/dist/types/pm-plugins/table-resizing/plugin.d.ts +1 -1
  64. package/dist/types/pm-plugins/table-resizing/utils/resize-state.d.ts +1 -1
  65. package/dist/types/pm-plugins/table-resizing/utils/scale-table.d.ts +1 -1
  66. package/dist/types/toolbar.d.ts +2 -2
  67. package/dist/types/ui/FloatingContextualMenu/ContextualMenu.d.ts +1 -0
  68. package/dist/types/ui/FloatingContextualMenu/index.d.ts +2 -1
  69. package/dist/types-ts4.5/commands/column-resize.d.ts +2 -1
  70. package/dist/types-ts4.5/commands-with-analytics.d.ts +1 -1
  71. package/dist/types-ts4.5/pm-plugins/drag-and-drop/plugin.d.ts +1 -1
  72. package/dist/types-ts4.5/pm-plugins/table-resizing/event-handlers.d.ts +1 -1
  73. package/dist/types-ts4.5/pm-plugins/table-resizing/plugin.d.ts +1 -1
  74. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/resize-state.d.ts +1 -1
  75. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/scale-table.d.ts +1 -1
  76. package/dist/types-ts4.5/toolbar.d.ts +2 -2
  77. package/dist/types-ts4.5/ui/FloatingContextualMenu/ContextualMenu.d.ts +1 -0
  78. package/dist/types-ts4.5/ui/FloatingContextualMenu/index.d.ts +2 -1
  79. package/package.json +9 -12
  80. package/src/commands/column-resize.ts +7 -2
  81. package/src/commands-with-analytics.ts +2 -0
  82. package/src/event-handlers.ts +2 -1
  83. package/src/nodeviews/TableComponent.tsx +17 -14
  84. package/src/nodeviews/TableResizer.tsx +1 -0
  85. package/src/nodeviews/lazy-node-views.ts +0 -4
  86. package/src/nodeviews/table.tsx +30 -8
  87. package/src/plugin.tsx +8 -2
  88. package/src/pm-plugins/drag-and-drop/plugin.ts +9 -4
  89. package/src/pm-plugins/keymap.ts +2 -0
  90. package/src/pm-plugins/main.ts +0 -4
  91. package/src/pm-plugins/table-resizing/event-handlers.ts +11 -6
  92. package/src/pm-plugins/table-resizing/plugin.ts +2 -0
  93. package/src/pm-plugins/table-resizing/utils/resize-state.ts +5 -3
  94. package/src/pm-plugins/table-resizing/utils/scale-table.ts +6 -3
  95. package/src/toolbar.tsx +10 -1
  96. package/src/ui/DragHandle/index.tsx +1 -1
  97. package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +6 -2
  98. package/src/ui/FloatingContextualMenu/index.tsx +3 -0
  99. package/dist/cjs/nodeviews/ignore-mutation-delegate.js +0 -23
  100. package/dist/es2019/nodeviews/ignore-mutation-delegate.js +0 -20
  101. package/dist/esm/nodeviews/ignore-mutation-delegate.js +0 -17
  102. package/dist/types/nodeviews/ignore-mutation-delegate.d.ts +0 -5
  103. package/dist/types-ts4.5/nodeviews/ignore-mutation-delegate.d.ts +0 -5
  104. package/src/nodeviews/ignore-mutation-delegate.ts +0 -28
@@ -456,7 +456,8 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
456
456
  editorAnalyticsAPI = _this$props10.editorAnalyticsAPI,
457
457
  getEditorContainerWidth = _this$props10.getEditorContainerWidth,
458
458
  getEditorFeatureFlags = _this$props10.getEditorFeatureFlags,
459
- isCellMenuOpenByKeyboard = _this$props10.isCellMenuOpenByKeyboard;
459
+ isCellMenuOpenByKeyboard = _this$props10.isCellMenuOpenByKeyboard,
460
+ isCommentEditor = _this$props10.isCommentEditor;
460
461
  // TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
461
462
  var state = editorView.state,
462
463
  dispatch = editorView.dispatch;
@@ -482,7 +483,9 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
482
483
  dispatch(tr);
483
484
  editorView.dom.focus(); // otherwise cursor disappears from cell
484
485
  }
485
- var shouldUseIncreasedScalingPercent = isTableScalingEnabled && tableWithFixedColumnWidthsOption && fg('platform.editor.table.use-increased-scaling-percent');
486
+ var shouldUseIncreasedScalingPercent = isTableScalingEnabled && (tableWithFixedColumnWidthsOption && fg('platform.editor.table.use-increased-scaling-percent') ||
487
+ // When in comment editor, we need the scaling percent to be 40% while tableWithFixedColumnWidthsOption is not visible
488
+ isCommentEditor);
486
489
  switch (item.value.name) {
487
490
  case 'sort_column_desc':
488
491
  sortColumnWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.CONTEXT_MENU, selectionRect.left, SortOrder.DESC)(state, dispatch);
@@ -22,7 +22,8 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
22
22
  editorAnalyticsAPI = _ref.editorAnalyticsAPI,
23
23
  getEditorContainerWidth = _ref.getEditorContainerWidth,
24
24
  getEditorFeatureFlags = _ref.getEditorFeatureFlags,
25
- isCellMenuOpenByKeyboard = _ref.isCellMenuOpenByKeyboard;
25
+ isCellMenuOpenByKeyboard = _ref.isCellMenuOpenByKeyboard,
26
+ isCommentEditor = _ref.isCommentEditor;
26
27
  // TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
27
28
  var _getPluginState = getPluginState(editorView.state),
28
29
  targetCellPosition = _getPluginState.targetCellPosition,
@@ -72,7 +73,8 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
72
73
  editorAnalyticsAPI: editorAnalyticsAPI,
73
74
  getEditorContainerWidth: getEditorContainerWidth,
74
75
  getEditorFeatureFlags: getEditorFeatureFlags,
75
- isCellMenuOpenByKeyboard: isCellMenuOpenByKeyboard
76
+ isCellMenuOpenByKeyboard: isCellMenuOpenByKeyboard,
77
+ isCommentEditor: isCommentEditor
76
78
  })));
77
79
  };
78
80
  FloatingContextualMenu.displayName = 'FloatingContextualMenu';
@@ -12,11 +12,12 @@ export declare const activateNextResizeArea: ({ direction, ariaNotify, getIntl,
12
12
  ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined;
13
13
  getIntl?: (() => IntlShape) | undefined;
14
14
  }) => Command;
15
- export declare const changeColumnWidthByStep: ({ stepSize, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, ariaNotify, getIntl, }: {
15
+ export declare const changeColumnWidthByStep: ({ stepSize, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, isCommentEditor, ariaNotify, getIntl, }: {
16
16
  stepSize: number;
17
17
  getEditorContainerWidth: GetEditorContainerWidth;
18
18
  isTableScalingEnabled: boolean;
19
19
  isTableFixedColumnWidthsOptionEnabled: boolean;
20
+ isCommentEditor: boolean;
20
21
  ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined;
21
22
  getIntl?: (() => IntlShape) | undefined;
22
23
  originalTr?: Transaction | undefined;
@@ -16,7 +16,7 @@ export declare const splitCellWithAnalytics: (editorAnalyticsAPI: EditorAnalytic
16
16
  export declare const setColorWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, cellColor: string, editorView?: EditorView | null) => Command;
17
17
  export declare const addRowAroundSelection: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (side: RowInsertPosition) => Command;
18
18
  export declare const insertRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isCellbackgroundDuplicated?: boolean) => (inputMethod: InsertRowMethods, options: InsertRowOptions) => Command;
19
- export declare const changeColumnWidthByStepWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled: boolean, isTableFixedColumnWidthsOptionEnabled: boolean, inputMethod: INPUT_METHOD.SHORTCUT, ariaNotify?: ((message: string) => void) | undefined, getIntl?: () => IntlShape) => Command;
19
+ export declare const changeColumnWidthByStepWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled: boolean, isTableFixedColumnWidthsOptionEnabled: boolean, isCommentEditor: boolean, inputMethod: INPUT_METHOD.SHORTCUT, ariaNotify?: ((message: string) => void) | undefined, getIntl?: () => IntlShape) => Command;
20
20
  export declare const insertColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isCellbackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, position: number) => Command;
21
21
  export declare const deleteRowsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TABLE_CONTEXT_MENU, rect: Rect, isHeaderRowRequired: boolean) => Command;
22
22
  export declare const deleteColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TABLE_CONTEXT_MENU, rect: Rect) => Command;
@@ -1,4 +1,4 @@
1
1
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
2
  import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
3
3
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
- export declare const createPlugin: (dispatch: Dispatch, editorAnalyticsAPI?: EditorAnalyticsAPI, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean) => SafePlugin<import("./types").DragAndDropPluginState>;
4
+ export declare const createPlugin: (dispatch: Dispatch, editorAnalyticsAPI?: EditorAnalyticsAPI, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, isCommentEditor?: boolean) => SafePlugin<import("./types").DragAndDropPluginState>;
@@ -1,4 +1,4 @@
1
1
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
2
  import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
- export declare const handleMouseDown: (view: EditorView, event: MouseEvent, localResizeHandlePos: number, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, isTableScalingEnabled: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, isNewColumnResizingEnabled?: boolean, isTableAlignmentEnabled?: boolean) => boolean;
4
+ export declare const handleMouseDown: (view: EditorView, event: MouseEvent, localResizeHandlePos: number, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, isTableScalingEnabled: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, isNewColumnResizingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isCommentEditor?: boolean) => boolean;
@@ -3,4 +3,4 @@ import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
3
3
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
4
  import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
5
5
  import type { ColumnResizingPluginState } from '../../types';
6
- export declare function createPlugin(dispatch: Dispatch<ColumnResizingPluginState>, { lastColumnResizable }: ColumnResizingPluginState, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, editorAnalyticsAPI?: EditorAnalyticsAPI, isTableScalingEnabled?: boolean, isNewColumnResizingEnabled?: boolean, isTableAlignmentEnabled?: boolean): SafePlugin<ColumnResizingPluginState>;
6
+ export declare function createPlugin(dispatch: Dispatch<ColumnResizingPluginState>, { lastColumnResizable }: ColumnResizingPluginState, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, editorAnalyticsAPI?: EditorAnalyticsAPI, isTableScalingEnabled?: boolean, isNewColumnResizingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isCommentEditor?: boolean): SafePlugin<ColumnResizingPluginState>;
@@ -27,4 +27,4 @@ export declare const normaliseTableLayout: (input: string | undefined | null) =>
27
27
  export declare const getNewResizeStateFromSelectedColumns: (rect: Rect, state: EditorState, domAtPos: (pos: number) => {
28
28
  node: Node;
29
29
  offset: number;
30
- }, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean) => ResizeStateWithAnalytics | undefined;
30
+ }, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, isCommentEditor?: boolean) => ResizeStateWithAnalytics | undefined;
@@ -16,5 +16,5 @@ export interface ScaleOptions {
16
16
  export declare const scale: (tableRef: HTMLTableElement, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabledOnCurrentTable?: boolean, shouldUseIncreasedScalingPercent?: boolean) => ResizeState | undefined;
17
17
  export declare const scaleWithParent: (tableRef: HTMLTableElement, parentWidth: number, table: PMNode, start: number, domAtPos: DomAtPos, isTableScalingEnabledOnCurrentTable?: boolean, shouldUseIncreasedScalingPercent?: boolean) => ResizeState;
18
18
  export declare function scaleTableTo(state: ResizeState, maxSize: number): ResizeState;
19
- export declare const previewScaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabled?: boolean, isTableWithFixedColumnWidthsOptionEnabled?: boolean) => void;
19
+ export declare const previewScaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabled?: boolean, isTableWithFixedColumnWidthsOptionEnabled?: boolean, isCommentEditor?: boolean) => void;
20
20
  export declare const scaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabledOnCurrentTable?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (tr: Transaction) => Transaction;
@@ -8,11 +8,11 @@ import { Rect } from '@atlaskit/editor-tables/table-map';
8
8
  import type { TablePluginOptions } from './plugin';
9
9
  import type { AlignmentOptions, PluginConfig, ToolbarMenuConfig, ToolbarMenuContext, ToolbarMenuState } from './types';
10
10
  export declare const getToolbarMenuConfig: (config: ToolbarMenuConfig, state: ToolbarMenuState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingWithFixedColumnWidthsOptionShown?: boolean, areTableColumnWidthsFixed?: boolean) => FloatingToolbarItem<Command>;
11
- export declare const getToolbarCellOptionsConfig: (editorState: EditorState, editorView: EditorView | undefined | null, initialSelectionRect: Rect, { formatMessage }: ToolbarMenuContext, getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => FloatingToolbarDropdown<Command>;
11
+ export declare const getToolbarCellOptionsConfig: (editorState: EditorState, editorView: EditorView | undefined | null, initialSelectionRect: Rect, { formatMessage }: ToolbarMenuContext, getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => FloatingToolbarDropdown<Command>;
12
12
  export declare const getClosestSelectionRect: (state: EditorState) => Rect | undefined;
13
13
  export declare const getClosestSelectionOrTableRect: (state: EditorState) => Rect | undefined;
14
14
  export declare const getToolbarConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorFeatureFlags: GetEditorFeatureFlags, getEditorView: () => EditorView | null, options?: TablePluginOptions, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (config: PluginConfig) => FloatingToolbarHandler;
15
- export declare const getDistributeConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean) => Command;
15
+ export declare const getDistributeConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, isCommentEditor?: boolean) => Command;
16
16
  type AlignmentIcon = {
17
17
  id?: string;
18
18
  value: AlignmentOptions;
@@ -24,6 +24,7 @@ export interface Props {
24
24
  getEditorContainerWidth: GetEditorContainerWidth;
25
25
  getEditorFeatureFlags?: GetEditorFeatureFlags;
26
26
  isCellMenuOpenByKeyboard?: boolean;
27
+ isCommentEditor?: boolean;
27
28
  }
28
29
  export interface State {
29
30
  isSubmenuOpen: boolean;
@@ -19,9 +19,10 @@ export interface Props {
19
19
  pluginConfig?: PluginConfig;
20
20
  editorAnalyticsAPI?: EditorAnalyticsAPI;
21
21
  isCellMenuOpenByKeyboard?: boolean;
22
+ isCommentEditor?: boolean;
22
23
  }
23
24
  declare const FloatingContextualMenu: {
24
- ({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth, getEditorFeatureFlags, isCellMenuOpenByKeyboard, }: Props): jsx.JSX.Element | null;
25
+ ({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth, getEditorFeatureFlags, isCellMenuOpenByKeyboard, isCommentEditor, }: Props): jsx.JSX.Element | null;
25
26
  displayName: string;
26
27
  };
27
28
  export default FloatingContextualMenu;
@@ -12,11 +12,12 @@ export declare const activateNextResizeArea: ({ direction, ariaNotify, getIntl,
12
12
  ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined;
13
13
  getIntl?: (() => IntlShape) | undefined;
14
14
  }) => Command;
15
- export declare const changeColumnWidthByStep: ({ stepSize, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, ariaNotify, getIntl, }: {
15
+ export declare const changeColumnWidthByStep: ({ stepSize, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, isCommentEditor, ariaNotify, getIntl, }: {
16
16
  stepSize: number;
17
17
  getEditorContainerWidth: GetEditorContainerWidth;
18
18
  isTableScalingEnabled: boolean;
19
19
  isTableFixedColumnWidthsOptionEnabled: boolean;
20
+ isCommentEditor: boolean;
20
21
  ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined;
21
22
  getIntl?: (() => IntlShape) | undefined;
22
23
  originalTr?: Transaction | undefined;
@@ -16,7 +16,7 @@ export declare const splitCellWithAnalytics: (editorAnalyticsAPI: EditorAnalytic
16
16
  export declare const setColorWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, cellColor: string, editorView?: EditorView | null) => Command;
17
17
  export declare const addRowAroundSelection: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (side: RowInsertPosition) => Command;
18
18
  export declare const insertRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isCellbackgroundDuplicated?: boolean) => (inputMethod: InsertRowMethods, options: InsertRowOptions) => Command;
19
- export declare const changeColumnWidthByStepWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled: boolean, isTableFixedColumnWidthsOptionEnabled: boolean, inputMethod: INPUT_METHOD.SHORTCUT, ariaNotify?: ((message: string) => void) | undefined, getIntl?: () => IntlShape) => Command;
19
+ export declare const changeColumnWidthByStepWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled: boolean, isTableFixedColumnWidthsOptionEnabled: boolean, isCommentEditor: boolean, inputMethod: INPUT_METHOD.SHORTCUT, ariaNotify?: ((message: string) => void) | undefined, getIntl?: () => IntlShape) => Command;
20
20
  export declare const insertColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isCellbackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, position: number) => Command;
21
21
  export declare const deleteRowsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TABLE_CONTEXT_MENU, rect: Rect, isHeaderRowRequired: boolean) => Command;
22
22
  export declare const deleteColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TABLE_CONTEXT_MENU, rect: Rect) => Command;
@@ -1,4 +1,4 @@
1
1
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
2
  import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
3
3
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
- export declare const createPlugin: (dispatch: Dispatch, editorAnalyticsAPI?: EditorAnalyticsAPI, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean) => SafePlugin<import("./types").DragAndDropPluginState>;
4
+ export declare const createPlugin: (dispatch: Dispatch, editorAnalyticsAPI?: EditorAnalyticsAPI, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, isCommentEditor?: boolean) => SafePlugin<import("./types").DragAndDropPluginState>;
@@ -1,4 +1,4 @@
1
1
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
2
  import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
- export declare const handleMouseDown: (view: EditorView, event: MouseEvent, localResizeHandlePos: number, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, isTableScalingEnabled: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, isNewColumnResizingEnabled?: boolean, isTableAlignmentEnabled?: boolean) => boolean;
4
+ export declare const handleMouseDown: (view: EditorView, event: MouseEvent, localResizeHandlePos: number, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, isTableScalingEnabled: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, isNewColumnResizingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isCommentEditor?: boolean) => boolean;
@@ -3,4 +3,4 @@ import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
3
3
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
4
  import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
5
5
  import type { ColumnResizingPluginState } from '../../types';
6
- export declare function createPlugin(dispatch: Dispatch<ColumnResizingPluginState>, { lastColumnResizable }: ColumnResizingPluginState, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, editorAnalyticsAPI?: EditorAnalyticsAPI, isTableScalingEnabled?: boolean, isNewColumnResizingEnabled?: boolean, isTableAlignmentEnabled?: boolean): SafePlugin<ColumnResizingPluginState>;
6
+ export declare function createPlugin(dispatch: Dispatch<ColumnResizingPluginState>, { lastColumnResizable }: ColumnResizingPluginState, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, editorAnalyticsAPI?: EditorAnalyticsAPI, isTableScalingEnabled?: boolean, isNewColumnResizingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isCommentEditor?: boolean): SafePlugin<ColumnResizingPluginState>;
@@ -27,4 +27,4 @@ export declare const normaliseTableLayout: (input: string | undefined | null) =>
27
27
  export declare const getNewResizeStateFromSelectedColumns: (rect: Rect, state: EditorState, domAtPos: (pos: number) => {
28
28
  node: Node;
29
29
  offset: number;
30
- }, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean) => ResizeStateWithAnalytics | undefined;
30
+ }, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, isCommentEditor?: boolean) => ResizeStateWithAnalytics | undefined;
@@ -16,5 +16,5 @@ export interface ScaleOptions {
16
16
  export declare const scale: (tableRef: HTMLTableElement, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabledOnCurrentTable?: boolean, shouldUseIncreasedScalingPercent?: boolean) => ResizeState | undefined;
17
17
  export declare const scaleWithParent: (tableRef: HTMLTableElement, parentWidth: number, table: PMNode, start: number, domAtPos: DomAtPos, isTableScalingEnabledOnCurrentTable?: boolean, shouldUseIncreasedScalingPercent?: boolean) => ResizeState;
18
18
  export declare function scaleTableTo(state: ResizeState, maxSize: number): ResizeState;
19
- export declare const previewScaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabled?: boolean, isTableWithFixedColumnWidthsOptionEnabled?: boolean) => void;
19
+ export declare const previewScaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabled?: boolean, isTableWithFixedColumnWidthsOptionEnabled?: boolean, isCommentEditor?: boolean) => void;
20
20
  export declare const scaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabledOnCurrentTable?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (tr: Transaction) => Transaction;
@@ -8,11 +8,11 @@ import { Rect } from '@atlaskit/editor-tables/table-map';
8
8
  import type { TablePluginOptions } from './plugin';
9
9
  import type { AlignmentOptions, PluginConfig, ToolbarMenuConfig, ToolbarMenuContext, ToolbarMenuState } from './types';
10
10
  export declare const getToolbarMenuConfig: (config: ToolbarMenuConfig, state: ToolbarMenuState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingWithFixedColumnWidthsOptionShown?: boolean, areTableColumnWidthsFixed?: boolean) => FloatingToolbarItem<Command>;
11
- export declare const getToolbarCellOptionsConfig: (editorState: EditorState, editorView: EditorView | undefined | null, initialSelectionRect: Rect, { formatMessage }: ToolbarMenuContext, getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => FloatingToolbarDropdown<Command>;
11
+ export declare const getToolbarCellOptionsConfig: (editorState: EditorState, editorView: EditorView | undefined | null, initialSelectionRect: Rect, { formatMessage }: ToolbarMenuContext, getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => FloatingToolbarDropdown<Command>;
12
12
  export declare const getClosestSelectionRect: (state: EditorState) => Rect | undefined;
13
13
  export declare const getClosestSelectionOrTableRect: (state: EditorState) => Rect | undefined;
14
14
  export declare const getToolbarConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorFeatureFlags: GetEditorFeatureFlags, getEditorView: () => EditorView | null, options?: TablePluginOptions, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (config: PluginConfig) => FloatingToolbarHandler;
15
- export declare const getDistributeConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean) => Command;
15
+ export declare const getDistributeConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, isCommentEditor?: boolean) => Command;
16
16
  type AlignmentIcon = {
17
17
  id?: string;
18
18
  value: AlignmentOptions;
@@ -24,6 +24,7 @@ export interface Props {
24
24
  getEditorContainerWidth: GetEditorContainerWidth;
25
25
  getEditorFeatureFlags?: GetEditorFeatureFlags;
26
26
  isCellMenuOpenByKeyboard?: boolean;
27
+ isCommentEditor?: boolean;
27
28
  }
28
29
  export interface State {
29
30
  isSubmenuOpen: boolean;
@@ -19,9 +19,10 @@ export interface Props {
19
19
  pluginConfig?: PluginConfig;
20
20
  editorAnalyticsAPI?: EditorAnalyticsAPI;
21
21
  isCellMenuOpenByKeyboard?: boolean;
22
+ isCommentEditor?: boolean;
22
23
  }
23
24
  declare const FloatingContextualMenu: {
24
- ({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth, getEditorFeatureFlags, isCellMenuOpenByKeyboard, }: Props): jsx.JSX.Element | null;
25
+ ({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth, getEditorFeatureFlags, isCellMenuOpenByKeyboard, isCommentEditor, }: Props): jsx.JSX.Element | null;
25
26
  displayName: string;
26
27
  };
27
28
  export default FloatingContextualMenu;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "7.25.2",
3
+ "version": "7.25.4",
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": "^40.8.1",
32
- "@atlaskit/button": "^19.1.0",
32
+ "@atlaskit/button": "^19.2.0",
33
33
  "@atlaskit/custom-steps": "^0.7.0",
34
- "@atlaskit/editor-common": "^87.6.0",
34
+ "@atlaskit/editor-common": "^87.10.0",
35
35
  "@atlaskit/editor-palette": "1.6.0",
36
36
  "@atlaskit/editor-plugin-accessibility-utils": "^1.2.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^1.7.0",
@@ -43,17 +43,17 @@
43
43
  "@atlaskit/editor-prosemirror": "5.0.1",
44
44
  "@atlaskit/editor-shared-styles": "^2.13.0",
45
45
  "@atlaskit/editor-tables": "^2.8.0",
46
- "@atlaskit/icon": "^22.11.0",
47
- "@atlaskit/menu": "^2.10.0",
46
+ "@atlaskit/icon": "^22.12.0",
47
+ "@atlaskit/menu": "^2.12.0",
48
48
  "@atlaskit/platform-feature-flags": "^0.3.0",
49
49
  "@atlaskit/pragmatic-drag-and-drop": "^1.3.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
52
  "@atlaskit/primitives": "^12.0.0",
53
- "@atlaskit/theme": "^12.11.0",
54
- "@atlaskit/toggle": "^13.2.0",
55
- "@atlaskit/tokens": "^1.57.0",
56
- "@atlaskit/tooltip": "^18.6.0",
53
+ "@atlaskit/theme": "^13.0.0",
54
+ "@atlaskit/toggle": "^13.3.0",
55
+ "@atlaskit/tokens": "^1.58.0",
56
+ "@atlaskit/tooltip": "^18.7.0",
57
57
  "@babel/runtime": "^7.0.0",
58
58
  "@emotion/react": "^11.7.1",
59
59
  "classnames": "^2.2.5",
@@ -117,9 +117,6 @@
117
117
  "platform.editor.table.live-pages-sorting_4malx": {
118
118
  "type": "boolean"
119
119
  },
120
- "editor_react_18_fix_table_delete_col_decorations": {
121
- "type": "boolean"
122
- },
123
120
  "platform_editor_a11y_table_context_menu": {
124
121
  "type": "boolean"
125
122
  },
@@ -250,6 +250,7 @@ export const changeColumnWidthByStep =
250
250
  getEditorContainerWidth,
251
251
  isTableScalingEnabled,
252
252
  isTableFixedColumnWidthsOptionEnabled,
253
+ isCommentEditor,
253
254
  ariaNotify,
254
255
  getIntl,
255
256
  }: {
@@ -257,6 +258,7 @@ export const changeColumnWidthByStep =
257
258
  getEditorContainerWidth: GetEditorContainerWidth;
258
259
  isTableScalingEnabled: boolean;
259
260
  isTableFixedColumnWidthsOptionEnabled: boolean;
261
+ isCommentEditor: boolean;
260
262
  ariaNotify?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void;
261
263
  getIntl?: () => IntlShape;
262
264
  originalTr?: Transaction;
@@ -318,9 +320,12 @@ export const changeColumnWidthByStep =
318
320
  if (isTableScalingWithFixedColumnWidthsOptionEnabled) {
319
321
  isTableScalingEnabledOnCurrentTable = originalTable.attrs.displayMode !== 'fixed';
320
322
  }
323
+
321
324
  const shouldUseIncreasedScalingPercent =
322
- isTableScalingWithFixedColumnWidthsOptionEnabled &&
323
- fg('platform.editor.table.use-increased-scaling-percent');
325
+ (isTableScalingWithFixedColumnWidthsOptionEnabled &&
326
+ fg('platform.editor.table.use-increased-scaling-percent')) ||
327
+ // When in comment editor, we need the scaling percent to be 40% while tableWithFixedColumnWidthsOption is not visible
328
+ (isTableScalingEnabled && isCommentEditor);
324
329
 
325
330
  const initialResizeState = getResizeState({
326
331
  minWidth: tableCellMinWidth,
@@ -238,6 +238,7 @@ export const changeColumnWidthByStepWithAnalytics =
238
238
  getEditorContainerWidth: GetEditorContainerWidth,
239
239
  isTableScalingEnabled: boolean,
240
240
  isTableFixedColumnWidthsOptionEnabled: boolean,
241
+ isCommentEditor: boolean,
241
242
  inputMethod: INPUT_METHOD.SHORTCUT,
242
243
  ariaNotify?: (message: string) => void,
243
244
  getIntl?: () => IntlShape,
@@ -268,6 +269,7 @@ export const changeColumnWidthByStepWithAnalytics =
268
269
  getEditorContainerWidth: getEditorContainerWidth,
269
270
  isTableScalingEnabled,
270
271
  isTableFixedColumnWidthsOptionEnabled,
272
+ isCommentEditor,
271
273
  ariaNotify: ariaNotify,
272
274
  getIntl: getIntl,
273
275
  }),
@@ -315,7 +315,7 @@ export const handleMouseLeave = (view: EditorView, event: Event): boolean => {
315
315
 
316
316
  if (isTableHovered) {
317
317
  if (isDragAndDropEnabled) {
318
- const { isDragMenuOpen } = getDragDropPluginState(state);
318
+ const { isDragMenuOpen = false } = getDragDropPluginState(state);
319
319
  !isDragMenuOpen && setTableHovered(false)(state, dispatch);
320
320
  } else {
321
321
  setTableHovered(false)(state, dispatch);
@@ -588,6 +588,7 @@ export const withCellTracking =
588
588
  (view: EditorView, mouseEvent: Event): boolean => {
589
589
  if (
590
590
  getPluginState(view.state).isDragAndDropEnabled &&
591
+ getDragDropPluginState(view.state) &&
591
592
  !getDragDropPluginState(view.state).isDragging
592
593
  ) {
593
594
  trackCellLocation(view, mouseEvent);
@@ -224,9 +224,9 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
224
224
  this?.table?.addEventListener('mouseenter', this.handleMouseEnter);
225
225
  }
226
226
  }
227
- if (fg('editor_react_18_fix_table_delete_col_decorations')) {
228
- this?.table?.addEventListener('mouseout', this.handleMouseOut);
229
- }
227
+
228
+ this?.table?.addEventListener('mouseout', this.handleMouseOut);
229
+
230
230
  if (fg('platform_editor_react_18_table_column_resize_hover')) {
231
231
  this?.table?.addEventListener('mouseover', this.handleMouseOver);
232
232
  }
@@ -334,9 +334,9 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
334
334
  if (fg('platform.editor.table.live-pages-sorting_4malx')) {
335
335
  this?.table?.removeEventListener('mouseenter', this.handleMouseEnter);
336
336
  }
337
- if (fg('editor_react_18_fix_table_delete_col_decorations')) {
338
- this?.table?.removeEventListener('mouseout', this.handleMouseOut);
339
- }
337
+
338
+ this?.table?.removeEventListener('mouseout', this.handleMouseOut);
339
+
340
340
  if (fg('platform_editor_react_18_table_column_resize_hover')) {
341
341
  this?.table?.removeEventListener('mouseover', this.handleMouseOver);
342
342
  }
@@ -438,12 +438,13 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
438
438
  const { tableWithFixedColumnWidthsOption = false } = getEditorFeatureFlags();
439
439
 
440
440
  const isTableScalingWithFixedColumnWidthsOptionEnabled =
441
- this.props.options?.isTableScalingEnabled && tableWithFixedColumnWidthsOption;
441
+ !!this.props.options?.isTableScalingEnabled && tableWithFixedColumnWidthsOption;
442
442
 
443
443
  const shouldUseIncreasedScalingPercent =
444
444
  (isTableScalingWithFixedColumnWidthsOptionEnabled &&
445
445
  fg('platform.editor.table.use-increased-scaling-percent')) ||
446
- false;
446
+ // When in comment editor, we need the scaling percent to be 40% while tableWithFixedColumnWidthsOption is not visible
447
+ (!!this.props.options?.isTableScalingEnabled && !!this.props.options?.isCommentEditor);
447
448
 
448
449
  if (force || (!isResizing && shouldUpdateColgroup)) {
449
450
  const resizeState = getResizeState({
@@ -517,10 +518,11 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
517
518
  }
518
519
 
519
520
  const isTableScalingWithFixedColumnWidthsOptionEnabled =
520
- isTableScalingEnabled && tableWithFixedColumnWidthsOption;
521
+ !!isTableScalingEnabled && tableWithFixedColumnWidthsOption;
521
522
  const shouldUseIncreasedScalingPercent =
522
- isTableScalingWithFixedColumnWidthsOptionEnabled &&
523
- fg('platform.editor.table.use-increased-scaling-percent');
523
+ (isTableScalingWithFixedColumnWidthsOptionEnabled &&
524
+ fg('platform.editor.table.use-increased-scaling-percent')) ||
525
+ (!!isTableScalingEnabled && !!this.props.options?.isCommentEditor);
524
526
 
525
527
  if (
526
528
  isTableScalingWithFixedColumnWidthsOptionEnabled &&
@@ -808,9 +810,10 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
808
810
  const { stickyScrollbar, tableWithFixedColumnWidthsOption = false } = getEditorFeatureFlags();
809
811
 
810
812
  const shouldUseIncreasedScalingPercent =
811
- isTableScalingEnabled &&
812
- tableWithFixedColumnWidthsOption &&
813
- fg('platform.editor.table.use-increased-scaling-percent');
813
+ !!isTableScalingEnabled &&
814
+ ((tableWithFixedColumnWidthsOption &&
815
+ fg('platform.editor.table.use-increased-scaling-percent')) ||
816
+ !!this.props.options?.isCommentEditor);
814
817
 
815
818
  return (
816
819
  <TableContainer
@@ -450,6 +450,7 @@ export const TableResizer = ({
450
450
  editorView.domAtPos.bind(editorView),
451
451
  isTableScalingEnabled,
452
452
  isTableWithFixedColumnWidthsOptionEnabled,
453
+ isCommentEditor,
453
454
  );
454
455
 
455
456
  const editorContainerWidth = isFullWidthModeEnabled
@@ -9,7 +9,6 @@ import { fg } from '@atlaskit/platform-feature-flags';
9
9
 
10
10
  import type { PluginInjectionAPI } from '../types';
11
11
 
12
- import ignoreMutationDelegate from './ignore-mutation-delegate';
13
12
  // TODO: Clean up ED-23976
14
13
  import { createTableView } from './table';
15
14
  import TableCell from './TableCell';
@@ -94,9 +93,6 @@ export const lazyTableView = (options: TableViewOptions) => {
94
93
  nodeName: 'table',
95
94
  getNodeViewOptions: () => options,
96
95
  loader,
97
- lazyNodeViewOptions: {
98
- ignoreMutationDelegate,
99
- },
100
96
  });
101
97
  };
102
98
 
@@ -31,7 +31,6 @@ import { pluginKey as tableWidthPluginKey } from '../pm-plugins/table-width';
31
31
  import type { PluginInjectionAPI } from '../types';
32
32
  import { isTableNested } from '../utils';
33
33
 
34
- import ignoreMutationDelegate from './ignore-mutation-delegate';
35
34
  import TableComponent from './TableComponent';
36
35
  import { TableComponentWithSharedState } from './TableComponentWithSharedState';
37
36
  import type { Props } from './types';
@@ -316,16 +315,39 @@ export default class TableView extends ReactNodeView<Props> {
316
315
  }
317
316
 
318
317
  ignoreMutation(mutation: MutationRecord | { type: 'selection'; target: Element }) {
319
- const ignoreMutation = ignoreMutationDelegate(mutation);
318
+ const {
319
+ type,
320
+ target: { nodeName, firstChild },
321
+ } = mutation;
322
+
323
+ if (
324
+ type === 'selection' &&
325
+ nodeName?.toUpperCase() === 'DIV' &&
326
+ firstChild?.nodeName.toUpperCase() === 'TABLE'
327
+ ) {
328
+ return false;
329
+ }
330
+
331
+ // ED-16668
332
+ // Do not remove this fixes an issue with windows firefox that relates to
333
+ // the addition of the shadow sentinels
334
+ if (
335
+ type === 'selection' &&
336
+ nodeName?.toUpperCase() === 'TABLE' &&
337
+ (firstChild?.nodeName.toUpperCase() === 'COLGROUP' ||
338
+ firstChild?.nodeName.toUpperCase() === 'SPAN')
339
+ ) {
340
+ return false;
341
+ }
342
+
320
343
  if (fg('platform_editor_react_18_table_insertion_cursor')) {
321
- if (ignoreMutation) {
322
- if (!this.contentDOM) {
323
- return true;
324
- }
325
- return !this.contentDOM.contains(mutation.target) && mutation.type !== 'selection';
344
+ if (!this.contentDOM) {
345
+ return true;
326
346
  }
347
+ return !this.contentDOM.contains(mutation.target) && mutation.type !== 'selection';
327
348
  }
328
- return ignoreMutation;
349
+
350
+ return true;
329
351
  }
330
352
 
331
353
  destroy() {
package/src/plugin.tsx CHANGED
@@ -162,10 +162,13 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
162
162
 
163
163
  const isTableFixedColumnWidthsOptionEnabled =
164
164
  options?.getEditorFeatureFlags?.().tableWithFixedColumnWidthsOption || false;
165
+
165
166
  const shouldUseIncreasedScalingPercent =
166
167
  options?.isTableScalingEnabled &&
167
- isTableFixedColumnWidthsOptionEnabled &&
168
- fg('platform.editor.table.use-increased-scaling-percent');
168
+ ((isTableFixedColumnWidthsOptionEnabled &&
169
+ fg('platform.editor.table.use-increased-scaling-percent')) ||
170
+ // When in comment editor, we need the scaling percent to be 40% while tableWithFixedColumnWidthsOption is not visible
171
+ options?.isCommentEditor);
169
172
 
170
173
  const isCellBackgroundDuplicated =
171
174
  options?.getEditorFeatureFlags?.().tableDuplicateCellColouring || false;
@@ -338,6 +341,7 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
338
341
  isTableScalingEnabled || false,
339
342
  isNewColumnResizingEnabled,
340
343
  isTableAlignmentEnabled,
344
+ !!options?.isCommentEditor,
341
345
  )
342
346
  : undefined;
343
347
  },
@@ -415,6 +419,7 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
415
419
  editorAnalyticsAPI,
416
420
  options?.isTableScalingEnabled,
417
421
  isTableFixedColumnWidthsOptionEnabled,
422
+ options.isCommentEditor,
418
423
  )
419
424
  : undefined;
420
425
  },
@@ -610,6 +615,7 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
610
615
  options?.getEditorFeatureFlags || defaultGetEditorFeatureFlags
611
616
  }
612
617
  isCellMenuOpenByKeyboard={isCellMenuOpenByKeyboard}
618
+ isCommentEditor={options?.isCommentEditor}
613
619
  />
614
620
  )}
615
621
  {isDragAndDropEnabled && (