@atlaskit/editor-plugin-table 7.5.11 → 7.5.13

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 (70) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/commands/package.json +1 -1
  3. package/dist/cjs/commands/index.js +6 -0
  4. package/dist/cjs/commands/misc.js +16 -1
  5. package/dist/cjs/nodeviews/TableResizer.js +17 -1
  6. package/dist/cjs/reducer.js +1 -0
  7. package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +11 -3
  8. package/dist/cjs/utils/drag-menu.js +14 -7
  9. package/dist/es2019/commands/index.js +1 -1
  10. package/dist/es2019/commands/misc.js +15 -1
  11. package/dist/es2019/nodeviews/TableResizer.js +21 -2
  12. package/dist/es2019/reducer.js +1 -0
  13. package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +11 -3
  14. package/dist/es2019/utils/drag-menu.js +15 -8
  15. package/dist/esm/commands/index.js +1 -1
  16. package/dist/esm/commands/misc.js +15 -0
  17. package/dist/esm/nodeviews/TableResizer.js +17 -1
  18. package/dist/esm/reducer.js +1 -0
  19. package/dist/esm/ui/FloatingDragMenu/DragMenu.js +11 -3
  20. package/dist/esm/utils/drag-menu.js +15 -8
  21. package/dist/types/commands/index.d.ts +1 -1
  22. package/dist/types/commands/misc.d.ts +1 -0
  23. package/dist/types/pm-plugins/analytics/plugin-factory.d.ts +1 -1
  24. package/dist/types/pm-plugins/drag-and-drop/plugin-factory.d.ts +1 -1
  25. package/dist/types/pm-plugins/plugin-factory.d.ts +1 -1
  26. package/dist/types/pm-plugins/sticky-headers/plugin-state.d.ts +1 -1
  27. package/dist/types/pm-plugins/table-resizing/plugin-factory.d.ts +1 -1
  28. package/dist/types/types.d.ts +6 -0
  29. package/dist/types/ui/DragHandle/index.d.ts +2 -2
  30. package/dist/types/ui/FloatingContextualMenu/ContextualMenu.d.ts +2 -2
  31. package/dist/types/ui/FloatingDeleteButton/DeleteButton.d.ts +2 -2
  32. package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +2 -2
  33. package/dist/types/ui/FloatingInsertButton/InsertButton.d.ts +4 -4
  34. package/dist/types/ui/FloatingInsertButton/index.d.ts +2 -2
  35. package/dist/types/ui/LayoutButton/index.d.ts +2 -2
  36. package/dist/types/ui/TableFloatingControls/CornerControls/ClassicCornerControls.d.ts +2 -2
  37. package/dist/types/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +2 -2
  38. package/dist/types/ui/TableFloatingControls/RowControls/ClassicControls.d.ts +2 -2
  39. package/dist/types/ui/TableFloatingControls/RowControls/DragControls.d.ts +2 -2
  40. package/dist/types-ts4.5/commands/index.d.ts +1 -1
  41. package/dist/types-ts4.5/commands/misc.d.ts +1 -0
  42. package/dist/types-ts4.5/pm-plugins/analytics/plugin-factory.d.ts +1 -1
  43. package/dist/types-ts4.5/pm-plugins/drag-and-drop/plugin-factory.d.ts +1 -1
  44. package/dist/types-ts4.5/pm-plugins/plugin-factory.d.ts +1 -1
  45. package/dist/types-ts4.5/pm-plugins/sticky-headers/plugin-state.d.ts +1 -1
  46. package/dist/types-ts4.5/pm-plugins/table-resizing/plugin-factory.d.ts +1 -1
  47. package/dist/types-ts4.5/types.d.ts +6 -0
  48. package/dist/types-ts4.5/ui/DragHandle/index.d.ts +2 -2
  49. package/dist/types-ts4.5/ui/FloatingContextualMenu/ContextualMenu.d.ts +2 -2
  50. package/dist/types-ts4.5/ui/FloatingDeleteButton/DeleteButton.d.ts +2 -2
  51. package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +2 -2
  52. package/dist/types-ts4.5/ui/FloatingInsertButton/InsertButton.d.ts +4 -4
  53. package/dist/types-ts4.5/ui/FloatingInsertButton/index.d.ts +2 -2
  54. package/dist/types-ts4.5/ui/LayoutButton/index.d.ts +2 -2
  55. package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/ClassicCornerControls.d.ts +2 -2
  56. package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +2 -2
  57. package/dist/types-ts4.5/ui/TableFloatingControls/RowControls/ClassicControls.d.ts +2 -2
  58. package/dist/types-ts4.5/ui/TableFloatingControls/RowControls/DragControls.d.ts +2 -2
  59. package/package.json +10 -7
  60. package/plugin-key/package.json +1 -1
  61. package/src/commands/index.ts +1 -0
  62. package/src/commands/misc.ts +16 -0
  63. package/src/nodeviews/TableResizer.tsx +29 -2
  64. package/src/reducer.ts +1 -0
  65. package/src/types.ts +7 -0
  66. package/src/ui/FloatingDragMenu/DragMenu.tsx +15 -5
  67. package/src/utils/drag-menu.ts +25 -8
  68. package/types/package.json +1 -1
  69. package/ui/common-styles/package.json +1 -1
  70. package/ui/consts/package.json +1 -1
@@ -50,7 +50,7 @@ export declare class ContextualMenu extends Component<Props & WrappedComponentPr
50
50
  private closeSubmenu;
51
51
  private setColor;
52
52
  }
53
- declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
54
- WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps<"intl">>;
53
+ declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
54
+ WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps>;
55
55
  };
56
56
  export default _default;
@@ -8,7 +8,7 @@ export interface ButtonProps {
8
8
  onMouseEnter?: (event: SyntheticEvent) => void;
9
9
  onMouseLeave?: (event: SyntheticEvent) => void;
10
10
  }
11
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps<"intl">>> & {
12
- WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps<"intl">>;
11
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps>> & {
12
+ WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps>;
13
13
  };
14
14
  export default _default;
@@ -27,7 +27,7 @@ type DragMenuProps = {
27
27
  isTableScalingEnabled?: boolean;
28
28
  };
29
29
  export declare const DragMenu: React.MemoExoticComponent<({ direction, index, target, isOpen, editorView, tableNode, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, fitHeight, fitWidth, mountPoint, scrollableElement, boundariesElement, isTableScalingEnabled, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
30
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<DragMenuProps & WrappedComponentProps<"intl">>> & {
31
- WrappedComponent: React.ComponentType<DragMenuProps & WrappedComponentProps<"intl">>;
30
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<DragMenuProps & WrappedComponentProps>> & {
31
+ WrappedComponent: React.ComponentType<DragMenuProps & WrappedComponentProps>;
32
32
  };
33
33
  export default _default;
@@ -9,10 +9,10 @@ export interface ButtonProps {
9
9
  hasStickyHeaders: boolean;
10
10
  }
11
11
  export declare const InsertButtonForDragAndDrop: ({ onMouseDown, tableRef, type, intl: { formatMessage }, hasStickyHeaders, }: ButtonProps & WrappedComponentProps) => JSX.Element;
12
- export declare const DragAndDropInsertButton: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps<"intl">>> & {
13
- WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps<"intl">>;
12
+ export declare const DragAndDropInsertButton: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps>> & {
13
+ WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps>;
14
14
  };
15
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps<"intl">>> & {
16
- WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps<"intl">>;
15
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps>> & {
16
+ WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps>;
17
17
  };
18
18
  export default _default;
@@ -29,7 +29,7 @@ export declare class FloatingInsertButton extends React.Component<Props & Wrappe
29
29
  private insertRow;
30
30
  private insertColumn;
31
31
  }
32
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
33
- WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
32
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
33
+ WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
34
34
  };
35
35
  export default _default;
@@ -15,7 +15,7 @@ export interface Props {
15
15
  stickyHeader?: RowStickyState;
16
16
  editorAnalyticsAPI?: EditorAnalyticsAPI;
17
17
  }
18
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
19
- WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
18
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
19
+ WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
20
20
  };
21
21
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { WrappedComponentProps } from 'react-intl-next';
3
3
  import type { CornerControlProps } from './types';
4
- export declare const CornerControls: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps<"intl">>> & {
5
- WrappedComponent: React.ComponentType<CornerControlProps & WrappedComponentProps<"intl">>;
4
+ export declare const CornerControls: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps>> & {
5
+ WrappedComponent: React.ComponentType<CornerControlProps & WrappedComponentProps>;
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { WrappedComponentProps } from 'react-intl-next';
3
3
  import type { CornerControlProps } from './types';
4
- export declare const DragCornerControls: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps<"intl">>> & {
5
- WrappedComponent: React.ComponentType<CornerControlProps & WrappedComponentProps<"intl">>;
4
+ export declare const DragCornerControls: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps>> & {
5
+ WrappedComponent: React.ComponentType<CornerControlProps & WrappedComponentProps>;
6
6
  };
@@ -12,6 +12,6 @@ export interface Props {
12
12
  insertRowButtonIndex?: number;
13
13
  stickyTop?: number;
14
14
  }
15
- export declare const RowControls: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
16
- WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
15
+ export declare const RowControls: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
16
+ WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
17
17
  };
@@ -18,7 +18,7 @@ type DragControlsProps = {
18
18
  selectRows: (rowIndexes: number[]) => void;
19
19
  updateCellHoverLocation: (rowIndex: number) => void;
20
20
  };
21
- export declare const DragControls: React.FC<import("react-intl-next").WithIntlProps<DragControlsProps & WrappedComponentProps<"intl">>> & {
22
- WrappedComponent: React.ComponentType<DragControlsProps & WrappedComponentProps<"intl">>;
21
+ export declare const DragControls: React.FC<import("react-intl-next").WithIntlProps<DragControlsProps & WrappedComponentProps>> & {
22
+ WrappedComponent: React.ComponentType<DragControlsProps & WrappedComponentProps>;
23
23
  };
24
24
  export {};
@@ -2,7 +2,7 @@ export { hoverColumns, hoverRows, hoverTable, hoverCell, hoverMergedCells, clear
2
2
  export { insertColumn, insertRow, createTable } from './insert';
3
3
  export { getNextLayout, toggleContextualMenu, toggleHeaderColumn, toggleHeaderRow, toggleNumberColumn, toggleTableLayout, } from './toggle';
4
4
  export { clearMultipleCells } from './clear';
5
- export { autoSizeTable, convertFirstRowToHeader, deleteTable, hideInsertColumnOrRowButton, moveCursorBackward, selectColumn, selectColumns, selectRow, selectRows, setCellAttr, setEditorFocus, setMultipleCellAttrs, setTableRef, showInsertColumnButton, showInsertRowButton, transformSliceToAddTableHeaders, triggerUnlessTableHeader, addBoldInEmptyHeaderCells, addResizeHandleDecorations, } from './misc';
5
+ export { autoSizeTable, convertFirstRowToHeader, deleteTable, hideInsertColumnOrRowButton, moveCursorBackward, selectColumn, selectColumns, selectRow, selectRows, setCellAttr, setEditorFocus, setMultipleCellAttrs, setTableRef, showInsertColumnButton, showInsertRowButton, transformSliceToAddTableHeaders, triggerUnlessTableHeader, addBoldInEmptyHeaderCells, addResizeHandleDecorations, updateWidthToWidest, } from './misc';
6
6
  export { sortByColumn } from './sort';
7
7
  export { goToNextCell } from './go-to-next-cell';
8
8
  export { removeDescendantNodes } from './referentiality';
@@ -33,3 +33,4 @@ export declare const autoSizeTable: (view: EditorView, node: PMNode, table: HTML
33
33
  containerWidth: number;
34
34
  }) => boolean;
35
35
  export declare const addBoldInEmptyHeaderCells: (tableCellHeader: ContentNodeWithPos) => Command;
36
+ export declare const updateWidthToWidest: (widthToWidest: boolean) => Command;
@@ -1 +1 @@
1
- export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: import("./types").AnalyticPluginState | ((state: import("prosemirror-state").EditorState) => import("./types").AnalyticPluginState)) => import("prosemirror-state").SafeStateField<import("./types").AnalyticPluginState>, createCommand: <A = import("./actions").AnalyticPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("./types").AnalyticPluginState;
1
+ export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("./types").AnalyticPluginState | ((state: import("prosemirror-state").EditorState) => import("./types").AnalyticPluginState)) => import("prosemirror-state").SafeStateField<import("./types").AnalyticPluginState>, createCommand: <A = import("./actions").AnalyticPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("./types").AnalyticPluginState;
@@ -1 +1 @@
1
- export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: import("./types").DragAndDropPluginState | ((state: import("prosemirror-state").EditorState) => import("./types").DragAndDropPluginState)) => import("prosemirror-state").SafeStateField<import("./types").DragAndDropPluginState>, createCommand: <A = import("./actions").DragAndDropPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("./types").DragAndDropPluginState;
1
+ export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("./types").DragAndDropPluginState | ((state: import("prosemirror-state").EditorState) => import("./types").DragAndDropPluginState)) => import("prosemirror-state").SafeStateField<import("./types").DragAndDropPluginState>, createCommand: <A = import("./actions").DragAndDropPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("./types").DragAndDropPluginState;
@@ -1 +1 @@
1
- export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: import("../types").TablePluginState | ((state: import("prosemirror-state").EditorState) => import("../types").TablePluginState)) => import("prosemirror-state").SafeStateField<import("../types").TablePluginState>, createCommand: <A = import("../types").TablePluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("../types").TablePluginState;
1
+ export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("../types").TablePluginState | ((state: import("prosemirror-state").EditorState) => import("../types").TablePluginState)) => import("prosemirror-state").SafeStateField<import("../types").TablePluginState>, createCommand: <A = import("../types").TablePluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("../types").TablePluginState;
@@ -1,3 +1,3 @@
1
1
  import type { StickyPluginAction, StickyPluginState } from './types';
2
- declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: StickyPluginState | ((state: import("prosemirror-state").EditorState) => StickyPluginState)) => import("prosemirror-state").SafeStateField<StickyPluginState>, createCommand: <A = StickyPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command;
2
+ declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: StickyPluginState | ((state: import("prosemirror-state").EditorState) => StickyPluginState)) => import("prosemirror-state").SafeStateField<StickyPluginState>, createCommand: <A = StickyPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command;
3
3
  export { createPluginState, createCommand };
@@ -1,4 +1,4 @@
1
1
  import type { ColumnResizingPluginState } from '../../types';
2
2
  export declare const createCommand: <A = import("../../types").ColumnResizingPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command;
3
- export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: ColumnResizingPluginState | ((state: import("prosemirror-state").EditorState) => ColumnResizingPluginState)) => import("prosemirror-state").SafeStateField<ColumnResizingPluginState>;
3
+ export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: ColumnResizingPluginState | ((state: import("prosemirror-state").EditorState) => ColumnResizingPluginState)) => import("prosemirror-state").SafeStateField<ColumnResizingPluginState>;
4
4
  export declare const getPluginState: (state: import("prosemirror-state").EditorState) => ColumnResizingPluginState;
@@ -83,6 +83,7 @@ export interface TablePluginState {
83
83
  isKeyboardResize?: boolean;
84
84
  isTableCollapsed?: boolean;
85
85
  canCollapseTable?: boolean;
86
+ widthToWidest?: boolean;
86
87
  getIntl: () => IntlShape;
87
88
  isBreakoutEnabled?: boolean;
88
89
  wasFullWidthModeEnabled?: boolean;
@@ -168,6 +169,11 @@ export type TablePluginAction = {
168
169
  resizeHandleColumnIndex: number | undefined;
169
170
  resizeHandleIncludeTooltip: boolean | undefined;
170
171
  };
172
+ } | {
173
+ type: 'UPDATE_TABLE_WIDTH_TO_WIDEST';
174
+ data: {
175
+ widthToWidest: boolean | undefined;
176
+ };
171
177
  } | {
172
178
  type: 'REMOVE_RESIZE_HANDLE_DECORATIONS';
173
179
  data: {
@@ -21,7 +21,7 @@ type DragHandleProps = {
21
21
  editorView: EditorView;
22
22
  isDragMenuTarget: boolean;
23
23
  };
24
- export declare const DragHandle: React.FC<import("react-intl-next").WithIntlProps<DragHandleProps & WrappedComponentProps<"intl">>> & {
25
- WrappedComponent: React.ComponentType<DragHandleProps & WrappedComponentProps<"intl">>;
24
+ export declare const DragHandle: React.FC<import("react-intl-next").WithIntlProps<DragHandleProps & WrappedComponentProps>> & {
25
+ WrappedComponent: React.ComponentType<DragHandleProps & WrappedComponentProps>;
26
26
  };
27
27
  export {};
@@ -50,7 +50,7 @@ export declare class ContextualMenu extends Component<Props & WrappedComponentPr
50
50
  private closeSubmenu;
51
51
  private setColor;
52
52
  }
53
- declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
54
- WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps<"intl">>;
53
+ declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
54
+ WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps>;
55
55
  };
56
56
  export default _default;
@@ -8,7 +8,7 @@ export interface ButtonProps {
8
8
  onMouseEnter?: (event: SyntheticEvent) => void;
9
9
  onMouseLeave?: (event: SyntheticEvent) => void;
10
10
  }
11
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps<"intl">>> & {
12
- WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps<"intl">>;
11
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps>> & {
12
+ WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps>;
13
13
  };
14
14
  export default _default;
@@ -27,7 +27,7 @@ type DragMenuProps = {
27
27
  isTableScalingEnabled?: boolean;
28
28
  };
29
29
  export declare const DragMenu: React.MemoExoticComponent<({ direction, index, target, isOpen, editorView, tableNode, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, fitHeight, fitWidth, mountPoint, scrollableElement, boundariesElement, isTableScalingEnabled, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
30
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<DragMenuProps & WrappedComponentProps<"intl">>> & {
31
- WrappedComponent: React.ComponentType<DragMenuProps & WrappedComponentProps<"intl">>;
30
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<DragMenuProps & WrappedComponentProps>> & {
31
+ WrappedComponent: React.ComponentType<DragMenuProps & WrappedComponentProps>;
32
32
  };
33
33
  export default _default;
@@ -9,10 +9,10 @@ export interface ButtonProps {
9
9
  hasStickyHeaders: boolean;
10
10
  }
11
11
  export declare const InsertButtonForDragAndDrop: ({ onMouseDown, tableRef, type, intl: { formatMessage }, hasStickyHeaders, }: ButtonProps & WrappedComponentProps) => JSX.Element;
12
- export declare const DragAndDropInsertButton: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps<"intl">>> & {
13
- WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps<"intl">>;
12
+ export declare const DragAndDropInsertButton: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps>> & {
13
+ WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps>;
14
14
  };
15
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps<"intl">>> & {
16
- WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps<"intl">>;
15
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps>> & {
16
+ WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps>;
17
17
  };
18
18
  export default _default;
@@ -29,7 +29,7 @@ export declare class FloatingInsertButton extends React.Component<Props & Wrappe
29
29
  private insertRow;
30
30
  private insertColumn;
31
31
  }
32
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
33
- WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
32
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
33
+ WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
34
34
  };
35
35
  export default _default;
@@ -15,7 +15,7 @@ export interface Props {
15
15
  stickyHeader?: RowStickyState;
16
16
  editorAnalyticsAPI?: EditorAnalyticsAPI;
17
17
  }
18
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
19
- WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
18
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
19
+ WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
20
20
  };
21
21
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { WrappedComponentProps } from 'react-intl-next';
3
3
  import type { CornerControlProps } from './types';
4
- export declare const CornerControls: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps<"intl">>> & {
5
- WrappedComponent: React.ComponentType<CornerControlProps & WrappedComponentProps<"intl">>;
4
+ export declare const CornerControls: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps>> & {
5
+ WrappedComponent: React.ComponentType<CornerControlProps & WrappedComponentProps>;
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { WrappedComponentProps } from 'react-intl-next';
3
3
  import type { CornerControlProps } from './types';
4
- export declare const DragCornerControls: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps<"intl">>> & {
5
- WrappedComponent: React.ComponentType<CornerControlProps & WrappedComponentProps<"intl">>;
4
+ export declare const DragCornerControls: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps>> & {
5
+ WrappedComponent: React.ComponentType<CornerControlProps & WrappedComponentProps>;
6
6
  };
@@ -12,6 +12,6 @@ export interface Props {
12
12
  insertRowButtonIndex?: number;
13
13
  stickyTop?: number;
14
14
  }
15
- export declare const RowControls: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
16
- WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
15
+ export declare const RowControls: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
16
+ WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
17
17
  };
@@ -18,7 +18,7 @@ type DragControlsProps = {
18
18
  selectRows: (rowIndexes: number[]) => void;
19
19
  updateCellHoverLocation: (rowIndex: number) => void;
20
20
  };
21
- export declare const DragControls: React.FC<import("react-intl-next").WithIntlProps<DragControlsProps & WrappedComponentProps<"intl">>> & {
22
- WrappedComponent: React.ComponentType<DragControlsProps & WrappedComponentProps<"intl">>;
21
+ export declare const DragControls: React.FC<import("react-intl-next").WithIntlProps<DragControlsProps & WrappedComponentProps>> & {
22
+ WrappedComponent: React.ComponentType<DragControlsProps & WrappedComponentProps>;
23
23
  };
24
24
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "7.5.11",
3
+ "version": "7.5.13",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -30,8 +30,8 @@
30
30
  "dependencies": {
31
31
  "@atlaskit/adf-schema": "^35.6.0",
32
32
  "@atlaskit/custom-steps": "^0.0.15",
33
- "@atlaskit/editor-common": "^78.14.0",
34
- "@atlaskit/editor-palette": "1.5.2",
33
+ "@atlaskit/editor-common": "^78.17.0",
34
+ "@atlaskit/editor-palette": "1.5.3",
35
35
  "@atlaskit/editor-plugin-analytics": "^1.0.0",
36
36
  "@atlaskit/editor-plugin-content-insertion": "^1.0.0",
37
37
  "@atlaskit/editor-plugin-guideline": "^1.0.0",
@@ -46,10 +46,10 @@
46
46
  "@atlaskit/pragmatic-drag-and-drop": "^1.0.0",
47
47
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^1.0.0",
48
48
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.0",
49
- "@atlaskit/primitives": "^5.0.0",
49
+ "@atlaskit/primitives": "^5.1.0",
50
50
  "@atlaskit/theme": "^12.6.0",
51
51
  "@atlaskit/toggle": "^13.0.0",
52
- "@atlaskit/tokens": "^1.41.0",
52
+ "@atlaskit/tokens": "^1.42.0",
53
53
  "@atlaskit/tooltip": "^18.1.0",
54
54
  "@babel/runtime": "^7.0.0",
55
55
  "@emotion/react": "^11.7.1",
@@ -65,7 +65,7 @@
65
65
  },
66
66
  "devDependencies": {
67
67
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
68
- "typescript": "~4.9.5"
68
+ "typescript": "~5.4.2"
69
69
  },
70
70
  "af:exports": {
71
71
  "./types": "./src/types.ts",
@@ -110,6 +110,9 @@
110
110
  "platform.editor.table.insert-last-column-btn-stays-in-place": {
111
111
  "type": "boolean"
112
112
  },
113
+ "platform.editor.table.drag-move-options-logic-update_fp7xw": {
114
+ "type": "boolean"
115
+ },
113
116
  "platform.editor.resizing-table-height-improvement": {
114
117
  "type": "boolean"
115
118
  },
@@ -147,4 +150,4 @@
147
150
  "type": "boolean"
148
151
  }
149
152
  }
150
- }
153
+ }
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/pm-plugins/plugin-key.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <4.9": {
9
+ ">=4.5 <5.4": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/pm-plugins/plugin-key.d.ts"
12
12
  ]
@@ -39,6 +39,7 @@ export {
39
39
  triggerUnlessTableHeader,
40
40
  addBoldInEmptyHeaderCells,
41
41
  addResizeHandleDecorations,
42
+ updateWidthToWidest,
42
43
  } from './misc';
43
44
  export { sortByColumn } from './sort';
44
45
  export { goToNextCell } from './go-to-next-cell';
@@ -778,3 +778,19 @@ export const addBoldInEmptyHeaderCells =
778
778
 
779
779
  return false;
780
780
  };
781
+
782
+ export const updateWidthToWidest = (widthToWidest: boolean) =>
783
+ createCommand((state) => {
784
+ let { widthToWidest: prevWidthToWidest } = getPluginState(state);
785
+
786
+ if (prevWidthToWidest === widthToWidest) {
787
+ return false;
788
+ }
789
+
790
+ return {
791
+ type: 'UPDATE_TABLE_WIDTH_TO_WIDEST',
792
+ data: {
793
+ widthToWidest,
794
+ },
795
+ };
796
+ });
@@ -27,10 +27,12 @@ import { browser } from '@atlaskit/editor-common/utils';
27
27
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
28
28
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
29
29
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
30
+ import { akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
30
31
  import { findTable } from '@atlaskit/editor-tables/utils';
31
32
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
32
33
  import { token } from '@atlaskit/tokens';
33
34
 
35
+ import { updateWidthToWidest } from '../commands/misc';
34
36
  import { getPluginState } from '../pm-plugins/plugin-factory';
35
37
  import { META_KEYS } from '../pm-plugins/table-analytics';
36
38
  import {
@@ -341,7 +343,30 @@ export const TableResizer = ({
341
343
  TABLE_HIGHLIGHT_TOLERANCE,
342
344
  ),
343
345
  );
344
- updateWidth(newWidth);
346
+
347
+ // when isTableScalingEnabled true
348
+ // and a table is resized to fit the widest guideline when view port width is between 1011 and 1800
349
+ // set the width of the table to 1800 pixels.
350
+ const { state, dispatch } = editorView;
351
+ const widestGuideLineWidthString = defaultGuidelinesForPreserveTable(
352
+ containerWidth,
353
+ )[16]
354
+ .key?.match(/[\d]*[.]{0,1}[\d]+/g)
355
+ ?.join('');
356
+ const widestGuideLineWidth = parseInt(
357
+ widestGuideLineWidthString || '',
358
+ 10,
359
+ );
360
+ const shouldUpdateWidthToWidest = !!(
361
+ isTableScalingEnabled &&
362
+ defaultGuidelinesForPreserveTable(containerWidth).length === 17 &&
363
+ widestGuideLineWidth - newWidth <= 1
364
+ );
365
+ updateWidthToWidest(shouldUpdateWidthToWidest)(state, dispatch);
366
+
367
+ updateWidth(
368
+ shouldUpdateWidthToWidest ? akEditorFullWidthLayoutWidth : newWidth,
369
+ );
345
370
 
346
371
  return newWidth;
347
372
  },
@@ -363,9 +388,11 @@ export const TableResizer = ({
363
388
  const handleResizeStop = useCallback<HandleResize>(
364
389
  (originalState, delta) => {
365
390
  isResizing.current = false;
366
- const newWidth = originalState.width + delta.width;
391
+ let newWidth = originalState.width + delta.width;
367
392
  const { state, dispatch } = editorView;
368
393
  const pos = getPos();
394
+ const { widthToWidest } = getPluginState(editorView.state);
395
+ newWidth = widthToWidest ? akEditorFullWidthLayoutWidth : newWidth;
369
396
 
370
397
  let tr = state.tr.setMeta(tableWidthPluginKey, { resizing: false });
371
398
  const frameRateSamples = endMeasure();
package/src/reducer.ts CHANGED
@@ -144,6 +144,7 @@ export default (
144
144
  isKeyboardResize: undefined,
145
145
  };
146
146
 
147
+ case 'UPDATE_TABLE_WIDTH_TO_WIDEST':
147
148
  case 'SET_TABLE_REF':
148
149
  case 'HOVER_ROWS':
149
150
  case 'HOVER_COLUMNS':
package/src/types.ts CHANGED
@@ -130,6 +130,7 @@ export interface TablePluginState {
130
130
  // for table wrap/collapse
131
131
  isTableCollapsed?: boolean; // is the current table already in an expand?
132
132
  canCollapseTable?: boolean; // enabled/disabled state of collapse option
133
+ widthToWidest?: boolean; // is the current table set to the widest width regarding view port
133
134
 
134
135
  getIntl: () => IntlShape;
135
136
 
@@ -217,6 +218,12 @@ export type TablePluginAction =
217
218
  resizeHandleIncludeTooltip: boolean | undefined;
218
219
  };
219
220
  }
221
+ | {
222
+ type: 'UPDATE_TABLE_WIDTH_TO_WIDEST';
223
+ data: {
224
+ widthToWidest: boolean | undefined;
225
+ };
226
+ }
220
227
  | {
221
228
  type: 'REMOVE_RESIZE_HANDLE_DECORATIONS';
222
229
  data: { decorationSet: DecorationSet };
@@ -292,13 +292,23 @@ export const DragMenu = React.memo(
292
292
  ? getSelectionRect(selection)!
293
293
  : findCellRectClosestToPos(selection.$from);
294
294
 
295
- const hasMergedCells =
296
- direction === 'row' ? hasMergedCellsInRow : hasMergedCellsInColumn;
295
+ let shouldMoveDisabled;
296
+ let hasMergedCellsInTable;
297
+ if (
298
+ getBooleanFF('platform.editor.table.drag-move-options-logic-update_fp7xw')
299
+ ) {
300
+ shouldMoveDisabled = false;
301
+ hasMergedCellsInTable = tableMap?.hasMergedCells() ?? false;
302
+ } else {
303
+ const hasMergedCells =
304
+ direction === 'row' ? hasMergedCellsInRow : hasMergedCellsInColumn;
297
305
 
298
- const shouldMoveDisabled =
299
- index !== undefined && hasMergedCells(index)(selection);
306
+ shouldMoveDisabled =
307
+ index !== undefined && hasMergedCells(index)(selection);
308
+
309
+ hasMergedCellsInTable = getMergedCellsPositions(state.tr).length > 0;
310
+ }
300
311
 
301
- const hasMergedCellsInTable = getMergedCellsPositions(state.tr).length > 0;
302
312
  const allowBackgroundColor = pluginConfig?.allowBackgroundColor ?? false;
303
313
 
304
314
  const dragMenuConfig = getDragMenuConfig(
@@ -37,6 +37,7 @@ import EditorLayoutThreeEqualIcon from '@atlaskit/icon/glyph/editor/layout-three
37
37
  import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
38
38
  import HipchatChevronDoubleDownIcon from '@atlaskit/icon/glyph/hipchat/chevron-double-down';
39
39
  import HipchatChevronDoubleUpIcon from '@atlaskit/icon/glyph/hipchat/chevron-double-up';
40
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
40
41
 
41
42
  import {
42
43
  deleteColumnsWithAnalytics,
@@ -61,6 +62,7 @@ import {
61
62
  import {
62
63
  hasMergedCellsInColumn,
63
64
  hasMergedCellsInRow,
65
+ hasMergedCellsInSelection,
64
66
  hasMergedCellsWithColumnNextToColumnIndex,
65
67
  hasMergedCellsWithRowNextToRowIndex,
66
68
  } from './merged-cells';
@@ -94,8 +96,8 @@ export const canMove = (
94
96
  return false;
95
97
  }
96
98
 
97
- // We can't move column when target has merges with other columns
98
- // We can't move row when target has merges with other rows
99
+ // We can't move column when target has merged cells with other columns
100
+ // We can't move row when target has merged cells with other rows
99
101
  const hasMergedCellsInTarget = isRow
100
102
  ? hasMergedCellsWithRowNextToRowIndex(targetIndex, selection)
101
103
  : hasMergedCellsWithColumnNextToColumnIndex(targetIndex, selection);
@@ -103,12 +105,27 @@ export const canMove = (
103
105
  return false;
104
106
  }
105
107
 
106
- // Currently we can't move in any direction if there are merged cells in the source
107
- const hasMergedCellsInSource = isRow
108
- ? hasMergedCellsInRow(selectedIndexes)(selection)
109
- : hasMergedCellsInColumn(selectedIndexes)(selection);
110
- if (hasMergedCellsInSource) {
111
- return false;
108
+ if (
109
+ getBooleanFF('platform.editor.table.drag-move-options-logic-update_fp7xw')
110
+ ) {
111
+ // We can't move if selection in the source is not a rectangle
112
+ if (
113
+ hasMergedCellsInSelection(
114
+ selectedIndexes,
115
+ isRow ? 'row' : 'column',
116
+ )(selection)
117
+ ) {
118
+ return false;
119
+ }
120
+ } else {
121
+ // Currently we can't move in any direction if there are merged cells in the source
122
+ const hasMergedCellsInSource = isRow
123
+ ? hasMergedCellsInRow(selectedIndexes)(selection)
124
+ : hasMergedCellsInColumn(selectedIndexes)(selection);
125
+
126
+ if (hasMergedCellsInSource) {
127
+ return false;
128
+ }
112
129
  }
113
130
 
114
131
  return true;
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/types.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <4.9": {
9
+ ">=4.5 <5.4": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/types.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../../dist/types/ui/common-styles.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <4.9": {
9
+ ">=4.5 <5.4": {
10
10
  "*": [
11
11
  "../../dist/types-ts4.5/ui/common-styles.d.ts"
12
12
  ]