@atlaskit/editor-plugin-table 7.16.18 → 7.16.19

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 (134) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/commands/column-resize.js +4 -3
  3. package/dist/cjs/commands/delete.js +3 -2
  4. package/dist/cjs/commands/insert.js +12 -8
  5. package/dist/cjs/commands-with-analytics.js +10 -7
  6. package/dist/cjs/event-handlers.js +3 -2
  7. package/dist/cjs/nodeviews/TableComponent.js +32 -19
  8. package/dist/cjs/nodeviews/TableContainer.js +4 -0
  9. package/dist/cjs/nodeviews/TableResizer.js +3 -2
  10. package/dist/cjs/nodeviews/table.js +6 -4
  11. package/dist/cjs/plugin.js +9 -6
  12. package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +12 -13
  13. package/dist/cjs/pm-plugins/keymap.js +11 -9
  14. package/dist/cjs/pm-plugins/main.js +4 -1
  15. package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +10 -9
  16. package/dist/cjs/pm-plugins/table-resizing/utils/resize-state.js +4 -3
  17. package/dist/cjs/pm-plugins/table-resizing/utils/scale-table.js +4 -3
  18. package/dist/cjs/toolbar.js +29 -20
  19. package/dist/cjs/transforms/column-width.js +3 -3
  20. package/dist/cjs/transforms/delete-columns.js +3 -2
  21. package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +21 -15
  22. package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +3 -2
  23. package/dist/cjs/ui/FloatingDragMenu/index.js +6 -3
  24. package/dist/cjs/ui/FloatingInsertButton/index.js +7 -8
  25. package/dist/cjs/utils/drag-menu.js +5 -4
  26. package/dist/es2019/commands/column-resize.js +4 -3
  27. package/dist/es2019/commands/delete.js +2 -2
  28. package/dist/es2019/commands/insert.js +8 -8
  29. package/dist/es2019/commands-with-analytics.js +9 -8
  30. package/dist/es2019/event-handlers.js +2 -2
  31. package/dist/es2019/nodeviews/TableComponent.js +28 -17
  32. package/dist/es2019/nodeviews/TableContainer.js +4 -0
  33. package/dist/es2019/nodeviews/TableResizer.js +3 -2
  34. package/dist/es2019/nodeviews/table.js +5 -4
  35. package/dist/es2019/plugin.js +9 -6
  36. package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +7 -10
  37. package/dist/es2019/pm-plugins/keymap.js +9 -9
  38. package/dist/es2019/pm-plugins/main.js +4 -1
  39. package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +10 -9
  40. package/dist/es2019/pm-plugins/table-resizing/utils/resize-state.js +4 -4
  41. package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +4 -4
  42. package/dist/es2019/toolbar.js +25 -22
  43. package/dist/es2019/transforms/column-width.js +2 -3
  44. package/dist/es2019/transforms/delete-columns.js +2 -2
  45. package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +12 -7
  46. package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +3 -2
  47. package/dist/es2019/ui/FloatingDragMenu/index.js +5 -3
  48. package/dist/es2019/ui/FloatingInsertButton/index.js +6 -8
  49. package/dist/es2019/utils/drag-menu.js +4 -4
  50. package/dist/esm/commands/column-resize.js +4 -3
  51. package/dist/esm/commands/delete.js +3 -2
  52. package/dist/esm/commands/insert.js +12 -8
  53. package/dist/esm/commands-with-analytics.js +10 -7
  54. package/dist/esm/event-handlers.js +3 -2
  55. package/dist/esm/nodeviews/TableComponent.js +32 -19
  56. package/dist/esm/nodeviews/TableContainer.js +4 -0
  57. package/dist/esm/nodeviews/TableResizer.js +3 -2
  58. package/dist/esm/nodeviews/table.js +6 -4
  59. package/dist/esm/plugin.js +9 -6
  60. package/dist/esm/pm-plugins/drag-and-drop/plugin.js +12 -13
  61. package/dist/esm/pm-plugins/keymap.js +11 -9
  62. package/dist/esm/pm-plugins/main.js +4 -1
  63. package/dist/esm/pm-plugins/table-resizing/event-handlers.js +10 -9
  64. package/dist/esm/pm-plugins/table-resizing/utils/resize-state.js +4 -3
  65. package/dist/esm/pm-plugins/table-resizing/utils/scale-table.js +4 -3
  66. package/dist/esm/toolbar.js +29 -20
  67. package/dist/esm/transforms/column-width.js +3 -3
  68. package/dist/esm/transforms/delete-columns.js +3 -2
  69. package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +21 -15
  70. package/dist/esm/ui/FloatingDragMenu/DragMenu.js +3 -2
  71. package/dist/esm/ui/FloatingDragMenu/index.js +6 -3
  72. package/dist/esm/ui/FloatingInsertButton/index.js +7 -8
  73. package/dist/esm/utils/drag-menu.js +5 -4
  74. package/dist/types/commands/column-resize.d.ts +2 -1
  75. package/dist/types/commands/delete.d.ts +1 -1
  76. package/dist/types/commands/insert.d.ts +4 -4
  77. package/dist/types/commands-with-analytics.d.ts +4 -4
  78. package/dist/types/event-handlers.d.ts +1 -1
  79. package/dist/types/nodeviews/TableContainer.d.ts +4 -2
  80. package/dist/types/nodeviews/TableResizer.d.ts +2 -1
  81. package/dist/types/nodeviews/table.d.ts +1 -0
  82. package/dist/types/pm-plugins/drag-and-drop/plugin.d.ts +1 -1
  83. package/dist/types/pm-plugins/keymap.d.ts +1 -1
  84. package/dist/types/pm-plugins/table-resizing/utils/resize-state.d.ts +1 -1
  85. package/dist/types/pm-plugins/table-resizing/utils/scale-table.d.ts +1 -1
  86. package/dist/types/toolbar.d.ts +5 -5
  87. package/dist/types/transforms/column-width.d.ts +1 -1
  88. package/dist/types/transforms/delete-columns.d.ts +1 -1
  89. package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +2 -1
  90. package/dist/types/ui/FloatingInsertButton/index.d.ts +1 -0
  91. package/dist/types/utils/drag-menu.d.ts +1 -1
  92. package/dist/types-ts4.5/commands/column-resize.d.ts +2 -1
  93. package/dist/types-ts4.5/commands/delete.d.ts +1 -1
  94. package/dist/types-ts4.5/commands/insert.d.ts +4 -4
  95. package/dist/types-ts4.5/commands-with-analytics.d.ts +4 -4
  96. package/dist/types-ts4.5/event-handlers.d.ts +1 -1
  97. package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +4 -2
  98. package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +2 -1
  99. package/dist/types-ts4.5/nodeviews/table.d.ts +1 -0
  100. package/dist/types-ts4.5/pm-plugins/drag-and-drop/plugin.d.ts +1 -1
  101. package/dist/types-ts4.5/pm-plugins/keymap.d.ts +1 -1
  102. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/resize-state.d.ts +1 -1
  103. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/scale-table.d.ts +1 -1
  104. package/dist/types-ts4.5/toolbar.d.ts +5 -5
  105. package/dist/types-ts4.5/transforms/column-width.d.ts +1 -1
  106. package/dist/types-ts4.5/transforms/delete-columns.d.ts +1 -1
  107. package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +2 -1
  108. package/dist/types-ts4.5/ui/FloatingInsertButton/index.d.ts +1 -0
  109. package/dist/types-ts4.5/utils/drag-menu.d.ts +1 -1
  110. package/package.json +2 -5
  111. package/src/commands/column-resize.ts +6 -6
  112. package/src/commands/delete.ts +7 -1
  113. package/src/commands/insert.ts +33 -5
  114. package/src/commands-with-analytics.ts +14 -2
  115. package/src/event-handlers.ts +2 -0
  116. package/src/nodeviews/TableComponent.tsx +28 -28
  117. package/src/nodeviews/TableContainer.tsx +6 -0
  118. package/src/nodeviews/TableResizer.tsx +4 -0
  119. package/src/nodeviews/table.tsx +4 -2
  120. package/src/plugin.tsx +17 -7
  121. package/src/pm-plugins/drag-and-drop/plugin.ts +26 -13
  122. package/src/pm-plugins/keymap.ts +30 -4
  123. package/src/pm-plugins/main.ts +2 -0
  124. package/src/pm-plugins/table-resizing/event-handlers.ts +12 -14
  125. package/src/pm-plugins/table-resizing/utils/resize-state.ts +5 -5
  126. package/src/pm-plugins/table-resizing/utils/scale-table.ts +6 -4
  127. package/src/toolbar.tsx +46 -12
  128. package/src/transforms/column-width.ts +7 -3
  129. package/src/transforms/delete-columns.ts +6 -2
  130. package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +12 -4
  131. package/src/ui/FloatingDragMenu/DragMenu.tsx +3 -0
  132. package/src/ui/FloatingDragMenu/index.tsx +4 -4
  133. package/src/ui/FloatingInsertButton/index.tsx +12 -9
  134. package/src/utils/drag-menu.ts +13 -4
@@ -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) => void;
19
+ export declare const previewScaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabled?: boolean, isTableWithFixedColumnWidthsOptionEnabled?: boolean) => void;
20
20
  export declare const scaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabledOnCurrentTable?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (tr: Transaction) => Transaction;
@@ -8,17 +8,17 @@ 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, 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) => FloatingToolbarDropdown<Command>;
12
12
  export declare const getClosestSelectionRect: (state: EditorState) => Rect | undefined;
13
13
  export declare const getClosestSelectionOrTableRect: (state: EditorState) => Rect | undefined;
14
- export declare const getToolbarConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorFeatureFlags: GetEditorFeatureFlags, getEditorView: () => EditorView | null, options?: TablePluginOptions, isTableScalingWithFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (config: PluginConfig) => FloatingToolbarHandler;
15
- export declare const getDistributeConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean) => Command;
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;
16
16
  type AlignmentIcon = {
17
17
  id?: string;
18
18
  value: AlignmentOptions;
19
19
  icon: React.ComponentClass<any>;
20
20
  };
21
- export declare const getAlignmentOptionsConfig: (editorState: EditorState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorContainerWidth: GetEditorContainerWidth, getDomRef: (editorView: EditorView) => HTMLElement | undefined, editorView: EditorView | null) => Array<FloatingToolbarDropdown<Command>>;
21
+ export declare const getAlignmentOptionsConfig: (editorState: EditorState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorContainerWidth: GetEditorContainerWidth, getDomRef: (editorView: EditorView) => HTMLElement | undefined, editorView: EditorView | null, shouldUseIncreasedScalingPercent: boolean) => Array<FloatingToolbarDropdown<Command>>;
22
22
  export declare const getSelectedAlignmentIcon: (alignmentIcons: AlignmentIcon[], selectedNode: PMNode) => AlignmentIcon | undefined;
23
- export declare const isLayoutOptionDisabled: (selectedNode: PMNode, getEditorContainerWidth: GetEditorContainerWidth, getDomRef: (editorView: EditorView) => HTMLElement | undefined, editorView: EditorView | null) => boolean;
23
+ export declare const isLayoutOptionDisabled: (selectedNode: PMNode, getEditorContainerWidth: GetEditorContainerWidth, getDomRef: (editorView: EditorView) => HTMLElement | undefined, editorView: EditorView | null, shouldUseIncreasedScalingPercent: boolean) => boolean;
24
24
  export {};
@@ -21,4 +21,4 @@ export declare const updateColumnWidths: (resizeState: ResizeState, table: PMNod
21
21
  * @param view
22
22
  * @returns Updated transaction with rescaled columns for a given table
23
23
  */
24
- export declare const rescaleColumns: (isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (table: ContentNodeWithPos, view: EditorView | undefined) => (tr: Transaction) => Transaction;
24
+ export declare const rescaleColumns: (isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (table: ContentNodeWithPos, view: EditorView | undefined) => (tr: Transaction) => Transaction;
@@ -1,4 +1,4 @@
1
1
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
2
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  import type { Rect } from '@atlaskit/editor-tables/table-map';
4
- export declare const deleteColumns: (rect: Rect, allowCustomStep: boolean, view?: EditorView, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (tr: Transaction) => Transaction;
4
+ export declare const deleteColumns: (rect: Rect, allowCustomStep: boolean, view?: EditorView, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (tr: Transaction) => Transaction;
@@ -27,8 +27,9 @@ type DragMenuProps = {
27
27
  isTableScalingEnabled?: boolean;
28
28
  tableDuplicateCellColouring?: boolean;
29
29
  shouldUseIncreasedScalingPercent?: boolean;
30
+ isTableFixedColumnWidthsOptionEnabled?: boolean;
30
31
  };
31
- export declare const DragMenu: React.MemoExoticComponent<({ direction, index, target, isOpen, editorView, tableNode, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, fitHeight, fitWidth, mountPoint, scrollableElement, boundariesElement, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
32
+ export declare const DragMenu: React.MemoExoticComponent<({ direction, index, target, isOpen, editorView, tableNode, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, fitHeight, fitWidth, mountPoint, scrollableElement, boundariesElement, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent, isTableFixedColumnWidthsOptionEnabled, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
32
33
  declare const _default: React.FC<import("react-intl-next").WithIntlProps<DragMenuProps & WrappedComponentProps>> & {
33
34
  WrappedComponent: React.ComponentType<DragMenuProps & WrappedComponentProps>;
34
35
  };
@@ -14,6 +14,7 @@ export interface Props {
14
14
  isHeaderColumnEnabled?: boolean;
15
15
  isHeaderRowEnabled?: boolean;
16
16
  isDragAndDropEnabled?: boolean;
17
+ isTableScalingEnabled?: boolean;
17
18
  mountPoint?: HTMLElement;
18
19
  boundariesElement?: HTMLElement;
19
20
  scrollableElement?: HTMLElement;
@@ -13,4 +13,4 @@ export interface DragMenuConfig extends DropdownOptionT<Command> {
13
13
  icon?: React.ComponentType<React.PropsWithChildren<IconProps>>;
14
14
  keymap?: string;
15
15
  }
16
- export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, canDrag: boolean, hasMergedCellsInTable: boolean, editorView: EditorView, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean, tableDuplicateCellColouring?: boolean, shouldUseIncreasedScalingPercent?: boolean) => DragMenuConfig[];
16
+ export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, canDrag: boolean, hasMergedCellsInTable: boolean, editorView: EditorView, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean, tableDuplicateCellColouring?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => DragMenuConfig[];
@@ -12,10 +12,11 @@ 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, ariaNotify, getIntl, }: {
15
+ export declare const changeColumnWidthByStep: ({ stepSize, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, ariaNotify, getIntl, }: {
16
16
  stepSize: number;
17
17
  getEditorContainerWidth: GetEditorContainerWidth;
18
18
  isTableScalingEnabled: boolean;
19
+ isTableFixedColumnWidthsOptionEnabled: boolean;
19
20
  ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined;
20
21
  getIntl?: (() => IntlShape) | undefined;
21
22
  originalTr?: Transaction | undefined;
@@ -1,3 +1,3 @@
1
1
  import type { Command } from '@atlaskit/editor-common/types';
2
2
  import type { Rect } from '@atlaskit/editor-tables/table-map';
3
- export declare const deleteColumnsCommand: (rect: Rect, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
3
+ export declare const deleteColumnsCommand: (rect: Rect, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
@@ -3,10 +3,10 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import type { Command, EditorCommand } from '@atlaskit/editor-common/types';
4
4
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
5
5
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
- export declare function addColumnAt(isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, shouldUseIncreasedScalingPercent?: boolean): (column: number, allowAddColumnCustomStep: boolean | undefined, view: EditorView | undefined) => (tr: Transaction) => Transaction;
7
- export declare const addColumnBefore: (isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
8
- export declare const addColumnAfter: (isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
9
- export declare const insertColumn: (isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (column: number) => Command;
6
+ export declare function addColumnAt(isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean): (column: number, allowAddColumnCustomStep: boolean | undefined, view: EditorView | undefined) => (tr: Transaction) => Transaction;
7
+ export declare const addColumnBefore: (isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
8
+ export declare const addColumnAfter: (isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
9
+ export declare const insertColumn: (isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (column: number) => Command;
10
10
  export declare const insertRow: (row: number, moveCursorToTheNewRow: boolean, isCellBackgroundDuplicated?: boolean) => Command;
11
11
  export declare const createTable: (isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthModeEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined | null) => Command;
12
12
  export declare const insertTableWithSize: (isFullWidthModeEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI) => (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
@@ -16,11 +16,11 @@ 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, targetCellPosition?: number, 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, inputMethod: INPUT_METHOD.SHORTCUT, ariaNotify?: ((message: string) => void) | undefined, getIntl?: () => IntlShape) => Command;
20
- export declare const insertColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isCellbackgroundDuplicated?: 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;
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;
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
- export declare const deleteColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: 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;
23
- export declare const deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
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;
23
+ export declare const deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
24
24
  export declare const deleteTableWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
25
25
  export declare const deleteTableIfSelectedWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.FLOATING_TB | INPUT_METHOD.KEYBOARD) => Command;
26
26
  export declare const toggleHeaderRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
@@ -12,7 +12,7 @@ export declare const handleMouseEnter: (view: EditorView, mouseEvent: Event) =>
12
12
  export declare const handleMouseLeave: (view: EditorView, event: Event) => boolean;
13
13
  export declare const handleMouseMove: (view: EditorView, event: Event) => boolean;
14
14
  export declare function handleTripleClick(view: EditorView, pos: number): boolean;
15
- export declare const handleCut: (oldTr: Transaction, oldState: EditorState, newState: EditorState, editorAnalyticsAPI?: EditorAnalyticsAPI, editorView?: EditorView, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Transaction;
15
+ export declare const handleCut: (oldTr: Transaction, oldState: EditorState, newState: EditorState, editorAnalyticsAPI?: EditorAnalyticsAPI, editorView?: EditorView, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Transaction;
16
16
  export declare const isTableInFocus: (view: EditorView) => boolean;
17
17
  export declare const whenTableInFocus: (eventHandler: (view: EditorView, mouseEvent: Event) => boolean) => (view: EditorView, mouseEvent: Event) => boolean;
18
18
  export declare const withCellTracking: (eventHandler: (view: EditorView, mouseEvent: Event) => boolean) => (view: EditorView, mouseEvent: Event) => boolean;
@@ -28,10 +28,11 @@ type ResizableTableContainerProps = {
28
28
  tableWrapperHeight?: number;
29
29
  isWholeTableInDanger?: boolean;
30
30
  isTableScalingEnabled?: boolean;
31
+ isTableWithFixedColumnWidthsOptionEnabled?: boolean;
31
32
  isTableAlignmentEnabled?: boolean;
32
33
  shouldUseIncreasedScalingPercent?: boolean;
33
34
  };
34
- export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, lineLength, editorView, getPos, tableRef, isResizing, pluginInjectionApi, tableWrapperHeight, isWholeTableInDanger, isTableScalingEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
35
+ export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, lineLength, editorView, getPos, tableRef, isResizing, pluginInjectionApi, tableWrapperHeight, isWholeTableInDanger, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
35
36
  type TableContainerProps = {
36
37
  node: PMNode;
37
38
  className: string;
@@ -46,8 +47,9 @@ type TableContainerProps = {
46
47
  isWholeTableInDanger?: boolean;
47
48
  isTableResizingEnabled: boolean | undefined;
48
49
  isTableScalingEnabled?: boolean;
50
+ isTableWithFixedColumnWidthsOptionEnabled?: boolean;
49
51
  isTableAlignmentEnabled?: boolean;
50
52
  shouldUseIncreasedScalingPercent?: boolean;
51
53
  };
52
- export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
54
+ export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
53
55
  export {};
@@ -20,6 +20,7 @@ interface TableResizerProps {
20
20
  displayGapCursor: (toggle: boolean) => boolean;
21
21
  pluginInjectionApi?: PluginInjectionAPI;
22
22
  isTableScalingEnabled?: boolean;
23
+ isTableWithFixedColumnWidthsOptionEnabled?: boolean;
23
24
  isTableAlignmentEnabled?: boolean;
24
25
  isWholeTableInDanger?: boolean;
25
26
  isFullWidthModeEnabled?: boolean;
@@ -29,5 +30,5 @@ export interface TableResizerImprovementProps extends TableResizerProps {
29
30
  onResizeStop?: () => void;
30
31
  onResizeStart?: () => void;
31
32
  }
32
- export declare const TableResizer: ({ children, width, maxWidth, containerWidth, lineLength, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, isTableAlignmentEnabled, isWholeTableInDanger, shouldUseIncreasedScalingPercent, pluginInjectionApi, isFullWidthModeEnabled, }: PropsWithChildren<TableResizerImprovementProps>) => JSX.Element;
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, }: PropsWithChildren<TableResizerImprovementProps>) => JSX.Element;
33
34
  export {};
@@ -16,6 +16,7 @@ export default class TableView extends ReactNodeView<Props> {
16
16
  eventDispatcher?: EventDispatcher;
17
17
  getPos: getPosHandlerNode;
18
18
  options: import("./types").TableOptions | undefined;
19
+ getEditorFeatureFlags: GetEditorFeatureFlags;
19
20
  constructor(props: Props);
20
21
  getContentDOM(): {
21
22
  dom: HTMLElement;
@@ -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) => SafePlugin<import("./types").DragAndDropPluginState>;
4
+ export declare const createPlugin: (dispatch: Dispatch, editorAnalyticsAPI?: EditorAnalyticsAPI, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean) => SafePlugin<import("./types").DragAndDropPluginState>;
@@ -3,5 +3,5 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
3
  import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
4
  import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
5
5
  import type { PluginInjectionAPIWithA11y } from '../types';
6
- export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, dragAndDropEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthEnabled?: boolean, pluginInjectionApi?: PluginInjectionAPIWithA11y, getIntl?: () => IntlShape, shouldUseIncreasedScalingPercent?: boolean): SafePlugin;
6
+ export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, dragAndDropEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthEnabled?: boolean, pluginInjectionApi?: PluginInjectionAPIWithA11y, getIntl?: () => IntlShape, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean): SafePlugin;
7
7
  export default keymapPlugin;
@@ -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) => ResizeStateWithAnalytics | undefined;
30
+ }, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: 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) => void;
19
+ export declare const previewScaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabled?: boolean, isTableWithFixedColumnWidthsOptionEnabled?: boolean) => void;
20
20
  export declare const scaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabledOnCurrentTable?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (tr: Transaction) => Transaction;
@@ -8,17 +8,17 @@ 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, 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) => FloatingToolbarDropdown<Command>;
12
12
  export declare const getClosestSelectionRect: (state: EditorState) => Rect | undefined;
13
13
  export declare const getClosestSelectionOrTableRect: (state: EditorState) => Rect | undefined;
14
- export declare const getToolbarConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorFeatureFlags: GetEditorFeatureFlags, getEditorView: () => EditorView | null, options?: TablePluginOptions, isTableScalingWithFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (config: PluginConfig) => FloatingToolbarHandler;
15
- export declare const getDistributeConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean) => Command;
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;
16
16
  type AlignmentIcon = {
17
17
  id?: string;
18
18
  value: AlignmentOptions;
19
19
  icon: React.ComponentClass<any>;
20
20
  };
21
- export declare const getAlignmentOptionsConfig: (editorState: EditorState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorContainerWidth: GetEditorContainerWidth, getDomRef: (editorView: EditorView) => HTMLElement | undefined, editorView: EditorView | null) => Array<FloatingToolbarDropdown<Command>>;
21
+ export declare const getAlignmentOptionsConfig: (editorState: EditorState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorContainerWidth: GetEditorContainerWidth, getDomRef: (editorView: EditorView) => HTMLElement | undefined, editorView: EditorView | null, shouldUseIncreasedScalingPercent: boolean) => Array<FloatingToolbarDropdown<Command>>;
22
22
  export declare const getSelectedAlignmentIcon: (alignmentIcons: AlignmentIcon[], selectedNode: PMNode) => AlignmentIcon | undefined;
23
- export declare const isLayoutOptionDisabled: (selectedNode: PMNode, getEditorContainerWidth: GetEditorContainerWidth, getDomRef: (editorView: EditorView) => HTMLElement | undefined, editorView: EditorView | null) => boolean;
23
+ export declare const isLayoutOptionDisabled: (selectedNode: PMNode, getEditorContainerWidth: GetEditorContainerWidth, getDomRef: (editorView: EditorView) => HTMLElement | undefined, editorView: EditorView | null, shouldUseIncreasedScalingPercent: boolean) => boolean;
24
24
  export {};
@@ -21,4 +21,4 @@ export declare const updateColumnWidths: (resizeState: ResizeState, table: PMNod
21
21
  * @param view
22
22
  * @returns Updated transaction with rescaled columns for a given table
23
23
  */
24
- export declare const rescaleColumns: (isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (table: ContentNodeWithPos, view: EditorView | undefined) => (tr: Transaction) => Transaction;
24
+ export declare const rescaleColumns: (isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (table: ContentNodeWithPos, view: EditorView | undefined) => (tr: Transaction) => Transaction;
@@ -1,4 +1,4 @@
1
1
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
2
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  import type { Rect } from '@atlaskit/editor-tables/table-map';
4
- export declare const deleteColumns: (rect: Rect, allowCustomStep: boolean, view?: EditorView, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (tr: Transaction) => Transaction;
4
+ export declare const deleteColumns: (rect: Rect, allowCustomStep: boolean, view?: EditorView, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (tr: Transaction) => Transaction;
@@ -27,8 +27,9 @@ type DragMenuProps = {
27
27
  isTableScalingEnabled?: boolean;
28
28
  tableDuplicateCellColouring?: boolean;
29
29
  shouldUseIncreasedScalingPercent?: boolean;
30
+ isTableFixedColumnWidthsOptionEnabled?: boolean;
30
31
  };
31
- export declare const DragMenu: React.MemoExoticComponent<({ direction, index, target, isOpen, editorView, tableNode, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, fitHeight, fitWidth, mountPoint, scrollableElement, boundariesElement, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
32
+ export declare const DragMenu: React.MemoExoticComponent<({ direction, index, target, isOpen, editorView, tableNode, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, fitHeight, fitWidth, mountPoint, scrollableElement, boundariesElement, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent, isTableFixedColumnWidthsOptionEnabled, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
32
33
  declare const _default: React.FC<import("react-intl-next").WithIntlProps<DragMenuProps & WrappedComponentProps>> & {
33
34
  WrappedComponent: React.ComponentType<DragMenuProps & WrappedComponentProps>;
34
35
  };
@@ -14,6 +14,7 @@ export interface Props {
14
14
  isHeaderColumnEnabled?: boolean;
15
15
  isHeaderRowEnabled?: boolean;
16
16
  isDragAndDropEnabled?: boolean;
17
+ isTableScalingEnabled?: boolean;
17
18
  mountPoint?: HTMLElement;
18
19
  boundariesElement?: HTMLElement;
19
20
  scrollableElement?: HTMLElement;
@@ -13,4 +13,4 @@ export interface DragMenuConfig extends DropdownOptionT<Command> {
13
13
  icon?: React.ComponentType<React.PropsWithChildren<IconProps>>;
14
14
  keymap?: string;
15
15
  }
16
- export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, canDrag: boolean, hasMergedCellsInTable: boolean, editorView: EditorView, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean, tableDuplicateCellColouring?: boolean, shouldUseIncreasedScalingPercent?: boolean) => DragMenuConfig[];
16
+ export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, canDrag: boolean, hasMergedCellsInTable: boolean, editorView: EditorView, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean, tableDuplicateCellColouring?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => DragMenuConfig[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "7.16.18",
3
+ "version": "7.16.19",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -31,7 +31,7 @@
31
31
  "@atlaskit/adf-schema": "^36.10.7",
32
32
  "@atlaskit/button": "^17.17.0",
33
33
  "@atlaskit/custom-steps": "^0.2.0",
34
- "@atlaskit/editor-common": "^82.1.0",
34
+ "@atlaskit/editor-common": "^82.2.0",
35
35
  "@atlaskit/editor-palette": "1.6.0",
36
36
  "@atlaskit/editor-plugin-accessibility-utils": "^1.1.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^1.2.0",
@@ -123,9 +123,6 @@
123
123
  "platform.editor.table.cmd-a-select-table": {
124
124
  "type": "boolean"
125
125
  },
126
- "platform.editor.table.preserve-widths-with-lock-button": {
127
- "type": "boolean"
128
- },
129
126
  "platform.editor.table.use-shared-state-hook": {
130
127
  "type": "boolean"
131
128
  },
@@ -257,12 +257,14 @@ export const changeColumnWidthByStep =
257
257
  stepSize,
258
258
  getEditorContainerWidth,
259
259
  isTableScalingEnabled,
260
+ isTableFixedColumnWidthsOptionEnabled,
260
261
  ariaNotify,
261
262
  getIntl,
262
263
  }: {
263
264
  stepSize: number;
264
265
  getEditorContainerWidth: GetEditorContainerWidth;
265
266
  isTableScalingEnabled: boolean;
267
+ isTableFixedColumnWidthsOptionEnabled: boolean;
266
268
  ariaNotify?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void;
267
269
  getIntl?: () => IntlShape;
268
270
  originalTr?: Transaction;
@@ -326,15 +328,13 @@ export const changeColumnWidthByStep =
326
328
  });
327
329
 
328
330
  let isTableScalingEnabledOnCurrentTable = isTableScalingEnabled;
329
- const isTableScalingEnabledWithLockButton =
330
- isTableScalingEnabled &&
331
- getBooleanFF('platform.editor.table.preserve-widths-with-lock-button');
332
- if (isTableScalingEnabledWithLockButton) {
331
+ const isTableScalingWithFixedColumnWidthsOptionEnabled =
332
+ isTableScalingEnabled && isTableFixedColumnWidthsOptionEnabled;
333
+ if (isTableScalingWithFixedColumnWidthsOptionEnabled) {
333
334
  isTableScalingEnabledOnCurrentTable = originalTable.attrs.displayMode !== 'fixed';
334
335
  }
335
-
336
336
  const shouldUseIncreasedScalingPercent =
337
- isTableScalingEnabledWithLockButton &&
337
+ isTableScalingWithFixedColumnWidthsOptionEnabled &&
338
338
  getBooleanFF('platform.editor.table.use-increased-scaling-percent');
339
339
 
340
340
  const initialResizeState = getResizeState({
@@ -5,13 +5,19 @@ import { deleteColumns } from '../transforms/delete-columns';
5
5
  import { getAllowAddColumnCustomStep } from '../utils/get-allow-add-column-custom-step';
6
6
 
7
7
  export const deleteColumnsCommand =
8
- (rect: Rect, isTableScalingEnabled = false, shouldUseIncreasedScalingPercent = false): Command =>
8
+ (
9
+ rect: Rect,
10
+ isTableScalingEnabled = false,
11
+ isTableFixedColumnWidthsOptionEnabled = false,
12
+ shouldUseIncreasedScalingPercent = false,
13
+ ): Command =>
9
14
  (state, dispatch, view) => {
10
15
  const tr = deleteColumns(
11
16
  rect,
12
17
  getAllowAddColumnCustomStep(state),
13
18
  view,
14
19
  isTableScalingEnabled,
20
+ isTableFixedColumnWidthsOptionEnabled,
15
21
  shouldUseIncreasedScalingPercent,
16
22
  )(state.tr);
17
23
  if (dispatch) {
@@ -41,6 +41,7 @@ function addColumnAtCustomStep(column: number) {
41
41
  export function addColumnAt(
42
42
  isTableScalingEnabled = false,
43
43
  isCellBackgroundDuplicated?: boolean,
44
+ isTableFixedColumnWidthsOptionEnabled?: boolean,
44
45
  shouldUseIncreasedScalingPercent?: boolean,
45
46
  ) {
46
47
  return (
@@ -58,7 +59,11 @@ export function addColumnAt(
58
59
  const table = findTable(updatedTr.selection);
59
60
  if (table) {
60
61
  // [ED-8288] Update colwidths manually to avoid multiple dispatch in TableComponent
61
- updatedTr = rescaleColumns(isTableScalingEnabled, shouldUseIncreasedScalingPercent)(
62
+ updatedTr = rescaleColumns(
63
+ isTableScalingEnabled,
64
+ isTableFixedColumnWidthsOptionEnabled,
65
+ shouldUseIncreasedScalingPercent,
66
+ )(
62
67
  table,
63
68
  view,
64
69
  )(updatedTr);
@@ -83,7 +88,12 @@ export function addColumnAt(
83
88
  // :: (EditorState, dispatch: ?(tr: Transaction)) → bool
84
89
  // Command to add a column before the column with the selection.
85
90
  export const addColumnBefore =
86
- (isTableScalingEnabled = false, shouldUseIncreasedScalingPercent = false): Command =>
91
+ (
92
+ isTableScalingEnabled = false,
93
+ isCellBackgroundDuplicated = false,
94
+ isTableFixedColumnWidthsOptionEnabled = false,
95
+ shouldUseIncreasedScalingPercent = false,
96
+ ): Command =>
87
97
  (state, dispatch, view) => {
88
98
  const table = findTable(state.selection);
89
99
  if (!table) {
@@ -92,7 +102,12 @@ export const addColumnBefore =
92
102
  if (dispatch) {
93
103
  let rect = selectedRect(state);
94
104
  dispatch(
95
- addColumnAt(isTableScalingEnabled, shouldUseIncreasedScalingPercent)(
105
+ addColumnAt(
106
+ isTableScalingEnabled,
107
+ isCellBackgroundDuplicated,
108
+ isTableFixedColumnWidthsOptionEnabled,
109
+ shouldUseIncreasedScalingPercent,
110
+ )(
96
111
  rect.left,
97
112
  getAllowAddColumnCustomStep(state),
98
113
  view,
@@ -105,16 +120,27 @@ export const addColumnBefore =
105
120
  // :: (EditorState, dispatch: ?(tr: Transaction)) → bool
106
121
  // Command to add a column after the column with the selection.
107
122
  export const addColumnAfter =
108
- (isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean): Command =>
123
+ (
124
+ isTableScalingEnabled?: boolean,
125
+ isCellBackgroundDuplicated?: boolean,
126
+ isTableFixedColumnWidthsOptionEnabled?: boolean,
127
+ shouldUseIncreasedScalingPercent?: boolean,
128
+ ): Command =>
109
129
  (state, dispatch, view) => {
110
130
  const table = findTable(state.selection);
111
131
  if (!table) {
112
132
  return false;
113
133
  }
134
+
114
135
  if (dispatch) {
115
136
  let rect = selectedRect(state);
116
137
  dispatch(
117
- addColumnAt(isTableScalingEnabled, shouldUseIncreasedScalingPercent)(
138
+ addColumnAt(
139
+ isTableScalingEnabled,
140
+ isCellBackgroundDuplicated,
141
+ isTableFixedColumnWidthsOptionEnabled,
142
+ shouldUseIncreasedScalingPercent,
143
+ )(
118
144
  rect.right,
119
145
  getAllowAddColumnCustomStep(state),
120
146
  view,
@@ -128,6 +154,7 @@ export const insertColumn =
128
154
  (
129
155
  isTableScalingEnabled = false,
130
156
  isCellBackgroundDuplicated?: boolean,
157
+ isTableFixedColumnWidthsOptionEnabled?: boolean,
131
158
  shouldUseIncreasedScalingPercent?: boolean,
132
159
  ) =>
133
160
  (column: number): Command =>
@@ -135,6 +162,7 @@ export const insertColumn =
135
162
  let tr = addColumnAt(
136
163
  isTableScalingEnabled,
137
164
  isCellBackgroundDuplicated,
165
+ isTableFixedColumnWidthsOptionEnabled,
138
166
  shouldUseIncreasedScalingPercent,
139
167
  )(
140
168
  column,
@@ -240,6 +240,7 @@ export const changeColumnWidthByStepWithAnalytics =
240
240
  stepSize: number,
241
241
  getEditorContainerWidth: GetEditorContainerWidth,
242
242
  isTableScalingEnabled: boolean,
243
+ isTableFixedColumnWidthsOptionEnabled: boolean,
243
244
  inputMethod: INPUT_METHOD.SHORTCUT,
244
245
  ariaNotify?: (message: string) => void,
245
246
  getIntl?: () => IntlShape,
@@ -268,7 +269,8 @@ export const changeColumnWidthByStepWithAnalytics =
268
269
  changeColumnWidthByStep({
269
270
  stepSize: stepSize,
270
271
  getEditorContainerWidth: getEditorContainerWidth,
271
- isTableScalingEnabled: isTableScalingEnabled,
272
+ isTableScalingEnabled,
273
+ isTableFixedColumnWidthsOptionEnabled,
272
274
  ariaNotify: ariaNotify,
273
275
  getIntl: getIntl,
274
276
  }),
@@ -279,6 +281,7 @@ export const insertColumnWithAnalytics =
279
281
  editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null,
280
282
  isTableScalingEnabled = false,
281
283
  isCellbackgroundDuplicated = false,
284
+ isTableFixedColumnWidthsOptionEnabled = false,
282
285
  shouldUseIncreasedScalingPercent = false,
283
286
  ) =>
284
287
  (
@@ -308,6 +311,7 @@ export const insertColumnWithAnalytics =
308
311
  insertColumn(
309
312
  isTableScalingEnabled,
310
313
  isCellbackgroundDuplicated,
314
+ isTableFixedColumnWidthsOptionEnabled,
311
315
  shouldUseIncreasedScalingPercent,
312
316
  )(position),
313
317
  );
@@ -351,6 +355,7 @@ export const deleteColumnsWithAnalytics =
351
355
  (
352
356
  editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null,
353
357
  isTableScalingEnabled = false,
358
+ isTableFixedColumnWidthsOptionEnabled = false,
354
359
  shouldUseIncreasedScalingPercent = false,
355
360
  ) =>
356
361
  (
@@ -379,13 +384,19 @@ export const deleteColumnsWithAnalytics =
379
384
  eventType: EVENT_TYPE.TRACK,
380
385
  };
381
386
  })(editorAnalyticsAPI)(
382
- deleteColumnsCommand(rect, isTableScalingEnabled, shouldUseIncreasedScalingPercent),
387
+ deleteColumnsCommand(
388
+ rect,
389
+ isTableScalingEnabled,
390
+ isTableFixedColumnWidthsOptionEnabled,
391
+ shouldUseIncreasedScalingPercent,
392
+ ),
383
393
  );
384
394
 
385
395
  export const deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut =
386
396
  (
387
397
  editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null,
388
398
  isTableScalingEnabled?: boolean,
399
+ isTableFixedColumnWidthsOptionEnabled?: boolean,
389
400
  shouldUseIncreasedScalingPercent?: boolean,
390
401
  ): Command =>
391
402
  (state, dispatch) => {
@@ -414,6 +425,7 @@ export const deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut =
414
425
  return deleteColumnsWithAnalytics(
415
426
  editorAnalyticsAPI,
416
427
  isTableScalingEnabled,
428
+ isTableFixedColumnWidthsOptionEnabled,
417
429
  shouldUseIncreasedScalingPercent,
418
430
  )(INPUT_METHOD.SHORTCUT, rect)(state, dispatch);
419
431
  } else {
@@ -477,6 +477,7 @@ export const handleCut = (
477
477
  editorAnalyticsAPI?: EditorAnalyticsAPI,
478
478
  editorView?: EditorView,
479
479
  isTableScalingEnabled = false,
480
+ isTableFixedColumnWidthsOptionEnabled = false,
480
481
  shouldUseIncreasedScalingPercent = false,
481
482
  ): Transaction => {
482
483
  const oldSelection = oldState.tr.selection;
@@ -525,6 +526,7 @@ export const handleCut = (
525
526
  getAllowAddColumnCustomStep(oldState),
526
527
  editorView,
527
528
  isTableScalingEnabled,
529
+ isTableFixedColumnWidthsOptionEnabled,
528
530
  shouldUseIncreasedScalingPercent,
529
531
  )(tr);
530
532
  }