@atlaskit/editor-plugin-table 9.3.2 → 9.3.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 (83) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/nodeviews/toDOM.js +2 -1
  3. package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +9 -4
  4. package/dist/cjs/pm-plugins/table-resizing/utils/scale-table.js +6 -0
  5. package/dist/es2019/nodeviews/toDOM.js +2 -1
  6. package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +9 -4
  7. package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +6 -0
  8. package/dist/esm/nodeviews/toDOM.js +2 -1
  9. package/dist/esm/pm-plugins/table-resizing/event-handlers.js +9 -4
  10. package/dist/esm/pm-plugins/table-resizing/utils/scale-table.js +6 -0
  11. package/dist/types/nodeviews/ExternalDropTargets.d.ts +2 -2
  12. package/dist/types/nodeviews/TableComponentWithSharedState.d.ts +2 -2
  13. package/dist/types/nodeviews/TableContainer.d.ts +2 -2
  14. package/dist/types/nodeviews/TableResizer.d.ts +2 -1
  15. package/dist/types/nodeviews/table.d.ts +2 -2
  16. package/dist/types/ui/DragHandle/HandleIconComponent.d.ts +2 -2
  17. package/dist/types/ui/DragPreview/index.d.ts +2 -2
  18. package/dist/types/ui/FloatingDeleteButton/index.d.ts +2 -2
  19. package/dist/types/ui/FloatingDragMenu/DropdownMenu.d.ts +2 -2
  20. package/dist/types/ui/FloatingDragMenu/index.d.ts +2 -2
  21. package/dist/types/ui/FloatingInsertButton/index.d.ts +1 -1
  22. package/dist/types/ui/FloatingToolbarLabel/FloatingToolbarLabel.d.ts +1 -1
  23. package/dist/types/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -2
  24. package/dist/types/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.d.ts +2 -2
  25. package/dist/types/ui/TableFloatingColumnControls/ColumnDropTargets/index.d.ts +2 -2
  26. package/dist/types/ui/TableFloatingColumnControls/index.d.ts +2 -2
  27. package/dist/types/ui/TableFloatingControls/FloatingControlsWithSelection.d.ts +2 -2
  28. package/dist/types/ui/TableFloatingControls/NumberColumn/index.d.ts +2 -2
  29. package/dist/types/ui/TableFloatingControls/RowControls/DragControls.d.ts +3 -3
  30. package/dist/types/ui/TableFloatingControls/RowDropTarget/index.d.ts +1 -1
  31. package/dist/types/ui/TableFloatingControls/index.d.ts +2 -2
  32. package/dist/types/ui/TableFullWidthLabel/index.d.ts +2 -2
  33. package/dist/types/ui/icons/AddColLeftIcon.d.ts +2 -2
  34. package/dist/types/ui/icons/AddColRightIcon.d.ts +2 -2
  35. package/dist/types/ui/icons/AddRowAboveIcon.d.ts +2 -2
  36. package/dist/types/ui/icons/AddRowBelowIcon.d.ts +2 -2
  37. package/dist/types/ui/icons/DragHandleDisabledIcon.d.ts +1 -1
  38. package/dist/types/ui/icons/DragHandleIcon.d.ts +2 -2
  39. package/dist/types/ui/icons/DragInMotionIcon.d.ts +1 -1
  40. package/dist/types/ui/icons/MergeCellsIcon.d.ts +2 -2
  41. package/dist/types/ui/icons/MinimisedHandle.d.ts +2 -2
  42. package/dist/types/ui/icons/SortingIconWrapper.d.ts +1 -1
  43. package/dist/types/ui/icons/SplitCellIcon.d.ts +2 -2
  44. package/dist/types-ts4.5/nodeviews/ExternalDropTargets.d.ts +2 -2
  45. package/dist/types-ts4.5/nodeviews/TableComponentWithSharedState.d.ts +2 -2
  46. package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +2 -2
  47. package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +2 -1
  48. package/dist/types-ts4.5/nodeviews/table.d.ts +2 -2
  49. package/dist/types-ts4.5/ui/DragHandle/HandleIconComponent.d.ts +2 -2
  50. package/dist/types-ts4.5/ui/DragPreview/index.d.ts +2 -2
  51. package/dist/types-ts4.5/ui/FloatingDeleteButton/index.d.ts +2 -2
  52. package/dist/types-ts4.5/ui/FloatingDragMenu/DropdownMenu.d.ts +2 -2
  53. package/dist/types-ts4.5/ui/FloatingDragMenu/index.d.ts +2 -2
  54. package/dist/types-ts4.5/ui/FloatingInsertButton/index.d.ts +1 -1
  55. package/dist/types-ts4.5/ui/FloatingToolbarLabel/FloatingToolbarLabel.d.ts +1 -1
  56. package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -2
  57. package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.d.ts +2 -2
  58. package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnDropTargets/index.d.ts +2 -2
  59. package/dist/types-ts4.5/ui/TableFloatingColumnControls/index.d.ts +2 -2
  60. package/dist/types-ts4.5/ui/TableFloatingControls/FloatingControlsWithSelection.d.ts +2 -2
  61. package/dist/types-ts4.5/ui/TableFloatingControls/NumberColumn/index.d.ts +2 -2
  62. package/dist/types-ts4.5/ui/TableFloatingControls/RowControls/DragControls.d.ts +3 -3
  63. package/dist/types-ts4.5/ui/TableFloatingControls/RowDropTarget/index.d.ts +1 -1
  64. package/dist/types-ts4.5/ui/TableFloatingControls/index.d.ts +2 -2
  65. package/dist/types-ts4.5/ui/TableFullWidthLabel/index.d.ts +2 -2
  66. package/dist/types-ts4.5/ui/icons/AddColLeftIcon.d.ts +2 -2
  67. package/dist/types-ts4.5/ui/icons/AddColRightIcon.d.ts +2 -2
  68. package/dist/types-ts4.5/ui/icons/AddRowAboveIcon.d.ts +2 -2
  69. package/dist/types-ts4.5/ui/icons/AddRowBelowIcon.d.ts +2 -2
  70. package/dist/types-ts4.5/ui/icons/DragHandleDisabledIcon.d.ts +1 -1
  71. package/dist/types-ts4.5/ui/icons/DragHandleIcon.d.ts +2 -2
  72. package/dist/types-ts4.5/ui/icons/DragInMotionIcon.d.ts +1 -1
  73. package/dist/types-ts4.5/ui/icons/MergeCellsIcon.d.ts +2 -2
  74. package/dist/types-ts4.5/ui/icons/MinimisedHandle.d.ts +2 -2
  75. package/dist/types-ts4.5/ui/icons/SortingIconWrapper.d.ts +1 -1
  76. package/dist/types-ts4.5/ui/icons/SplitCellIcon.d.ts +2 -2
  77. package/package.json +12 -6
  78. package/src/nodeviews/toDOM.ts +11 -10
  79. package/src/pm-plugins/table-resizing/event-handlers.ts +13 -4
  80. package/src/pm-plugins/table-resizing/utils/scale-table.ts +6 -0
  81. package/src/ui/TableFloatingColumnControls/index.tsx +1 -4
  82. package/src/ui/TableFloatingControls/CornerControls/ClassicCornerControls.tsx +1 -3
  83. package/src/ui/TableFloatingControls/RowControls/ClassicControls.tsx +1 -3
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
4
  export declare const ExternalDropTargets: ({ editorView, node, getScrollOffset, getTableWrapperWidth, }: {
@@ -6,4 +6,4 @@ export declare const ExternalDropTargets: ({ editorView, node, getScrollOffset,
6
6
  node?: PMNode | undefined;
7
7
  getScrollOffset: () => number;
8
8
  getTableWrapperWidth: () => number;
9
- }) => JSX.Element | null;
9
+ }) => React.JSX.Element | null;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
3
3
  import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
4
4
  import type { GetEditorFeatureFlags, getPosHandlerNode } from '@atlaskit/editor-common/types';
@@ -25,5 +25,5 @@ type TableComponentWithSharedStateProps = {
25
25
  /**
26
26
  * Use useSharedPluginState to control re-renders from plugin dependencies
27
27
  */
28
- export declare const TableComponentWithSharedState: ({ view, options, getNode, dispatchAnalyticsEvent, api, getEditorFeatureFlags, eventDispatcher, allowColumnResizing, allowControls, getPos, forwardRef, allowTableAlignment, allowTableResizing, }: TableComponentWithSharedStateProps) => JSX.Element | null;
28
+ export declare const TableComponentWithSharedState: ({ view, options, getNode, dispatchAnalyticsEvent, api, getEditorFeatureFlags, eventDispatcher, allowColumnResizing, allowControls, getPos, forwardRef, allowTableAlignment, allowTableResizing, }: TableComponentWithSharedStateProps) => React.JSX.Element | null;
29
29
  export {};
@@ -22,7 +22,7 @@ type ResizableTableContainerProps = {
22
22
  shouldUseIncreasedScalingPercent?: boolean;
23
23
  isCommentEditor?: boolean;
24
24
  };
25
- export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, lineLength, editorView, getPos, tableRef, isResizing, pluginInjectionApi, tableWrapperHeight, isWholeTableInDanger, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
25
+ export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, lineLength, editorView, getPos, tableRef, isResizing, pluginInjectionApi, tableWrapperHeight, isWholeTableInDanger, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, }: PropsWithChildren<ResizableTableContainerProps>) => React.JSX.Element>;
26
26
  type TableContainerProps = {
27
27
  node: PMNode;
28
28
  className: string;
@@ -43,5 +43,5 @@ type TableContainerProps = {
43
43
  isCommentEditor?: boolean;
44
44
  isChromelessEditor?: boolean;
45
45
  };
46
- export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
46
+ export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, }: PropsWithChildren<TableContainerProps>) => React.JSX.Element;
47
47
  export {};
@@ -1,4 +1,5 @@
1
1
  import type { PropsWithChildren } from 'react';
2
+ import React from 'react';
2
3
  import type { TableEventPayload } from '@atlaskit/editor-common/analytics';
3
4
  import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
4
5
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
@@ -30,5 +31,5 @@ interface TableResizerProps {
30
31
  onResizeStart?: () => void;
31
32
  disabled?: boolean;
32
33
  }
33
- export declare const TableResizer: ({ children, width, maxWidth, containerWidth, lineLength, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, isWholeTableInDanger, shouldUseIncreasedScalingPercent, pluginInjectionApi, isFullWidthModeEnabled, isCommentEditor, disabled, }: PropsWithChildren<TableResizerProps>) => JSX.Element;
34
+ export declare const TableResizer: ({ children, width, maxWidth, containerWidth, lineLength, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, isWholeTableInDanger, shouldUseIncreasedScalingPercent, pluginInjectionApi, isFullWidthModeEnabled, isCommentEditor, disabled, }: PropsWithChildren<TableResizerProps>) => React.JSX.Element;
34
35
  export {};
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
3
3
  import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
4
4
  import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
@@ -23,7 +23,7 @@ export default class TableView extends ReactNodeView<Props> {
23
23
  };
24
24
  setDomAttrs(node: PmNode): void;
25
25
  getNode: () => PmNode;
26
- render(props: Props, forwardRef: ForwardRef): JSX.Element;
26
+ render(props: Props, forwardRef: ForwardRef): React.JSX.Element;
27
27
  private hasHoveredRows;
28
28
  viewShouldUpdate(nextNode: PmNode): boolean;
29
29
  ignoreMutation(mutation: MutationRecord | {
@@ -1,8 +1,8 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  type HandleIconProps = {
3
3
  forceDefaultHandle: boolean;
4
4
  isHandleHovered: boolean;
5
5
  hasMergedCells: boolean;
6
6
  };
7
- export declare const HandleIconComponent: (props: HandleIconProps) => JSX.Element;
7
+ export declare const HandleIconComponent: (props: HandleIconProps) => React.JSX.Element;
8
8
  export {};
@@ -1,7 +1,7 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { TableDirection } from '../../types';
3
3
  export declare const DragPreview: ({ direction, width, height, }: {
4
4
  direction: TableDirection;
5
5
  width: number;
6
6
  height: number;
7
- }) => JSX.Element;
7
+ }) => React.JSX.Element;
@@ -1,4 +1,4 @@
1
- import { Component } from 'react';
1
+ import React, { Component } from 'react';
2
2
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
3
  import type { Selection } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
@@ -50,6 +50,6 @@ declare class FloatingDeleteButton extends Component<Props, State> {
50
50
  * @memberof FloatingDeleteButton
51
51
  */
52
52
  private handleClick;
53
- render(): JSX.Element | null;
53
+ render(): React.JSX.Element | null;
54
54
  }
55
55
  export default FloatingDeleteButton;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
3
3
  type DropdownMenuProps = {
4
4
  items: Array<{
@@ -32,5 +32,5 @@ type DropdownMenuProps = {
32
32
  boundariesElement?: HTMLElement;
33
33
  scrollableElement?: HTMLElement;
34
34
  };
35
- export declare const DropdownMenu: ({ items, section, disableKeyboardHandling, onItemActivated, handleClose, onMouseEnter, onMouseLeave, fitWidth, fitHeight, direction, mountPoint, boundariesElement, scrollableElement, }: DropdownMenuProps) => JSX.Element;
35
+ export declare const DropdownMenu: ({ items, section, disableKeyboardHandling, onItemActivated, handleClose, onMouseEnter, onMouseLeave, fitWidth, fitHeight, direction, mountPoint, boundariesElement, scrollableElement, }: DropdownMenuProps) => React.JSX.Element;
36
36
  export {};
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
3
  import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
4
4
  import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
@@ -28,7 +28,7 @@ interface Props {
28
28
  isCommentEditor?: boolean;
29
29
  }
30
30
  declare const FloatingDragMenu: {
31
- ({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, tableNode, direction, index, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, stickyHeaders, pluginConfig, isTableScalingEnabled, getEditorFeatureFlags, ariaNotifyPlugin, api, isCommentEditor, }: Props): JSX.Element | null;
31
+ ({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, tableNode, direction, index, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, stickyHeaders, pluginConfig, isTableScalingEnabled, getEditorFeatureFlags, ariaNotifyPlugin, api, isCommentEditor, }: Props): React.JSX.Element | null;
32
32
  displayName: string;
33
33
  };
34
34
  export default FloatingDragMenu;
@@ -30,7 +30,7 @@ export interface Props {
30
30
  export declare class FloatingInsertButton extends React.Component<Props & WrappedComponentProps, any> {
31
31
  static displayName: string;
32
32
  constructor(props: Props & WrappedComponentProps);
33
- render(): JSX.Element | null;
33
+ render(): React.JSX.Element | null;
34
34
  private getCellPosition;
35
35
  private insertRow;
36
36
  private insertColumn;
@@ -12,5 +12,5 @@ interface Props {
12
12
  number
13
13
  ];
14
14
  }
15
- export declare const FloatingToolbarLabel: React.MemoExoticComponent<(props: Props) => JSX.Element>;
15
+ export declare const FloatingToolbarLabel: React.MemoExoticComponent<(props: Props) => React.JSX.Element>;
16
16
  export {};
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
4
  import type { TablePlugin } from '../../../tablePluginType';
@@ -28,5 +28,5 @@ export declare const ColumnControls: ({ editorView, tableActive, tableRef, hover
28
28
  commands: import("../../../tablePluginType").TablePluginCommands;
29
29
  dependencies: import("../../../tablePluginType").TablePluginDependencies;
30
30
  }> | undefined;
31
- }) => JSX.Element;
31
+ }) => React.JSX.Element;
32
32
  export {};
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  interface Props {
3
3
  index: number;
4
4
  localId?: string;
@@ -6,5 +6,5 @@ interface Props {
6
6
  height?: number;
7
7
  marginTop?: number;
8
8
  }
9
- export declare const ColumnDropTarget: ({ index, localId, width, height, marginTop }: Props) => JSX.Element;
9
+ export declare const ColumnDropTarget: ({ index, localId, width, height, marginTop }: Props) => React.JSX.Element;
10
10
  export {};
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  interface Props {
3
3
  tableRef: HTMLTableElement;
4
4
  tableHeight?: number;
@@ -7,5 +7,5 @@ interface Props {
7
7
  isHeaderSticky?: boolean;
8
8
  getScrollOffset?: () => number;
9
9
  }
10
- export declare const ColumnDropTargets: ({ tableRef, tableHeight, localId, colWidths, isHeaderSticky, getScrollOffset, }: Props) => JSX.Element | null;
10
+ export declare const ColumnDropTargets: ({ tableRef, tableHeight, localId, colWidths, isHeaderSticky, getScrollOffset, }: Props) => React.JSX.Element | null;
11
11
  export {};
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { TableColumnOrdering } from '@atlaskit/custom-steps';
3
3
  import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
4
4
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
@@ -29,5 +29,5 @@ interface Props {
29
29
  api?: PluginInjectionAPI;
30
30
  isChromelessEditor?: boolean;
31
31
  }
32
- declare const TableFloatingColumnControls: ({ editorView, tableRef, getNode, tableActive, hasHeaderRow, hoveredCell, isResizing, stickyHeader, selection, isInDanger, isTableHovered, tableContainerWidth, isNumberColumnEnabled, getScrollOffset, tableWrapperHeight, api, isChromelessEditor, }: Props) => JSX.Element | null;
32
+ declare const TableFloatingColumnControls: ({ editorView, tableRef, getNode, tableActive, hasHeaderRow, hoveredCell, isResizing, stickyHeader, selection, isInDanger, isTableHovered, tableContainerWidth, isNumberColumnEnabled, getScrollOffset, tableWrapperHeight, api, isChromelessEditor, }: Props) => React.JSX.Element | null;
33
33
  export default TableFloatingColumnControls;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
4
  import type { TablePlugin } from '../../tablePluginType';
@@ -16,5 +16,5 @@ type FloatingControlsWithSelectionProps = {
16
16
  tableActive: boolean;
17
17
  api?: ExtractInjectionAPI<TablePlugin>;
18
18
  };
19
- export declare const FloatingControlsWithSelection: ({ editorView, tableRef, isInDanger, isResizing, isHeaderRowEnabled, isHeaderColumnEnabled, hoveredRows, stickyTop, hoverRows, selectRow, tableActive, api, }: FloatingControlsWithSelectionProps) => JSX.Element;
19
+ export declare const FloatingControlsWithSelection: ({ editorView, tableRef, isInDanger, isResizing, isHeaderRowEnabled, isHeaderColumnEnabled, hoveredRows, stickyTop, hoverRows, selectRow, tableActive, api, }: FloatingControlsWithSelectionProps) => React.JSX.Element;
20
20
  export {};
@@ -1,4 +1,4 @@
1
- import { Component } from 'react';
1
+ import React, { Component } from 'react';
2
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  interface Props {
4
4
  editorView: EditorView;
@@ -15,7 +15,7 @@ interface Props {
15
15
  isDragAndDropEnabled?: boolean;
16
16
  }
17
17
  export default class NumberColumn extends Component<Props, any> {
18
- render(): JSX.Element;
18
+ render(): React.JSX.Element;
19
19
  private hoverRows;
20
20
  private selectRow;
21
21
  private clearHoverSelection;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
3
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { Selection } from '@atlaskit/editor-prosemirror/state';
@@ -22,6 +22,6 @@ type DragControlsProps = {
22
22
  api?: ExtractInjectionAPI<TablePlugin>;
23
23
  selection?: Selection;
24
24
  };
25
- export declare const DragControls: ({ tableRef, tableNode, tableWidth, hoveredCell, tableActive, editorView, isInDanger, isResizing, isTableHovered, hoverRows, selectRow, selectRows, updateCellHoverLocation, api, selection, }: DragControlsProps) => JSX.Element | null;
26
- export declare const DragControlsWithSelection: ({ editorView, tableRef, tableNode, tableWidth, tableActive, hoveredCell, isInDanger, isTableHovered, isResizing, hoverRows, selectRow, selectRows, updateCellHoverLocation, api, }: Exclude<DragControlsProps, 'selection'>) => JSX.Element;
25
+ export declare const DragControls: ({ tableRef, tableNode, tableWidth, hoveredCell, tableActive, editorView, isInDanger, isResizing, isTableHovered, hoverRows, selectRow, selectRows, updateCellHoverLocation, api, selection, }: DragControlsProps) => React.JSX.Element | null;
26
+ export declare const DragControlsWithSelection: ({ editorView, tableRef, tableNode, tableWidth, tableActive, hoveredCell, isInDanger, isTableHovered, isResizing, hoverRows, selectRow, selectRows, updateCellHoverLocation, api, }: Exclude<DragControlsProps, 'selection'>) => React.JSX.Element;
27
27
  export {};
@@ -4,5 +4,5 @@ type RowDropTargetProps = {
4
4
  localId?: string;
5
5
  style?: React.CSSProperties;
6
6
  };
7
- declare const RowDropTarget: ({ index, localId, style }: RowDropTargetProps) => JSX.Element;
7
+ declare const RowDropTarget: ({ index, localId, style }: RowDropTargetProps) => React.JSX.Element;
8
8
  export default RowDropTarget;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { TableColumnOrdering } from '@atlaskit/custom-steps';
3
3
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
4
4
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
@@ -38,5 +38,5 @@ export declare const TableFloatingControls: ({ editorView, tableRef, tableNode,
38
38
  commands: import("../../tablePluginType").TablePluginCommands;
39
39
  dependencies: import("../../tablePluginType").TablePluginDependencies;
40
40
  }> | undefined;
41
- }) => JSX.Element | null;
41
+ }) => React.JSX.Element | null;
42
42
  export default TableFloatingControls;
@@ -1,2 +1,2 @@
1
- /// <reference types="react" />
2
- export declare const FullWidthDisplay: () => JSX.Element;
1
+ import React from 'react';
2
+ export declare const FullWidthDisplay: () => React.JSX.Element;
@@ -1,2 +1,2 @@
1
- /// <reference types="react" />
2
- export declare const AddColLeftIcon: () => JSX.Element;
1
+ import React from 'react';
2
+ export declare const AddColLeftIcon: () => React.JSX.Element;
@@ -1,2 +1,2 @@
1
- /// <reference types="react" />
2
- export declare const AddColRightIcon: () => JSX.Element;
1
+ import React from 'react';
2
+ export declare const AddColRightIcon: () => React.JSX.Element;
@@ -1,2 +1,2 @@
1
- /// <reference types="react" />
2
- export declare const AddRowAboveIcon: () => JSX.Element;
1
+ import React from 'react';
2
+ export declare const AddRowAboveIcon: () => React.JSX.Element;
@@ -1,2 +1,2 @@
1
- /// <reference types="react" />
2
- export declare const AddRowBelowIcon: () => JSX.Element;
1
+ import React from 'react';
2
+ export declare const AddRowBelowIcon: () => React.JSX.Element;
@@ -2,5 +2,5 @@ import React from 'react';
2
2
  interface DragHandleDisabledIconProps {
3
3
  style?: React.CSSProperties;
4
4
  }
5
- export declare const DragHandleDisabledIcon: ({ style }: DragHandleDisabledIconProps) => JSX.Element;
5
+ export declare const DragHandleDisabledIcon: ({ style }: DragHandleDisabledIconProps) => React.JSX.Element;
6
6
  export {};
@@ -1,2 +1,2 @@
1
- /// <reference types="react" />
2
- export declare const DragHandleIcon: () => JSX.Element;
1
+ import React from 'react';
2
+ export declare const DragHandleIcon: () => React.JSX.Element;
@@ -2,5 +2,5 @@ import React from 'react';
2
2
  interface DragInMotionIconProps {
3
3
  style?: React.CSSProperties;
4
4
  }
5
- export declare const DragInMotionIcon: ({ style }: DragInMotionIconProps) => JSX.Element;
5
+ export declare const DragInMotionIcon: ({ style }: DragInMotionIconProps) => React.JSX.Element;
6
6
  export {};
@@ -1,2 +1,2 @@
1
- /// <reference types="react" />
2
- export declare const MergeCellsIcon: () => JSX.Element;
1
+ import React from 'react';
2
+ export declare const MergeCellsIcon: () => React.JSX.Element;
@@ -1,2 +1,2 @@
1
- /// <reference types="react" />
2
- export declare const MinimisedHandleIcon: () => JSX.Element;
1
+ import React from 'react';
2
+ export declare const MinimisedHandleIcon: () => React.JSX.Element;
@@ -6,5 +6,5 @@ type SortingIconProps = React.ComponentProps<typeof SortingIcon>;
6
6
  type SortingIconWrapperProps = SortingIconProps & {
7
7
  api: ExtractInjectionAPI<TablePlugin>;
8
8
  };
9
- export declare const SortingIconWrapper: (props: SortingIconWrapperProps) => JSX.Element | null;
9
+ export declare const SortingIconWrapper: (props: SortingIconWrapperProps) => React.JSX.Element | null;
10
10
  export {};
@@ -1,2 +1,2 @@
1
- /// <reference types="react" />
2
- export declare const SplitCellIcon: () => JSX.Element;
1
+ import React from 'react';
2
+ export declare const SplitCellIcon: () => React.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "9.3.2",
3
+ "version": "9.3.4",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -28,9 +28,9 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@atlaskit/adf-schema": "^46.1.0",
31
- "@atlaskit/button": "^20.4.0",
31
+ "@atlaskit/button": "^20.5.0",
32
32
  "@atlaskit/custom-steps": "^0.9.0",
33
- "@atlaskit/editor-common": "^99.7.0",
33
+ "@atlaskit/editor-common": "^99.8.0",
34
34
  "@atlaskit/editor-palette": "1.7.0",
35
35
  "@atlaskit/editor-plugin-accessibility-utils": "^1.3.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^1.11.0",
@@ -43,15 +43,15 @@
43
43
  "@atlaskit/editor-prosemirror": "6.2.1",
44
44
  "@atlaskit/editor-shared-styles": "^3.2.0",
45
45
  "@atlaskit/editor-tables": "^2.8.0",
46
- "@atlaskit/icon": "^23.5.0",
46
+ "@atlaskit/icon": "^23.6.0",
47
47
  "@atlaskit/menu": "^2.14.0",
48
- "@atlaskit/platform-feature-flags": "^0.3.0",
48
+ "@atlaskit/platform-feature-flags": "^1.0.0",
49
49
  "@atlaskit/pragmatic-drag-and-drop": "^1.5.0",
50
50
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
51
51
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.0",
52
52
  "@atlaskit/primitives": "^13.4.0",
53
53
  "@atlaskit/theme": "^14.1.0",
54
- "@atlaskit/tmp-editor-statsig": "^2.41.0",
54
+ "@atlaskit/tmp-editor-statsig": "^2.42.0",
55
55
  "@atlaskit/toggle": "^14.1.0",
56
56
  "@atlaskit/tokens": "^3.3.0",
57
57
  "@atlaskit/tooltip": "^19.1.0",
@@ -140,6 +140,12 @@
140
140
  },
141
141
  "platform_editor_nested_tables_paste_dupe_fix": {
142
142
  "type": "boolean"
143
+ },
144
+ "platform_editor_nested_tables_resizing": {
145
+ "type": "boolean"
146
+ },
147
+ "platform_editor_table_layout_shift_fix": {
148
+ "type": "boolean"
143
149
  }
144
150
  }
145
151
  }
@@ -5,6 +5,7 @@ import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
5
5
  import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
6
6
  import type { DOMOutputSpec, NodeSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
7
7
  import { akEditorGutterPaddingDynamic } from '@atlaskit/editor-shared-styles';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
8
9
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
9
10
 
10
11
  import { generateColgroup, getResizerMinWidth } from '../pm-plugins/table-resizing/utils/colgroup';
@@ -136,16 +137,16 @@ export const tableNodeSpecWithFixedToDOM = (config: Config): NodeSpec => {
136
137
  {
137
138
  class: 'resizer-item display-handle',
138
139
  style: convertToInlineCss({
139
- position: 'relative',
140
- userSelect: 'auto',
141
- boxSizing: 'border-box',
142
- '--ak-editor-table-gutter-padding': `${gutterPadding}px`,
143
- '--ak-editor-table-max-width': `${TABLE_MAX_WIDTH}px`,
144
- '--ak-editor-table-min-width': `${tableMinWidth}px`,
145
- minWidth: 'var(--ak-editor-table-min-width)',
146
- maxWidth: `min(calc(100cqw - var(--ak-editor-table-gutter-padding)), var(--ak-editor-table-max-width))`,
147
- width: `min(calc(100cqw - var(--ak-editor-table-gutter-padding)), ${node.attrs.width})`,
148
- })
140
+ position: 'relative',
141
+ userSelect: 'auto',
142
+ boxSizing: 'border-box',
143
+ '--ak-editor-table-gutter-padding': `${gutterPadding}px`,
144
+ '--ak-editor-table-max-width': `${TABLE_MAX_WIDTH}px`,
145
+ '--ak-editor-table-min-width': `${tableMinWidth}px`,
146
+ minWidth: 'var(--ak-editor-table-min-width)',
147
+ maxWidth: `min(calc(100cqw - var(--ak-editor-table-gutter-padding)), var(--ak-editor-table-max-width))`,
148
+ width: fg('platform_editor_table_layout_shift_fix') ? `min(calc(100cqw - var(--ak-editor-table-gutter-padding)), ${node.attrs.width}px)` : `min(calc(100cqw - var(--ak-editor-table-gutter-padding)), ${node.attrs.width})`,
149
+ }),
149
150
  },
150
151
  [
151
152
  'span',
@@ -13,6 +13,7 @@ import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/e
13
13
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
14
14
  import { TableMap } from '@atlaskit/editor-tables/table-map';
15
15
  import { getSelectionRect } from '@atlaskit/editor-tables/utils';
16
+ import { fg } from '@atlaskit/platform-feature-flags';
16
17
 
17
18
  import type { PluginInjectionAPI } from '../../types';
18
19
  import { stopKeyboardColumnResizing } from '../commands/column-resize';
@@ -20,6 +21,7 @@ import { updateResizeHandleDecorations } from '../commands/misc';
20
21
  import { getPluginState as getTablePluginState } from '../plugin-factory';
21
22
  import { META_KEYS } from '../table-analytics';
22
23
  import { updateColumnWidths } from '../transforms/column-width';
24
+ import { tablesHaveDifferentNoOfColumns } from '../utils/nodes';
23
25
  import { getSelectedColumnIndexes } from '../utils/selection';
24
26
 
25
27
  import { evenColumns, setDragging, stopResizing } from './commands';
@@ -195,10 +197,17 @@ export const handleMouseDown = (
195
197
  if (dragging) {
196
198
  const { startX } = dragging;
197
199
 
198
- // If the table has changed (via collab for example) don't apply column widths
199
- // For example, if a table col is deleted we won't be able to reliably remap the new widths
200
- // There may be a more elegant solution to this, to avoid a jarring experience.
201
- if (table.eq(originalTable)) {
200
+ // If the dimensions of the table have changed through a remote modification by another
201
+ // person for example don't persist the new column widths as we couldn't reliably remap them
202
+ // For example, if a table col is deleted
203
+ // There may be a more elegant solution to this, to avoid a jarring experience. This used to
204
+ // be an equality check but that caused issues when a nested table would change (eg. when it
205
+ // dynamically updates its width on resize)
206
+ if (
207
+ fg('platform_editor_nested_tables_resizing')
208
+ ? !tablesHaveDifferentNoOfColumns(originalTable, table)
209
+ : table.eq(originalTable)
210
+ ) {
202
211
  const map = TableMap.get(table);
203
212
  const colIndex =
204
213
  map.colCount($cell.pos - start) +
@@ -4,6 +4,7 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
5
5
  import type { DomAtPos } from '@atlaskit/editor-prosemirror/utils';
6
6
  import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
7
8
 
8
9
  import type { PluginInjectionAPI } from '../../../types';
9
10
  import { updateColumnWidths } from '../../transforms/column-width';
@@ -267,6 +268,11 @@ export const scaleTable =
267
268
 
268
269
  if (resizeState) {
269
270
  tr = updateColumnWidths(resizeState, node, start, api)(tr);
271
+ if (fg('platform_editor_nested_tables_resizing')) {
272
+ // Avoid adding this transaction separately to the history as these are automatic updates
273
+ // as a consequence of another action
274
+ tr.setMeta('addToHistory', false);
275
+ }
270
276
 
271
277
  if (tr.docChanged) {
272
278
  tr.setMeta('scrollIntoView', false);
@@ -101,10 +101,7 @@ const TableFloatingColumnControls = ({
101
101
 
102
102
  if (stickyTop) {
103
103
  const columnControlTopOffsetFromParent = '-12px';
104
- containerRef?.current?.style.setProperty(
105
- 'top',
106
- columnControlTopOffsetFromParent
107
- );
104
+ containerRef?.current?.style.setProperty('top', columnControlTopOffsetFromParent);
108
105
  } else {
109
106
  containerRef?.current?.style.removeProperty('top');
110
107
  }
@@ -38,9 +38,7 @@ class CornerControlComponent extends Component<CornerControlProps & WrappedCompo
38
38
  })}
39
39
  style={{
40
40
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
41
- top: this.props.stickyTop !== undefined
42
- ? `0px`
43
- : undefined
41
+ top: this.props.stickyTop !== undefined ? `0px` : undefined,
44
42
  }}
45
43
  contentEditable={false}
46
44
  >
@@ -84,9 +84,7 @@ class RowControlsComponent extends Component<Props & WrappedComponentProps> {
84
84
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
85
85
  marginTop: `${marginTop}px`,
86
86
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
87
- top: thisRowSticky
88
- ? `3px`
89
- : undefined,
87
+ top: thisRowSticky ? `3px` : undefined,
90
88
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
91
89
  paddingTop: thisRowSticky ? `${tableControlsSpacing}px` : undefined,
92
90
  }}