@atlaskit/editor-plugin-table 7.5.4 → 7.5.6
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.
- package/CHANGELOG.md +13 -0
- package/dist/cjs/commands/column-resize.js +3 -3
- package/dist/cjs/commands/delete.js +2 -2
- package/dist/cjs/commands/insert.js +15 -15
- package/dist/cjs/commands-with-analytics.js +7 -7
- package/dist/cjs/event-handlers.js +27 -11
- package/dist/cjs/nodeviews/OverflowShadowsObserver.js +24 -15
- package/dist/cjs/nodeviews/TableCell.js +5 -30
- package/dist/cjs/nodeviews/TableComponent.js +120 -83
- package/dist/cjs/nodeviews/TableContainer.js +23 -21
- package/dist/cjs/nodeviews/TableResizer.js +13 -13
- package/dist/cjs/nodeviews/table.js +9 -9
- package/dist/cjs/plugin.js +60 -59
- package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +13 -13
- package/dist/cjs/pm-plugins/keymap.js +6 -8
- package/dist/cjs/pm-plugins/main.js +7 -24
- package/dist/cjs/pm-plugins/sticky-headers/plugin.js +2 -3
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +12 -12
- package/dist/cjs/pm-plugins/table-resizing/utils/colgroup.js +2 -2
- package/dist/cjs/pm-plugins/table-resizing/utils/consts.js +4 -2
- package/dist/cjs/pm-plugins/table-resizing/utils/index.js +2 -2
- package/dist/cjs/pm-plugins/table-resizing/utils/misc.js +3 -3
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-column.js +3 -3
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-state.js +11 -12
- package/dist/cjs/pm-plugins/table-resizing/utils/scale-table.js +13 -13
- package/dist/cjs/pm-plugins/table-width.js +6 -2
- package/dist/cjs/toolbar.js +21 -21
- package/dist/cjs/transforms/column-width.js +4 -4
- package/dist/cjs/transforms/delete-columns.js +2 -2
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +53 -55
- package/dist/cjs/ui/FloatingContextualMenu/index.js +2 -4
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +2 -2
- package/dist/cjs/ui/FloatingDragMenu/index.js +6 -6
- package/dist/cjs/ui/FloatingInsertButton/index.js +6 -7
- package/dist/cjs/ui/TableFloatingColumnControls/index.js +8 -48
- package/dist/cjs/ui/TableFloatingControls/index.js +113 -223
- package/dist/cjs/utils/column-controls.js +5 -5
- package/dist/cjs/utils/create.js +2 -5
- package/dist/cjs/utils/dom.js +13 -15
- package/dist/cjs/utils/drag-menu.js +4 -4
- package/dist/es2019/commands/column-resize.js +3 -3
- package/dist/es2019/commands/delete.js +2 -2
- package/dist/es2019/commands/insert.js +12 -12
- package/dist/es2019/commands-with-analytics.js +6 -6
- package/dist/es2019/event-handlers.js +27 -11
- package/dist/es2019/nodeviews/OverflowShadowsObserver.js +24 -15
- package/dist/es2019/nodeviews/TableCell.js +1 -24
- package/dist/es2019/nodeviews/TableComponent.js +88 -63
- package/dist/es2019/nodeviews/TableContainer.js +20 -22
- package/dist/es2019/nodeviews/TableResizer.js +13 -13
- package/dist/es2019/nodeviews/table.js +9 -9
- package/dist/es2019/plugin.js +19 -20
- package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +6 -6
- package/dist/es2019/pm-plugins/keymap.js +5 -8
- package/dist/es2019/pm-plugins/main.js +6 -23
- package/dist/es2019/pm-plugins/sticky-headers/plugin.js +1 -1
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +5 -5
- package/dist/es2019/pm-plugins/table-resizing/utils/colgroup.js +2 -2
- package/dist/es2019/pm-plugins/table-resizing/utils/consts.js +3 -1
- package/dist/es2019/pm-plugins/table-resizing/utils/index.js +1 -1
- package/dist/es2019/pm-plugins/table-resizing/utils/misc.js +2 -2
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-column.js +3 -2
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-state.js +12 -13
- package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +13 -13
- package/dist/es2019/pm-plugins/table-width.js +6 -2
- package/dist/es2019/toolbar.js +15 -15
- package/dist/es2019/transforms/column-width.js +5 -5
- package/dist/es2019/transforms/delete-columns.js +2 -2
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +9 -12
- package/dist/es2019/ui/FloatingContextualMenu/index.js +2 -4
- package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +2 -2
- package/dist/es2019/ui/FloatingDragMenu/index.js +5 -5
- package/dist/es2019/ui/FloatingInsertButton/index.js +5 -6
- package/dist/es2019/ui/TableFloatingColumnControls/index.js +5 -27
- package/dist/es2019/ui/TableFloatingControls/index.js +119 -193
- package/dist/es2019/utils/column-controls.js +6 -6
- package/dist/es2019/utils/create.js +2 -5
- package/dist/es2019/utils/dom.js +13 -15
- package/dist/es2019/utils/drag-menu.js +4 -4
- package/dist/esm/commands/column-resize.js +3 -3
- package/dist/esm/commands/delete.js +2 -2
- package/dist/esm/commands/insert.js +15 -15
- package/dist/esm/commands-with-analytics.js +7 -7
- package/dist/esm/event-handlers.js +27 -11
- package/dist/esm/nodeviews/OverflowShadowsObserver.js +24 -15
- package/dist/esm/nodeviews/TableCell.js +5 -30
- package/dist/esm/nodeviews/TableComponent.js +119 -82
- package/dist/esm/nodeviews/TableContainer.js +24 -22
- package/dist/esm/nodeviews/TableResizer.js +13 -13
- package/dist/esm/nodeviews/table.js +9 -9
- package/dist/esm/plugin.js +60 -59
- package/dist/esm/pm-plugins/drag-and-drop/plugin.js +13 -13
- package/dist/esm/pm-plugins/keymap.js +6 -8
- package/dist/esm/pm-plugins/main.js +7 -24
- package/dist/esm/pm-plugins/sticky-headers/plugin.js +2 -3
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +12 -12
- package/dist/esm/pm-plugins/table-resizing/utils/colgroup.js +2 -2
- package/dist/esm/pm-plugins/table-resizing/utils/consts.js +3 -1
- package/dist/esm/pm-plugins/table-resizing/utils/index.js +1 -1
- package/dist/esm/pm-plugins/table-resizing/utils/misc.js +2 -2
- package/dist/esm/pm-plugins/table-resizing/utils/resize-column.js +4 -3
- package/dist/esm/pm-plugins/table-resizing/utils/resize-state.js +13 -14
- package/dist/esm/pm-plugins/table-resizing/utils/scale-table.js +13 -13
- package/dist/esm/pm-plugins/table-width.js +6 -2
- package/dist/esm/toolbar.js +21 -21
- package/dist/esm/transforms/column-width.js +5 -5
- package/dist/esm/transforms/delete-columns.js +2 -2
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +53 -55
- package/dist/esm/ui/FloatingContextualMenu/index.js +2 -4
- package/dist/esm/ui/FloatingDragMenu/DragMenu.js +2 -2
- package/dist/esm/ui/FloatingDragMenu/index.js +6 -6
- package/dist/esm/ui/FloatingInsertButton/index.js +6 -7
- package/dist/esm/ui/TableFloatingColumnControls/index.js +8 -48
- package/dist/esm/ui/TableFloatingControls/index.js +113 -224
- package/dist/esm/utils/column-controls.js +6 -6
- package/dist/esm/utils/create.js +2 -5
- package/dist/esm/utils/dom.js +13 -15
- package/dist/esm/utils/drag-menu.js +4 -4
- package/dist/types/commands/column-resize.d.ts +1 -1
- package/dist/types/commands/delete.d.ts +1 -1
- package/dist/types/commands/insert.d.ts +7 -7
- package/dist/types/commands-with-analytics.d.ts +3 -3
- package/dist/types/event-handlers.d.ts +4 -5
- package/dist/types/nodeviews/OverflowShadowsObserver.d.ts +3 -1
- package/dist/types/nodeviews/TableCell.d.ts +1 -5
- package/dist/types/nodeviews/TableComponent.d.ts +6 -3
- package/dist/types/nodeviews/TableContainer.d.ts +6 -4
- package/dist/types/nodeviews/TableResizer.d.ts +2 -2
- package/dist/types/nodeviews/table.d.ts +1 -1
- package/dist/types/nodeviews/types.d.ts +1 -0
- package/dist/types/plugin.d.ts +1 -0
- package/dist/types/pm-plugins/drag-and-drop/plugin.d.ts +1 -2
- package/dist/types/pm-plugins/keymap.d.ts +2 -2
- package/dist/types/pm-plugins/main.d.ts +1 -1
- package/dist/types/pm-plugins/sticky-headers/plugin.d.ts +2 -3
- package/dist/types/pm-plugins/table-resizing/utils/colgroup.d.ts +1 -1
- package/dist/types/pm-plugins/table-resizing/utils/consts.d.ts +1 -0
- package/dist/types/pm-plugins/table-resizing/utils/index.d.ts +1 -1
- package/dist/types/pm-plugins/table-resizing/utils/misc.d.ts +1 -1
- package/dist/types/pm-plugins/table-resizing/utils/resize-column.d.ts +2 -1
- package/dist/types/pm-plugins/table-resizing/utils/resize-state.d.ts +4 -4
- package/dist/types/pm-plugins/table-resizing/utils/scale-table.d.ts +4 -4
- package/dist/types/pm-plugins/table-width.d.ts +1 -2
- package/dist/types/toolbar.d.ts +2 -2
- package/dist/types/transforms/column-width.d.ts +1 -1
- package/dist/types/transforms/delete-columns.d.ts +1 -1
- package/dist/types/types.d.ts +1 -3
- package/dist/types/ui/FloatingContextualMenu/index.d.ts +1 -1
- package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +2 -2
- package/dist/types/ui/FloatingDragMenu/index.d.ts +2 -3
- package/dist/types/ui/FloatingInsertButton/index.d.ts +1 -2
- package/dist/types/ui/TableFloatingColumnControls/index.d.ts +2 -1
- package/dist/types/ui/TableFloatingControls/index.d.ts +5 -22
- package/dist/types/utils/create.d.ts +1 -2
- package/dist/types/utils/dom.d.ts +10 -2
- package/dist/types/utils/drag-menu.d.ts +1 -1
- package/dist/types-ts4.5/commands/column-resize.d.ts +1 -1
- package/dist/types-ts4.5/commands/delete.d.ts +1 -1
- package/dist/types-ts4.5/commands/insert.d.ts +7 -7
- package/dist/types-ts4.5/commands-with-analytics.d.ts +3 -3
- package/dist/types-ts4.5/event-handlers.d.ts +4 -5
- package/dist/types-ts4.5/nodeviews/OverflowShadowsObserver.d.ts +3 -1
- package/dist/types-ts4.5/nodeviews/TableCell.d.ts +1 -5
- package/dist/types-ts4.5/nodeviews/TableComponent.d.ts +6 -3
- package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +6 -4
- package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +2 -2
- package/dist/types-ts4.5/nodeviews/table.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/types.d.ts +1 -0
- package/dist/types-ts4.5/plugin.d.ts +1 -0
- package/dist/types-ts4.5/pm-plugins/drag-and-drop/plugin.d.ts +1 -2
- package/dist/types-ts4.5/pm-plugins/keymap.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/sticky-headers/plugin.d.ts +2 -3
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/colgroup.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/consts.d.ts +1 -0
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/index.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/misc.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/resize-column.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/resize-state.d.ts +4 -4
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/scale-table.d.ts +4 -4
- package/dist/types-ts4.5/pm-plugins/table-width.d.ts +1 -2
- package/dist/types-ts4.5/toolbar.d.ts +2 -2
- package/dist/types-ts4.5/transforms/column-width.d.ts +1 -1
- package/dist/types-ts4.5/transforms/delete-columns.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +1 -3
- package/dist/types-ts4.5/ui/FloatingContextualMenu/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +2 -2
- package/dist/types-ts4.5/ui/FloatingDragMenu/index.d.ts +2 -3
- package/dist/types-ts4.5/ui/FloatingInsertButton/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/index.d.ts +2 -1
- package/dist/types-ts4.5/ui/TableFloatingControls/index.d.ts +5 -22
- package/dist/types-ts4.5/utils/create.d.ts +1 -2
- package/dist/types-ts4.5/utils/dom.d.ts +10 -2
- package/dist/types-ts4.5/utils/drag-menu.d.ts +1 -1
- package/package.json +3 -4
- package/src/commands/column-resize.ts +4 -3
- package/src/commands/delete.ts +2 -2
- package/src/commands/insert.ts +15 -27
- package/src/commands-with-analytics.ts +6 -9
- package/src/event-handlers.ts +107 -105
- package/src/nodeviews/OverflowShadowsObserver.ts +32 -21
- package/src/nodeviews/TableCell.ts +0 -26
- package/src/nodeviews/TableComponent.tsx +107 -78
- package/src/nodeviews/TableContainer.tsx +26 -32
- package/src/nodeviews/TableResizer.tsx +15 -18
- package/src/nodeviews/table.tsx +6 -5
- package/src/nodeviews/types.ts +1 -0
- package/src/plugin.tsx +17 -32
- package/src/pm-plugins/drag-and-drop/plugin.ts +10 -15
- package/src/pm-plugins/keymap.ts +6 -13
- package/src/pm-plugins/main.ts +6 -25
- package/src/pm-plugins/sticky-headers/plugin.ts +2 -11
- package/src/pm-plugins/table-resizing/event-handlers.ts +6 -4
- package/src/pm-plugins/table-resizing/utils/colgroup.ts +2 -2
- package/src/pm-plugins/table-resizing/utils/consts.ts +2 -0
- package/src/pm-plugins/table-resizing/utils/index.ts +1 -1
- package/src/pm-plugins/table-resizing/utils/misc.ts +2 -2
- package/src/pm-plugins/table-resizing/utils/resize-column.ts +5 -2
- package/src/pm-plugins/table-resizing/utils/resize-state.ts +18 -13
- package/src/pm-plugins/table-resizing/utils/scale-table.ts +14 -14
- package/src/pm-plugins/table-width.ts +4 -6
- package/src/toolbar.tsx +16 -19
- package/src/transforms/column-width.ts +7 -6
- package/src/transforms/delete-columns.ts +2 -2
- package/src/types.ts +1 -4
- package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +11 -16
- package/src/ui/FloatingContextualMenu/index.tsx +0 -2
- package/src/ui/FloatingDragMenu/DragMenu.tsx +3 -3
- package/src/ui/FloatingDragMenu/index.tsx +4 -8
- package/src/ui/FloatingInsertButton/index.tsx +11 -22
- package/src/ui/TableFloatingColumnControls/index.tsx +5 -29
- package/src/ui/TableFloatingControls/index.tsx +155 -241
- package/src/utils/column-controls.ts +5 -6
- package/src/utils/create.ts +2 -5
- package/src/utils/dom.ts +12 -19
- package/src/utils/drag-menu.ts +7 -12
|
@@ -3,5 +3,5 @@ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
|
3
3
|
import type { Direction } from '@atlaskit/editor-tables/types';
|
|
4
4
|
export declare const initiateKeyboardColumnResizing: Command;
|
|
5
5
|
export declare const activateNextResizeArea: (direction: Direction) => Command;
|
|
6
|
-
export declare const changeColumnWidthByStep: (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth,
|
|
6
|
+
export declare const changeColumnWidthByStep: (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled?: boolean) => Command;
|
|
7
7
|
export declare const stopKeyboardColumnResizing: (originalTr?: Transaction) => Command;
|
|
@@ -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,
|
|
3
|
+
export declare const deleteColumnsCommand: (rect: Rect, isTableScalingEnabled?: boolean) => Command;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { Command, EditorCommand
|
|
2
|
+
import type { Command, EditorCommand } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
export declare function addColumnAt(
|
|
6
|
-
export declare const addColumnBefore: (
|
|
7
|
-
export declare const addColumnAfter: (
|
|
8
|
-
export declare const insertColumn: (
|
|
5
|
+
export declare function addColumnAt(isTableScalingEnabled?: boolean): (column: number, allowAddColumnCustomStep: boolean | undefined, view: EditorView | undefined) => (tr: Transaction) => Transaction;
|
|
6
|
+
export declare const addColumnBefore: (isTableScalingEnabled?: boolean) => Command;
|
|
7
|
+
export declare const addColumnAfter: (isTableScalingEnabled?: boolean) => Command;
|
|
8
|
+
export declare const insertColumn: (isTableScalingEnabled?: boolean) => (column: number) => Command;
|
|
9
9
|
export declare const insertRow: (row: number, moveCursorToTheNewRow: boolean) => Command;
|
|
10
|
-
export declare const createTable: (
|
|
11
|
-
export declare const insertTableWithSize: (isFullWidthModeEnabled?: boolean,
|
|
10
|
+
export declare const createTable: (isTableScalingEnabled?: boolean, isFullWidthModeEnabled?: boolean) => Command;
|
|
11
|
+
export declare const insertTableWithSize: (isFullWidthModeEnabled?: boolean, isTableScalingEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI) => (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
|
|
@@ -11,10 +11,10 @@ export declare const splitCellWithAnalytics: (editorAnalyticsAPI: EditorAnalytic
|
|
|
11
11
|
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) => Command;
|
|
12
12
|
export declare const addRowAroundSelection: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (side: RowInsertPosition) => Command;
|
|
13
13
|
export declare const insertRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: InsertRowMethods, options: InsertRowOptions) => Command;
|
|
14
|
-
export declare const changeColumnWidthByStepWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth,
|
|
15
|
-
export declare const insertColumnWithAnalytics: (
|
|
14
|
+
export declare const changeColumnWidthByStepWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled: boolean, inputMethod: INPUT_METHOD.SHORTCUT) => Command;
|
|
15
|
+
export declare const insertColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, position: number) => Command;
|
|
16
16
|
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;
|
|
17
|
-
export declare const deleteColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null,
|
|
17
|
+
export declare const deleteColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TABLE_CONTEXT_MENU, rect: Rect) => Command;
|
|
18
18
|
export declare const deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
19
19
|
export declare const deleteTableWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
20
20
|
export declare const deleteTableIfSelectedWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.FLOATING_TB | INPUT_METHOD.KEYBOARD) => Command;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import type { ElementContentRects } from './types';
|
|
5
4
|
export declare const handleBlur: (view: EditorView, event: Event) => boolean;
|
|
6
5
|
export declare const handleFocus: (view: EditorView, event: Event) => boolean;
|
|
7
6
|
export declare const handleClick: (view: EditorView, event: Event) => boolean;
|
|
@@ -11,9 +10,9 @@ export declare const handleMouseDown: (_: EditorView, event: Event) => boolean;
|
|
|
11
10
|
export declare const handleMouseOut: (view: EditorView, mouseEvent: Event) => boolean;
|
|
12
11
|
export declare const handleMouseEnter: (view: EditorView, mouseEvent: Event) => boolean;
|
|
13
12
|
export declare const handleMouseLeave: (view: EditorView, event: Event) => boolean;
|
|
14
|
-
export declare const handleMouseMove: (view: EditorView, event: Event
|
|
13
|
+
export declare const handleMouseMove: (view: EditorView, event: Event) => boolean;
|
|
15
14
|
export declare function handleTripleClick(view: EditorView, pos: number): boolean;
|
|
16
|
-
export declare const handleCut: (oldTr: Transaction, oldState: EditorState, newState: EditorState, editorAnalyticsAPI?: EditorAnalyticsAPI, editorView?: EditorView,
|
|
15
|
+
export declare const handleCut: (oldTr: Transaction, oldState: EditorState, newState: EditorState, editorAnalyticsAPI?: EditorAnalyticsAPI, editorView?: EditorView, isTableScalingEnabled?: boolean) => Transaction;
|
|
17
16
|
export declare const isTableInFocus: (view: EditorView) => boolean;
|
|
18
|
-
export declare const whenTableInFocus: (eventHandler: (view: EditorView, mouseEvent: Event
|
|
19
|
-
export declare const withCellTracking: (eventHandler: (view: EditorView, mouseEvent: Event
|
|
17
|
+
export declare const whenTableInFocus: (eventHandler: (view: EditorView, mouseEvent: Event) => boolean) => (view: EditorView, mouseEvent: Event) => boolean;
|
|
18
|
+
export declare const withCellTracking: (eventHandler: (view: EditorView, mouseEvent: Event) => boolean) => (view: EditorView, mouseEvent: Event) => boolean;
|
|
@@ -19,6 +19,8 @@ export declare class OverflowShadowsObserver {
|
|
|
19
19
|
* e.g. bounds on an IntersectionObserverEntry, otherwise proceed with
|
|
20
20
|
* reading it from sticky cell
|
|
21
21
|
*/
|
|
22
|
-
updateStickyShadows: (stickyRowHeight?: number) => void
|
|
22
|
+
updateStickyShadows: ((stickyRowHeight?: number) => void) & {
|
|
23
|
+
cancel(): void;
|
|
24
|
+
};
|
|
23
25
|
dispose(): void;
|
|
24
26
|
}
|
|
@@ -3,11 +3,7 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
3
3
|
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import TableNodeView from './TableNodeViewBase';
|
|
5
5
|
export default class TableCell extends TableNodeView<HTMLElement> implements NodeView {
|
|
6
|
-
|
|
7
|
-
constructor(node: PMNode, view: EditorView, getPos: () => number | undefined, eventDispatcher: EventDispatcher, observer?: ResizeObserver | undefined);
|
|
8
|
-
private isStickyHeaderEnabled;
|
|
9
|
-
private isDragAndDropEnabled;
|
|
6
|
+
constructor(node: PMNode, view: EditorView, getPos: () => number | undefined, eventDispatcher: EventDispatcher);
|
|
10
7
|
update(node: PMNode): boolean;
|
|
11
|
-
destroy(): void;
|
|
12
8
|
private updateNodeView;
|
|
13
9
|
}
|
|
@@ -23,13 +23,13 @@ export interface ComponentProps {
|
|
|
23
23
|
isHeaderColumnEnabled: boolean;
|
|
24
24
|
isMediaFullscreen?: boolean;
|
|
25
25
|
isDragAndDropEnabled?: boolean;
|
|
26
|
+
isTableScalingEnabled?: boolean;
|
|
26
27
|
tableActive: boolean;
|
|
27
28
|
ordering: TableColumnOrdering;
|
|
28
29
|
isResizing?: boolean;
|
|
29
30
|
getEditorFeatureFlags: GetEditorFeatureFlags;
|
|
30
31
|
dispatchAnalyticsEvent: DispatchAnalyticsEvent;
|
|
31
32
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
32
|
-
tableRef?: HTMLElement | undefined;
|
|
33
33
|
}
|
|
34
34
|
interface TableState {
|
|
35
35
|
scroll: number;
|
|
@@ -37,6 +37,8 @@ interface TableState {
|
|
|
37
37
|
stickyHeader?: RowStickyState;
|
|
38
38
|
[ShadowEvent.SHOW_BEFORE_SHADOW]: boolean;
|
|
39
39
|
[ShadowEvent.SHOW_AFTER_SHADOW]: boolean;
|
|
40
|
+
tableWrapperWidth?: number;
|
|
41
|
+
tableWrapperHeight?: number;
|
|
40
42
|
}
|
|
41
43
|
declare class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
42
44
|
static displayName: string;
|
|
@@ -50,15 +52,16 @@ declare class TableComponent extends React.Component<ComponentProps, TableState>
|
|
|
50
52
|
private stickyScrollbar?;
|
|
51
53
|
private isInitialOverflowSent;
|
|
52
54
|
private initialOverflowCaptureTimerId?;
|
|
55
|
+
private resizeObserver?;
|
|
53
56
|
private dragAndDropCleanupFn?;
|
|
54
|
-
private tableColumnWidths?;
|
|
55
57
|
constructor(props: ComponentProps);
|
|
56
58
|
componentDidMount(): void;
|
|
57
59
|
componentWillUnmount(): void;
|
|
58
|
-
handleColgroupUpdates(): void;
|
|
60
|
+
handleColgroupUpdates(force?: boolean): void;
|
|
59
61
|
componentDidUpdate(_: any, prevState: TableState): void;
|
|
60
62
|
private updateShadowState;
|
|
61
63
|
private createShadowSentinels;
|
|
64
|
+
private observeTable;
|
|
62
65
|
onStickyState: (state: StickyPluginState) => void;
|
|
63
66
|
prevTableState: any;
|
|
64
67
|
render(): JSX.Element;
|
|
@@ -24,9 +24,10 @@ type ResizableTableContainerProps = {
|
|
|
24
24
|
tableRef: HTMLTableElement;
|
|
25
25
|
isResizing?: boolean;
|
|
26
26
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
27
|
-
|
|
27
|
+
isTableScalingEnabled?: boolean;
|
|
28
|
+
tableWrapperHeight?: number;
|
|
28
29
|
};
|
|
29
|
-
export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, editorView, getPos, tableRef, isResizing, pluginInjectionApi,
|
|
30
|
+
export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, editorView, getPos, tableRef, isResizing, pluginInjectionApi, isTableScalingEnabled, tableWrapperHeight, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
|
|
30
31
|
type TableContainerProps = {
|
|
31
32
|
node: PMNode;
|
|
32
33
|
className: string;
|
|
@@ -39,7 +40,8 @@ type TableContainerProps = {
|
|
|
39
40
|
isNested: boolean;
|
|
40
41
|
isResizing?: boolean;
|
|
41
42
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
42
|
-
|
|
43
|
+
isTableScalingEnabled?: boolean;
|
|
44
|
+
tableWrapperHeight?: number;
|
|
43
45
|
};
|
|
44
|
-
export declare const TableContainer: ({ children, node, className, containerWidth: { lineLength, width: editorWidth }, isTableResizingEnabled, isBreakoutEnabled, editorView, getPos, tableRef, isNested, isResizing, pluginInjectionApi,
|
|
46
|
+
export declare const TableContainer: ({ children, node, className, containerWidth: { lineLength, width: editorWidth }, isTableResizingEnabled, isBreakoutEnabled, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isTableScalingEnabled, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
|
|
45
47
|
export {};
|
|
@@ -16,11 +16,11 @@ interface TableResizerProps {
|
|
|
16
16
|
displayGuideline: (guideline: GuidelineConfig[]) => boolean;
|
|
17
17
|
attachAnalyticsEvent: (payload: TableEventPayload) => ((tr: Transaction) => boolean) | undefined;
|
|
18
18
|
displayGapCursor: (toggle: boolean) => boolean;
|
|
19
|
-
|
|
19
|
+
isTableScalingEnabled?: boolean;
|
|
20
20
|
}
|
|
21
21
|
export interface TableResizerImprovementProps extends TableResizerProps {
|
|
22
22
|
onResizeStop?: () => void;
|
|
23
23
|
onResizeStart?: () => void;
|
|
24
24
|
}
|
|
25
|
-
export declare const TableResizer: ({ children, width, maxWidth, containerWidth, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor,
|
|
25
|
+
export declare const TableResizer: ({ children, width, maxWidth, containerWidth, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, }: PropsWithChildren<TableResizerImprovementProps>) => JSX.Element;
|
|
26
26
|
export {};
|
|
@@ -14,7 +14,7 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
14
14
|
private resizeObserver?;
|
|
15
15
|
eventDispatcher?: EventDispatcher;
|
|
16
16
|
getPos: getPosHandlerNode;
|
|
17
|
-
|
|
17
|
+
options: import("./types").TableOptions | undefined;
|
|
18
18
|
constructor(props: Props);
|
|
19
19
|
getContentDOM(): {
|
|
20
20
|
dom: HTMLElement;
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export interface TablePluginOptions {
|
|
|
16
16
|
fullWidthEnabled?: boolean;
|
|
17
17
|
wasFullWidthEnabled?: boolean;
|
|
18
18
|
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
19
|
+
isTableScalingEnabled?: boolean;
|
|
19
20
|
}
|
|
20
21
|
type InsertTableAction = (analyticsPayload: AnalyticsEventPayload) => Command;
|
|
21
22
|
export type TablePlugin = NextEditorPlugin<'table', {
|
|
@@ -1,5 +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
|
-
|
|
5
|
-
export declare const createPlugin: (dispatch: Dispatch, getEditorFeatureFlags?: GetEditorFeatureFlags, editorAnalyticsAPI?: EditorAnalyticsAPI) => SafePlugin<import("./types").DragAndDropPluginState>;
|
|
4
|
+
export declare const createPlugin: (dispatch: Dispatch, editorAnalyticsAPI?: EditorAnalyticsAPI) => SafePlugin<import("./types").DragAndDropPluginState>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
-
import type { GetEditorContainerWidth
|
|
4
|
-
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null,
|
|
3
|
+
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
4
|
+
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, dragAndDropEnabled?: boolean, isTableScalingEnabled?: boolean): SafePlugin;
|
|
5
5
|
export default keymapPlugin;
|
|
@@ -5,4 +5,4 @@ import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider'
|
|
|
5
5
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
6
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { PluginConfig, PluginInjectionAPI } from '../types';
|
|
8
|
-
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, breakoutEnabled?: boolean, tableResizingEnabled?: boolean, fullWidthModeEnabled?: boolean, previousFullWidthModeEnabled?: boolean, dragAndDropEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI) => SafePlugin<import("../types").TablePluginState>;
|
|
8
|
+
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, breakoutEnabled?: boolean, tableResizingEnabled?: boolean, fullWidthModeEnabled?: boolean, previousFullWidthModeEnabled?: boolean, dragAndDropEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI, isTableScalingEnabled?: boolean) => SafePlugin<import("../types").TablePluginState>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Dispatch
|
|
1
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
-
|
|
4
|
-
export declare const createPlugin: (dispatch: Dispatch, eventDispatcher: EventDispatcher, initialState: (() => never[]) | undefined, getEditorFeatureFlags: GetEditorFeatureFlags) => SafePlugin<import("./types").StickyPluginState>;
|
|
3
|
+
export declare const createPlugin: (dispatch: Dispatch, initialState?: () => never[]) => SafePlugin<import("./types").StickyPluginState>;
|
|
@@ -10,7 +10,7 @@ type Col = Array<string | {
|
|
|
10
10
|
*/
|
|
11
11
|
export declare const getColWidthFix: (colwidth: number, tableColumnCount: number) => number;
|
|
12
12
|
export declare const generateColgroup: (table: PmNode, tableRef?: HTMLElement) => Col[];
|
|
13
|
-
export declare const insertColgroupFromNode: (tableRef: HTMLTableElement, table: PmNode,
|
|
13
|
+
export declare const insertColgroupFromNode: (tableRef: HTMLTableElement, table: PmNode, isTableScalingEnabled?: boolean, shouldRemove?: boolean) => HTMLCollection;
|
|
14
14
|
export declare const hasTableBeenResized: (table: PmNode) => boolean;
|
|
15
15
|
/**
|
|
16
16
|
* Check if a table has all the column width set to tableCellMinWidth(48px) or null
|
|
@@ -4,7 +4,7 @@ export { getColumnStateFromDOM, getFreeSpace, getCellsRefsInColumn, calculateCol
|
|
|
4
4
|
export type { ColumnState } from './column-state';
|
|
5
5
|
export { growColumn, shrinkColumn, reduceSpace } from './resize-logic';
|
|
6
6
|
export { getResizeState, updateColgroup, getTotalWidth, evenAllColumnsWidths, bulkColumnsResize, areColumnsEven, adjustColumnsWidths, } from './resize-state';
|
|
7
|
-
export { getLayoutSize, getDefaultLayoutMaxWidth, pointsAtCell, currentColWidth, domCellAround, getTableMaxWidth, getTableElementWidth,
|
|
7
|
+
export { getLayoutSize, getDefaultLayoutMaxWidth, pointsAtCell, currentColWidth, domCellAround, getTableMaxWidth, getTableElementWidth, getTableContainerElementWidth, } from './misc';
|
|
8
8
|
export { updateControls, isClickNear, getResizeCellPos } from './dom';
|
|
9
9
|
export { scale, scaleWithParent, scaleTable, previewScaleTable, } from './scale-table';
|
|
10
10
|
export type { ScaleOptions } from './scale-table';
|
|
@@ -23,5 +23,5 @@ export declare const getTableMaxWidth: ({ table, tableStart, state, layout, getE
|
|
|
23
23
|
* @returns calculated width of <table /> element derived from sum of colwidths on tableCell or tableHeader nodes or falls back to container width
|
|
24
24
|
*/
|
|
25
25
|
export declare const getTableElementWidth: (table: PMNode) => number;
|
|
26
|
-
export declare const
|
|
26
|
+
export declare const getTableContainerElementWidth: (table: PMNode) => number;
|
|
27
27
|
export {};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
1
2
|
import type { ResizeState } from './types';
|
|
2
|
-
export declare const resizeColumn: (resizeState: ResizeState, colIndex: number, amount: number, tableRef: HTMLElement, selectedColumns?: number[],
|
|
3
|
+
export declare const resizeColumn: (resizeState: ResizeState, colIndex: number, amount: number, tableRef: HTMLElement, tableNode: PmNode, selectedColumns?: number[], isTableScalingEnabled?: boolean) => ResizeState;
|
|
@@ -4,7 +4,7 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
4
4
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
6
6
|
import type { ResizeState, ResizeStateWithAnalytics } from './types';
|
|
7
|
-
export declare const getResizeState: ({ minWidth, maxSize, table, tableRef, start, domAtPos,
|
|
7
|
+
export declare const getResizeState: ({ minWidth, maxSize, table, tableRef, start, domAtPos, isTableScalingEnabled, }: {
|
|
8
8
|
minWidth: number;
|
|
9
9
|
maxSize: number;
|
|
10
10
|
table: PMNode;
|
|
@@ -14,9 +14,9 @@ export declare const getResizeState: ({ minWidth, maxSize, table, tableRef, star
|
|
|
14
14
|
node: Node;
|
|
15
15
|
offset: number;
|
|
16
16
|
};
|
|
17
|
-
|
|
17
|
+
isTableScalingEnabled: boolean;
|
|
18
18
|
}) => ResizeState;
|
|
19
|
-
export declare const updateColgroup: (state: ResizeState, tableRef: HTMLElement,
|
|
19
|
+
export declare const updateColgroup: (state: ResizeState, tableRef: HTMLElement, tableNode?: PMNode, isTableScalingEnabled?: boolean) => void;
|
|
20
20
|
export declare const getTotalWidth: ({ cols }: ResizeState) => number;
|
|
21
21
|
export declare const adjustColumnsWidths: (resizeState: ResizeState, maxSize: number) => ResizeState;
|
|
22
22
|
export declare const evenAllColumnsWidths: (resizeState: ResizeState) => ResizeState;
|
|
@@ -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,
|
|
30
|
+
}, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled?: boolean) => ResizeStateWithAnalytics | undefined;
|
|
@@ -14,8 +14,8 @@ export interface ScaleOptions {
|
|
|
14
14
|
isFullWidthModeEnabled?: boolean;
|
|
15
15
|
isTableResizingEnabled?: boolean;
|
|
16
16
|
}
|
|
17
|
-
export declare const scale: (tableRef: HTMLTableElement, options: ScaleOptions, domAtPos: DomAtPos,
|
|
18
|
-
export declare const scaleWithParent: (tableRef: HTMLTableElement, parentWidth: number, table: PMNode, start: number, domAtPos: DomAtPos,
|
|
17
|
+
export declare const scale: (tableRef: HTMLTableElement, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabled?: boolean) => ResizeState | undefined;
|
|
18
|
+
export declare const scaleWithParent: (tableRef: HTMLTableElement, parentWidth: number, table: PMNode, start: number, domAtPos: DomAtPos, isTableScalingEnabled?: boolean) => ResizeState;
|
|
19
19
|
export declare function scaleTableTo(state: ResizeState, maxSize: number): ResizeState;
|
|
20
|
-
export declare const previewScaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos,
|
|
21
|
-
export declare const scaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos,
|
|
20
|
+
export declare const previewScaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabled?: boolean) => void;
|
|
21
|
+
export declare const scaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabled?: boolean) => (tr: Transaction) => Transaction;
|
|
@@ -6,13 +6,12 @@
|
|
|
6
6
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
7
7
|
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
8
8
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
9
|
-
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
10
9
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
11
10
|
type TableWidthPluginState = {
|
|
12
11
|
resizing: boolean;
|
|
13
12
|
};
|
|
14
13
|
export declare const pluginKey: PluginKey<TableWidthPluginState>;
|
|
15
|
-
declare const createPlugin: (dispatch: Dispatch, dispatchAnalyticsEvent: DispatchAnalyticsEvent, fullWidthEnabled: boolean
|
|
14
|
+
declare const createPlugin: (dispatch: Dispatch, dispatchAnalyticsEvent: DispatchAnalyticsEvent, fullWidthEnabled: boolean) => SafePlugin<{
|
|
16
15
|
resizing: boolean;
|
|
17
16
|
}>;
|
|
18
17
|
export { createPlugin };
|
package/dist/types/toolbar.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
5
5
|
import { Rect } from '@atlaskit/editor-tables/table-map';
|
|
6
6
|
import type { PluginConfig, ToolbarMenuConfig, ToolbarMenuContext, ToolbarMenuState } from './types';
|
|
7
7
|
export declare const getToolbarMenuConfig: (config: ToolbarMenuConfig, state: ToolbarMenuState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => FloatingToolbarItem<Command>;
|
|
8
|
-
export declare const getToolbarCellOptionsConfig: (editorState: EditorState, editorView: EditorView | undefined | null, initialSelectionRect: Rect, { formatMessage }: ToolbarMenuContext, getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null,
|
|
8
|
+
export declare const getToolbarCellOptionsConfig: (editorState: EditorState, editorView: EditorView | undefined | null, initialSelectionRect: Rect, { formatMessage }: ToolbarMenuContext, getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean) => FloatingToolbarDropdown<Command>;
|
|
9
9
|
export declare const getClosestSelectionRect: (state: EditorState) => Rect | undefined;
|
|
10
10
|
export declare const getClosestSelectionOrTableRect: (state: EditorState) => Rect | undefined;
|
|
11
11
|
export declare const getToolbarConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorFeatureFlags: GetEditorFeatureFlags, getEditorView: () => EditorView | null) => (config: PluginConfig) => FloatingToolbarHandler;
|
|
12
|
-
export declare const getDistributeConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null,
|
|
12
|
+
export declare const getDistributeConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean) => Command;
|
|
@@ -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: (
|
|
24
|
+
export declare const rescaleColumns: (isTableScalingEnabled?: 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,
|
|
4
|
+
export declare const deleteColumns: (rect: Rect, allowCustomStep: boolean, view?: EditorView, isTableScalingEnabled?: boolean) => (tr: Transaction) => Transaction;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -89,6 +89,7 @@ export interface TablePluginState {
|
|
|
89
89
|
isTableResizingEnabled?: boolean;
|
|
90
90
|
isDragAndDropEnabled?: boolean;
|
|
91
91
|
isTableHovered?: boolean;
|
|
92
|
+
isTableScalingEnabled?: boolean;
|
|
92
93
|
}
|
|
93
94
|
export type TablePluginAction = {
|
|
94
95
|
type: 'SET_EDITOR_FOCUS';
|
|
@@ -411,9 +412,6 @@ export interface ToolbarMenuState {
|
|
|
411
412
|
export interface ToolbarMenuContext {
|
|
412
413
|
formatMessage: IntlShape['formatMessage'];
|
|
413
414
|
}
|
|
414
|
-
export type ElementContentRects = {
|
|
415
|
-
[key: string]: ResizeObserverEntry['contentRect'];
|
|
416
|
-
};
|
|
417
415
|
export declare enum ShadowEvent {
|
|
418
416
|
SHOW_BEFORE_SHADOW = "showBeforeShadow",
|
|
419
417
|
SHOW_AFTER_SHADOW = "showAfterShadow"
|
|
@@ -17,7 +17,7 @@ export interface Props {
|
|
|
17
17
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
18
18
|
}
|
|
19
19
|
declare const FloatingContextualMenu: {
|
|
20
|
-
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth,
|
|
20
|
+
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth, }: Props): jsx.JSX.Element | null;
|
|
21
21
|
displayName: string;
|
|
22
22
|
};
|
|
23
23
|
export default FloatingContextualMenu;
|
|
@@ -24,9 +24,9 @@ type DragMenuProps = {
|
|
|
24
24
|
mountPoint?: HTMLElement;
|
|
25
25
|
boundariesElement?: HTMLElement;
|
|
26
26
|
scrollableElement?: HTMLElement;
|
|
27
|
-
|
|
27
|
+
isTableScalingEnabled?: boolean;
|
|
28
28
|
};
|
|
29
|
-
export declare const DragMenu: React.MemoExoticComponent<({ direction, index, target, isOpen, editorView, tableNode, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, fitHeight, fitWidth, mountPoint, scrollableElement, boundariesElement,
|
|
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
30
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<DragMenuProps & WrappedComponentProps<"intl">>> & {
|
|
31
31
|
WrappedComponent: React.ComponentType<DragMenuProps & WrappedComponentProps<"intl">>;
|
|
32
32
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import type { GetEditorContainerWidth
|
|
3
|
+
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import type { RowStickyState } from '../../pm-plugins/sticky-headers';
|
|
@@ -20,10 +20,9 @@ export interface Props {
|
|
|
20
20
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
21
21
|
stickyHeaders?: RowStickyState;
|
|
22
22
|
pluginConfig?: PluginConfig;
|
|
23
|
-
getEditorFeatureFlags: GetEditorFeatureFlags;
|
|
24
23
|
}
|
|
25
24
|
declare const FloatingDragMenu: {
|
|
26
|
-
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, tableNode, direction, index, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, stickyHeaders, pluginConfig,
|
|
25
|
+
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, tableNode, direction, index, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, stickyHeaders, pluginConfig, }: Props): JSX.Element | null;
|
|
27
26
|
displayName: string;
|
|
28
27
|
};
|
|
29
28
|
export default FloatingDragMenu;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
3
|
import type { DispatchAnalyticsEvent, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import type { GetEditorContainerWidth
|
|
4
|
+
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
5
5
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
7
|
export interface Props {
|
|
@@ -20,7 +20,6 @@ export interface Props {
|
|
|
20
20
|
hasStickyHeaders?: boolean;
|
|
21
21
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
22
22
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
23
|
-
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
24
23
|
}
|
|
25
24
|
export declare class FloatingInsertButton extends React.Component<Props & WrappedComponentProps, any> {
|
|
26
25
|
static displayName: string;
|
|
@@ -25,6 +25,7 @@ export interface Props {
|
|
|
25
25
|
tableContainerWidth?: number;
|
|
26
26
|
isNumberColumnEnabled?: boolean;
|
|
27
27
|
getScrollOffset?: () => number;
|
|
28
|
+
tableWrapperHeight?: number;
|
|
28
29
|
}
|
|
29
|
-
export declare const TableFloatingColumnControls: ({ editorView, tableRef, getNode, tableActive, hasHeaderRow, hoveredCell, isResizing, stickyHeader, selection, isInDanger, isTableHovered, tableContainerWidth, isNumberColumnEnabled, getScrollOffset, }: Props) => JSX.Element | null;
|
|
30
|
+
export declare const TableFloatingColumnControls: ({ editorView, tableRef, getNode, tableActive, hasHeaderRow, hoveredCell, isResizing, stickyHeader, selection, isInDanger, isTableHovered, tableContainerWidth, isNumberColumnEnabled, getScrollOffset, tableWrapperHeight, }: Props) => JSX.Element | null;
|
|
30
31
|
export default TableFloatingColumnControls;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import type { TableColumnOrdering } from '@atlaskit/custom-steps';
|
|
3
3
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import type { RowStickyState } from '../../pm-plugins/sticky-headers';
|
|
7
7
|
import type { CellHoverMeta } from '../../types';
|
|
8
|
-
export interface
|
|
8
|
+
export interface TableFloatingControlsProps {
|
|
9
9
|
editorView: EditorView;
|
|
10
10
|
selection?: Selection;
|
|
11
11
|
tableRef?: HTMLTableElement;
|
|
@@ -25,24 +25,7 @@ export interface Props {
|
|
|
25
25
|
ordering?: TableColumnOrdering;
|
|
26
26
|
stickyHeader?: RowStickyState;
|
|
27
27
|
insertRowButtonIndex?: number;
|
|
28
|
+
tableWrapperWidth?: number;
|
|
28
29
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
tableWrapperHeight: number;
|
|
32
|
-
}
|
|
33
|
-
export default class TableFloatingControls extends Component<Props, State> {
|
|
34
|
-
static displayName: string;
|
|
35
|
-
private resizeObserver?;
|
|
36
|
-
constructor(props: Props);
|
|
37
|
-
componentDidMount(): void;
|
|
38
|
-
componentDidUpdate(): void;
|
|
39
|
-
private tryInitResizeObserver;
|
|
40
|
-
shouldComponentUpdate(nextProps: Props, nextState: State): boolean;
|
|
41
|
-
componentWillUnmount(): void;
|
|
42
|
-
render(): JSX.Element | null;
|
|
43
|
-
private selectRow;
|
|
44
|
-
private selectRows;
|
|
45
|
-
private hoverRows;
|
|
46
|
-
private updateCellHoverLocation;
|
|
47
|
-
}
|
|
48
|
-
export {};
|
|
30
|
+
export declare const TableFloatingControls: ({ editorView, tableRef, tableNode, isInDanger, isResizing, isNumberColumnEnabled, isHeaderRowEnabled, isHeaderColumnEnabled, tableActive, hasHeaderRow, hoveredRows, stickyHeader, isDragAndDropEnabled, hoveredCell, isTableHovered, tableWrapperWidth, }: TableFloatingControlsProps) => JSX.Element | null;
|
|
31
|
+
export default TableFloatingControls;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
2
1
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
export declare const createTableWithWidth: (
|
|
2
|
+
export declare const createTableWithWidth: (isTableScalingEnabled?: boolean, isFullWidthModeEnabled?: boolean, createTableProps?: {
|
|
4
3
|
rowsCount?: number;
|
|
5
4
|
colsCount?: number;
|
|
6
5
|
}) => (schema: Schema) => import("prosemirror-model").Node;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ElementContentRects } from '../types';
|
|
2
1
|
export declare const isCell: (node: HTMLElement | null) => boolean;
|
|
3
2
|
export declare const isCornerButton: (node: HTMLElement | null) => boolean;
|
|
4
3
|
export declare const isInsertRowButton: (node: HTMLElement | null) => boolean | HTMLElement | null;
|
|
@@ -13,7 +12,16 @@ export declare const isDragRowControlsButton: (node: HTMLElement | null) => true
|
|
|
13
12
|
export declare const isDragRowFloatingInsertDot: (node: HTMLElement | null) => boolean;
|
|
14
13
|
export declare const isDragColumnFloatingInsertDot: (node: HTMLElement | null) => boolean;
|
|
15
14
|
export declare const isDragCornerButton: (node: HTMLElement | null) => boolean;
|
|
16
|
-
|
|
15
|
+
/**
|
|
16
|
+
* This can be used with mouse events to determine the left/right side of the target the pointer is closest too.
|
|
17
|
+
*
|
|
18
|
+
* WARNING: This metod reads properties which can trigger a reflow; use this wisely.
|
|
19
|
+
*
|
|
20
|
+
* @param mouseEvent
|
|
21
|
+
* @param gapInPixels
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
export declare const getMousePositionHorizontalRelativeByElement: (mouseEvent: MouseEvent, offsetX: number, gapInPixels?: number) => 'left' | 'right' | null;
|
|
17
25
|
export declare const getMousePositionVerticalRelativeByElement: (mouseEvent: MouseEvent) => 'top' | 'bottom' | null;
|
|
18
26
|
export declare const hasResizeHandler: ({ columnEndIndexTarget, target, }: {
|
|
19
27
|
columnEndIndexTarget: number;
|
|
@@ -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,
|
|
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) => DragMenuConfig[];
|
|
@@ -3,5 +3,5 @@ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
|
3
3
|
import type { Direction } from '@atlaskit/editor-tables/types';
|
|
4
4
|
export declare const initiateKeyboardColumnResizing: Command;
|
|
5
5
|
export declare const activateNextResizeArea: (direction: Direction) => Command;
|
|
6
|
-
export declare const changeColumnWidthByStep: (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth,
|
|
6
|
+
export declare const changeColumnWidthByStep: (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled?: boolean) => Command;
|
|
7
7
|
export declare const stopKeyboardColumnResizing: (originalTr?: Transaction) => Command;
|
|
@@ -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,
|
|
3
|
+
export declare const deleteColumnsCommand: (rect: Rect, isTableScalingEnabled?: boolean) => Command;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { Command, EditorCommand
|
|
2
|
+
import type { Command, EditorCommand } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
export declare function addColumnAt(
|
|
6
|
-
export declare const addColumnBefore: (
|
|
7
|
-
export declare const addColumnAfter: (
|
|
8
|
-
export declare const insertColumn: (
|
|
5
|
+
export declare function addColumnAt(isTableScalingEnabled?: boolean): (column: number, allowAddColumnCustomStep: boolean | undefined, view: EditorView | undefined) => (tr: Transaction) => Transaction;
|
|
6
|
+
export declare const addColumnBefore: (isTableScalingEnabled?: boolean) => Command;
|
|
7
|
+
export declare const addColumnAfter: (isTableScalingEnabled?: boolean) => Command;
|
|
8
|
+
export declare const insertColumn: (isTableScalingEnabled?: boolean) => (column: number) => Command;
|
|
9
9
|
export declare const insertRow: (row: number, moveCursorToTheNewRow: boolean) => Command;
|
|
10
|
-
export declare const createTable: (
|
|
11
|
-
export declare const insertTableWithSize: (isFullWidthModeEnabled?: boolean,
|
|
10
|
+
export declare const createTable: (isTableScalingEnabled?: boolean, isFullWidthModeEnabled?: boolean) => Command;
|
|
11
|
+
export declare const insertTableWithSize: (isFullWidthModeEnabled?: boolean, isTableScalingEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI) => (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
|