@atlaskit/editor-plugin-table 7.5.3 → 7.5.5
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 +14 -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 +2 -2
- package/dist/cjs/nodeviews/TableComponent.js +46 -59
- package/dist/cjs/nodeviews/TableContainer.js +5 -5
- package/dist/cjs/nodeviews/TableResizer.js +12 -12
- package/dist/cjs/nodeviews/table.js +9 -9
- package/dist/cjs/plugin.js +58 -56
- 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 +4 -6
- 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/ColumnResizeWidget/index.js +4 -5
- 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/utils/create.js +2 -5
- package/dist/cjs/utils/drag-menu.js +4 -4
- package/dist/cjs/utils/guidelines.js +5 -2
- package/dist/cjs/utils/snapping.js +14 -1
- 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 +2 -2
- package/dist/es2019/nodeviews/TableComponent.js +25 -36
- package/dist/es2019/nodeviews/TableContainer.js +6 -6
- package/dist/es2019/nodeviews/TableResizer.js +14 -14
- package/dist/es2019/nodeviews/table.js +9 -9
- package/dist/es2019/plugin.js +17 -17
- 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 +3 -5
- 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/ColumnResizeWidget/index.js +0 -1
- 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/utils/create.js +2 -5
- package/dist/es2019/utils/drag-menu.js +4 -4
- package/dist/es2019/utils/guidelines.js +3 -2
- package/dist/es2019/utils/snapping.js +12 -1
- 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 +2 -2
- package/dist/esm/nodeviews/TableComponent.js +45 -58
- package/dist/esm/nodeviews/TableContainer.js +6 -6
- package/dist/esm/nodeviews/TableResizer.js +14 -14
- package/dist/esm/nodeviews/table.js +9 -9
- package/dist/esm/plugin.js +58 -56
- 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 +4 -6
- 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/ColumnResizeWidget/index.js +0 -1
- 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/utils/create.js +2 -5
- package/dist/esm/utils/drag-menu.js +4 -4
- package/dist/esm/utils/guidelines.js +5 -2
- package/dist/esm/utils/snapping.js +14 -1
- 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 +1 -1
- package/dist/types/nodeviews/TableComponent.d.ts +2 -3
- package/dist/types/nodeviews/TableContainer.d.ts +4 -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 -0
- package/dist/types/ui/ColumnResizeWidget/index.d.ts +2 -2
- 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/ColumnDropTargets/ColumnDropTarget.d.ts +2 -2
- package/dist/types/ui/TableFloatingColumnControls/ColumnDropTargets/index.d.ts +2 -2
- package/dist/types/ui/TableFloatingColumnControls/index.d.ts +2 -2
- package/dist/types/utils/create.d.ts +1 -2
- package/dist/types/utils/drag-menu.d.ts +2 -2
- package/dist/types/utils/guidelines.d.ts +1 -0
- package/dist/types/utils/snapping.d.ts +2 -0
- 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 +1 -1
- package/dist/types-ts4.5/nodeviews/TableComponent.d.ts +2 -3
- package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +4 -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 -0
- package/dist/types-ts4.5/ui/ColumnResizeWidget/index.d.ts +2 -2
- 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/ColumnDropTargets/ColumnDropTarget.d.ts +2 -2
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnDropTargets/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/index.d.ts +2 -2
- package/dist/types-ts4.5/utils/create.d.ts +1 -2
- package/dist/types-ts4.5/utils/drag-menu.d.ts +2 -2
- package/dist/types-ts4.5/utils/guidelines.d.ts +1 -0
- package/dist/types-ts4.5/utils/snapping.d.ts +2 -0
- package/package.json +2 -2
- 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 +2 -2
- package/src/nodeviews/TableComponent.tsx +31 -46
- package/src/nodeviews/TableContainer.tsx +16 -7
- package/src/nodeviews/TableResizer.tsx +44 -24
- package/src/nodeviews/table.tsx +6 -5
- package/src/nodeviews/types.ts +1 -0
- package/src/plugin.tsx +12 -28
- 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 +3 -3
- 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 -0
- package/src/ui/ColumnResizeWidget/index.tsx +2 -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/ColumnDropTargets/ColumnDropTarget.tsx +2 -2
- package/src/ui/TableFloatingColumnControls/ColumnDropTargets/index.tsx +2 -2
- package/src/ui/TableFloatingColumnControls/index.tsx +2 -2
- package/src/utils/create.ts +2 -5
- package/src/utils/drag-menu.ts +8 -13
- package/src/utils/guidelines.ts +12 -1
- package/src/utils/snapping.ts +36 -0
|
@@ -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;
|
|
@@ -13,7 +13,7 @@ export declare const handleMouseEnter: (view: EditorView, mouseEvent: Event) =>
|
|
|
13
13
|
export declare const handleMouseLeave: (view: EditorView, event: Event) => boolean;
|
|
14
14
|
export declare const handleMouseMove: (view: EditorView, event: Event, elementContentRects?: ElementContentRects) => boolean;
|
|
15
15
|
export declare function handleTripleClick(view: EditorView, pos: number): boolean;
|
|
16
|
-
export declare const handleCut: (oldTr: Transaction, oldState: EditorState, newState: EditorState, editorAnalyticsAPI?: EditorAnalyticsAPI, editorView?: EditorView,
|
|
16
|
+
export declare const handleCut: (oldTr: Transaction, oldState: EditorState, newState: EditorState, editorAnalyticsAPI?: EditorAnalyticsAPI, editorView?: EditorView, isTableScalingEnabled?: boolean) => Transaction;
|
|
17
17
|
export declare const isTableInFocus: (view: EditorView) => boolean;
|
|
18
18
|
export declare const whenTableInFocus: (eventHandler: (view: EditorView, mouseEvent: Event, elementContentRects?: ElementContentRects) => boolean, elementContentRects?: ElementContentRects) => (view: EditorView, mouseEvent: Event) => boolean;
|
|
19
19
|
export declare const withCellTracking: (eventHandler: (view: EditorView, mouseEvent: Event, elementContentRects?: ElementContentRects) => boolean, elementContentRects?: ElementContentRects) => (view: EditorView, mouseEvent: Event) => boolean;
|
|
@@ -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;
|
|
@@ -51,11 +51,10 @@ declare class TableComponent extends React.Component<ComponentProps, TableState>
|
|
|
51
51
|
private isInitialOverflowSent;
|
|
52
52
|
private initialOverflowCaptureTimerId?;
|
|
53
53
|
private dragAndDropCleanupFn?;
|
|
54
|
-
private tableColumnWidths?;
|
|
55
54
|
constructor(props: ComponentProps);
|
|
56
55
|
componentDidMount(): void;
|
|
57
56
|
componentWillUnmount(): void;
|
|
58
|
-
handleColgroupUpdates(): void;
|
|
57
|
+
handleColgroupUpdates(force?: boolean): void;
|
|
59
58
|
componentDidUpdate(_: any, prevState: TableState): void;
|
|
60
59
|
private updateShadowState;
|
|
61
60
|
private createShadowSentinels;
|
|
@@ -24,9 +24,9 @@ type ResizableTableContainerProps = {
|
|
|
24
24
|
tableRef: HTMLTableElement;
|
|
25
25
|
isResizing?: boolean;
|
|
26
26
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
27
|
-
|
|
27
|
+
isTableScalingEnabled?: boolean;
|
|
28
28
|
};
|
|
29
|
-
export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, editorView, getPos, tableRef, isResizing, pluginInjectionApi,
|
|
29
|
+
export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, editorView, getPos, tableRef, isResizing, pluginInjectionApi, isTableScalingEnabled, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
|
|
30
30
|
type TableContainerProps = {
|
|
31
31
|
node: PMNode;
|
|
32
32
|
className: string;
|
|
@@ -39,7 +39,7 @@ type TableContainerProps = {
|
|
|
39
39
|
isNested: boolean;
|
|
40
40
|
isResizing?: boolean;
|
|
41
41
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
42
|
-
|
|
42
|
+
isTableScalingEnabled?: boolean;
|
|
43
43
|
};
|
|
44
|
-
export declare const TableContainer: ({ children, node, className, containerWidth: { lineLength, width: editorWidth }, isTableResizingEnabled, isBreakoutEnabled, editorView, getPos, tableRef, isNested, isResizing, pluginInjectionApi,
|
|
44
|
+
export declare const TableContainer: ({ children, node, className, containerWidth: { lineLength, width: editorWidth }, isTableResizingEnabled, isBreakoutEnabled, editorView, getPos, tableRef, isNested, isResizing, pluginInjectionApi, isTableScalingEnabled, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
|
|
45
45
|
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;
|
|
@@ -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 };
|
|
@@ -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;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
3
|
type Props = {
|
|
4
4
|
startIndex: number;
|
|
5
5
|
endIndex: number;
|
|
6
6
|
includeTooltip?: boolean;
|
|
7
7
|
};
|
|
8
|
-
export declare const ColumnResizeWidget:
|
|
8
|
+
export declare const ColumnResizeWidget: ({ startIndex, endIndex, includeTooltip, }: Props) => jsx.JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -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;
|
package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
export interface Props {
|
|
3
3
|
index: number;
|
|
4
4
|
localId?: string;
|
|
@@ -6,4 +6,4 @@ export interface Props {
|
|
|
6
6
|
height?: number;
|
|
7
7
|
marginTop?: number;
|
|
8
8
|
}
|
|
9
|
-
export declare const ColumnDropTarget:
|
|
9
|
+
export declare const ColumnDropTarget: ({ index, localId, width, height, marginTop, }: Props) => JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
export interface Props {
|
|
3
3
|
tableRef: HTMLTableElement;
|
|
4
4
|
tableHeight?: number;
|
|
@@ -7,4 +7,4 @@ export interface Props {
|
|
|
7
7
|
isHeaderSticky?: boolean;
|
|
8
8
|
getScrollOffset?: () => number;
|
|
9
9
|
}
|
|
10
|
-
export declare const ColumnDropTargets:
|
|
10
|
+
export declare const ColumnDropTargets: ({ tableRef, tableHeight, localId, colWidths, isHeaderSticky, getScrollOffset, }: Props) => JSX.Element | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import type { TableColumnOrdering } from '@atlaskit/custom-steps';
|
|
3
3
|
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
@@ -26,5 +26,5 @@ export interface Props {
|
|
|
26
26
|
isNumberColumnEnabled?: boolean;
|
|
27
27
|
getScrollOffset?: () => number;
|
|
28
28
|
}
|
|
29
|
-
export declare const TableFloatingColumnControls:
|
|
29
|
+
export declare const TableFloatingColumnControls: ({ editorView, tableRef, getNode, tableActive, hasHeaderRow, hoveredCell, isResizing, stickyHeader, selection, isInDanger, isTableHovered, tableContainerWidth, isNumberColumnEnabled, getScrollOffset, }: Props) => JSX.Element | null;
|
|
30
30
|
export default TableFloatingColumnControls;
|
|
@@ -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;
|
|
@@ -10,7 +10,7 @@ export declare const canMove: (sourceType: DraggableType, direction: DraggableDa
|
|
|
10
10
|
export type DragMenuOptionIdType = 'add_row_above' | 'add_row_below' | 'add_column_left' | 'add_column_right' | 'distribute_columns' | 'clear_cells' | 'delete_row' | 'delete_column' | 'move_column_left' | 'move_column_right' | 'move_row_up' | 'move_row_down' | 'sort_column_asc' | 'sort_column_desc';
|
|
11
11
|
export interface DragMenuConfig extends DropdownOptionT<Command> {
|
|
12
12
|
id: DragMenuOptionIdType;
|
|
13
|
-
icon?: React.ComponentType<IconProps
|
|
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[];
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
|
|
2
2
|
export declare const calculateDefaultSnappings: (lengthOffset?: number) => number[];
|
|
3
|
+
export declare const calculateDefaultTablePreserveSnappings: (lengthOffset?: number, editorContainerWith?: number) => number[];
|
|
3
4
|
export declare const defaultSnappingWidths: number[];
|
|
5
|
+
export declare const defaultTablePreserveSnappingWidths: (editorContainerWidth: number) => number[];
|
|
4
6
|
/**
|
|
5
7
|
* Returns keys of guidelines that are closest to the table and withthin the snapGap
|
|
6
8
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "7.5.
|
|
3
|
+
"version": "7.5.5",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@atlaskit/primitives": "^4.0.0",
|
|
50
50
|
"@atlaskit/theme": "^12.6.0",
|
|
51
51
|
"@atlaskit/toggle": "^13.0.0",
|
|
52
|
-
"@atlaskit/tokens": "^1.
|
|
52
|
+
"@atlaskit/tokens": "^1.40.0",
|
|
53
53
|
"@atlaskit/tooltip": "^18.1.0",
|
|
54
54
|
"@babel/runtime": "^7.0.0",
|
|
55
55
|
"@emotion/react": "^11.7.1",
|
|
@@ -228,7 +228,7 @@ export const changeColumnWidthByStep =
|
|
|
228
228
|
(
|
|
229
229
|
stepSize: number,
|
|
230
230
|
getEditorContainerWidth: GetEditorContainerWidth,
|
|
231
|
-
|
|
231
|
+
isTableScalingEnabled = false,
|
|
232
232
|
): Command =>
|
|
233
233
|
(state, dispatch, view) => {
|
|
234
234
|
let customTr = state.tr;
|
|
@@ -290,7 +290,7 @@ export const changeColumnWidthByStep =
|
|
|
290
290
|
tableRef: dom,
|
|
291
291
|
start: tableStartPosition,
|
|
292
292
|
domAtPos,
|
|
293
|
-
|
|
293
|
+
isTableScalingEnabled,
|
|
294
294
|
});
|
|
295
295
|
|
|
296
296
|
updateControls()(state);
|
|
@@ -308,8 +308,9 @@ export const changeColumnWidthByStep =
|
|
|
308
308
|
colIndex,
|
|
309
309
|
stepSize,
|
|
310
310
|
dom,
|
|
311
|
+
originalTable,
|
|
311
312
|
resizingSelectedColumns ? selectedColumns : undefined,
|
|
312
|
-
|
|
313
|
+
isTableScalingEnabled,
|
|
313
314
|
);
|
|
314
315
|
|
|
315
316
|
customTr = updateColumnWidths(
|
package/src/commands/delete.ts
CHANGED
|
@@ -5,13 +5,13 @@ 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,
|
|
8
|
+
(rect: Rect, isTableScalingEnabled = false): Command =>
|
|
9
9
|
(state, dispatch, view) => {
|
|
10
10
|
const tr = deleteColumns(
|
|
11
11
|
rect,
|
|
12
12
|
getAllowAddColumnCustomStep(state),
|
|
13
13
|
view,
|
|
14
|
-
|
|
14
|
+
isTableScalingEnabled,
|
|
15
15
|
)(state.tr);
|
|
16
16
|
if (dispatch) {
|
|
17
17
|
dispatch(tr);
|