@atlaskit/editor-plugin-table 5.3.12 → 5.3.14
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 +18 -0
- package/dist/cjs/plugins/table/event-handlers.js +6 -3
- package/dist/cjs/plugins/table/index.js +16 -2
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +2 -1
- package/dist/cjs/plugins/table/pm-plugins/decorations/plugin.js +3 -7
- package/dist/cjs/plugins/table/pm-plugins/decorations/utils/column-controls.js +1 -3
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/actions.js +2 -1
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/commands.js +22 -1
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/plugin.js +54 -7
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/reducer.js +6 -0
- package/dist/cjs/plugins/table/types.js +9 -2
- package/dist/cjs/plugins/table/ui/DragHandle/index.js +2 -0
- package/dist/cjs/plugins/table/ui/FloatingDragMenu/DragMenu.js +80 -0
- package/dist/cjs/plugins/table/ui/FloatingDragMenu/index.js +62 -0
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/InsertButton.js +52 -4
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/getPopupOptions.js +10 -8
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +12 -3
- package/dist/cjs/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.js +44 -5
- package/dist/cjs/plugins/table/ui/TableFloatingColumnControls/index.js +6 -4
- package/dist/cjs/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +44 -20
- package/dist/cjs/plugins/table/ui/TableFloatingControls/index.js +4 -0
- package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
- package/dist/cjs/plugins/table/ui/consts.js +3 -2
- package/dist/cjs/plugins/table/ui/ui-styles.js +27 -24
- package/dist/cjs/plugins/table/utils/dom.js +12 -4
- package/dist/cjs/plugins/table/utils/drag-menu.js +59 -0
- package/dist/cjs/plugins/table/utils/index.js +12 -0
- package/dist/es2019/plugins/table/event-handlers.js +5 -4
- package/dist/es2019/plugins/table/index.js +16 -2
- package/dist/es2019/plugins/table/nodeviews/TableComponent.js +2 -1
- package/dist/es2019/plugins/table/pm-plugins/decorations/plugin.js +3 -7
- package/dist/es2019/plugins/table/pm-plugins/decorations/utils/column-controls.js +1 -3
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/actions.js +2 -1
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/commands.js +20 -0
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/plugin.js +54 -3
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/reducer.js +7 -0
- package/dist/es2019/plugins/table/types.js +9 -2
- package/dist/es2019/plugins/table/ui/DragHandle/index.js +2 -0
- package/dist/es2019/plugins/table/ui/FloatingDragMenu/DragMenu.js +77 -0
- package/dist/es2019/plugins/table/ui/FloatingDragMenu/index.js +56 -0
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/InsertButton.js +53 -2
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/getPopupOptions.js +10 -8
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +9 -3
- package/dist/es2019/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.js +46 -6
- package/dist/es2019/plugins/table/ui/TableFloatingColumnControls/index.js +7 -5
- package/dist/es2019/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +45 -22
- package/dist/es2019/plugins/table/ui/TableFloatingControls/index.js +4 -0
- package/dist/es2019/plugins/table/ui/common-styles.js +51 -3
- package/dist/es2019/plugins/table/ui/consts.js +2 -1
- package/dist/es2019/plugins/table/ui/ui-styles.js +23 -1
- package/dist/es2019/plugins/table/utils/dom.js +5 -1
- package/dist/es2019/plugins/table/utils/drag-menu.js +44 -0
- package/dist/es2019/plugins/table/utils/index.js +1 -1
- package/dist/esm/plugins/table/event-handlers.js +7 -4
- package/dist/esm/plugins/table/index.js +16 -2
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +2 -1
- package/dist/esm/plugins/table/pm-plugins/decorations/plugin.js +3 -7
- package/dist/esm/plugins/table/pm-plugins/decorations/utils/column-controls.js +1 -3
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/actions.js +2 -1
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/commands.js +21 -0
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/plugin.js +54 -7
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/reducer.js +6 -0
- package/dist/esm/plugins/table/types.js +9 -2
- package/dist/esm/plugins/table/ui/DragHandle/index.js +2 -0
- package/dist/esm/plugins/table/ui/FloatingDragMenu/DragMenu.js +73 -0
- package/dist/esm/plugins/table/ui/FloatingDragMenu/index.js +55 -0
- package/dist/esm/plugins/table/ui/FloatingInsertButton/InsertButton.js +51 -3
- package/dist/esm/plugins/table/ui/FloatingInsertButton/getPopupOptions.js +10 -8
- package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +9 -3
- package/dist/esm/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.js +45 -6
- package/dist/esm/plugins/table/ui/TableFloatingColumnControls/index.js +7 -5
- package/dist/esm/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +46 -22
- package/dist/esm/plugins/table/ui/TableFloatingControls/index.js +4 -0
- package/dist/esm/plugins/table/ui/common-styles.js +2 -2
- package/dist/esm/plugins/table/ui/consts.js +2 -1
- package/dist/esm/plugins/table/ui/ui-styles.js +26 -23
- package/dist/esm/plugins/table/utils/dom.js +11 -3
- package/dist/esm/plugins/table/utils/drag-menu.js +52 -0
- package/dist/esm/plugins/table/utils/index.js +1 -1
- package/dist/types/plugins/table/pm-plugins/drag-and-drop/actions.d.ts +8 -1
- package/dist/types/plugins/table/pm-plugins/drag-and-drop/commands.d.ts +2 -1
- package/dist/types/plugins/table/pm-plugins/drag-and-drop/types.d.ts +4 -0
- package/dist/types/plugins/table/types.d.ts +10 -2
- package/dist/types/plugins/table/ui/DragHandle/index.d.ts +4 -2
- package/dist/types/plugins/table/ui/DragPreview/index.d.ts +2 -1
- package/dist/types/plugins/table/ui/FloatingDeleteButton/index.d.ts +2 -1
- package/dist/types/plugins/table/ui/FloatingDeleteButton/types.d.ts +2 -1
- package/dist/types/plugins/table/ui/FloatingDragMenu/DragMenu.d.ts +19 -0
- package/dist/types/plugins/table/ui/FloatingDragMenu/index.d.ts +21 -0
- package/dist/types/plugins/table/ui/FloatingInsertButton/InsertButton.d.ts +6 -1
- package/dist/types/plugins/table/ui/FloatingInsertButton/getPopupOptions.d.ts +2 -1
- package/dist/types/plugins/table/ui/FloatingInsertButton/index.d.ts +5 -5
- package/dist/types/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -1
- package/dist/types/plugins/table/ui/TableFloatingControls/RowControls/DragControls.d.ts +4 -0
- package/dist/types/plugins/table/ui/TableFloatingControls/index.d.ts +3 -0
- package/dist/types/plugins/table/ui/consts.d.ts +1 -0
- package/dist/types/plugins/table/ui/ui-styles.d.ts +1 -0
- package/dist/types/plugins/table/utils/dom.d.ts +4 -1
- package/dist/types/plugins/table/utils/drag-menu.d.ts +7 -0
- package/dist/types/plugins/table/utils/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/actions.d.ts +8 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/commands.d.ts +2 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/types.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/types.d.ts +10 -2
- package/dist/types-ts4.5/plugins/table/ui/DragHandle/index.d.ts +4 -2
- package/dist/types-ts4.5/plugins/table/ui/DragPreview/index.d.ts +2 -1
- package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/index.d.ts +2 -1
- package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/types.d.ts +2 -1
- package/dist/types-ts4.5/plugins/table/ui/FloatingDragMenu/DragMenu.d.ts +19 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingDragMenu/index.d.ts +21 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/InsertButton.d.ts +6 -1
- package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/getPopupOptions.d.ts +2 -1
- package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/index.d.ts +5 -5
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -1
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/RowControls/DragControls.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/index.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/ui/consts.d.ts +1 -0
- package/dist/types-ts4.5/plugins/table/ui/ui-styles.d.ts +1 -0
- package/dist/types-ts4.5/plugins/table/utils/dom.d.ts +4 -1
- package/dist/types-ts4.5/plugins/table/utils/drag-menu.d.ts +7 -0
- package/dist/types-ts4.5/plugins/table/utils/index.d.ts +1 -1
- package/package.json +3 -2
- package/src/__tests__/unit/pm-plugins/decorations/plugin.ts +40 -194
- package/src/__tests__/unit/ui/RowDragControls.tsx +9 -11
- package/src/plugins/table/event-handlers.ts +15 -3
- package/src/plugins/table/index.tsx +18 -1
- package/src/plugins/table/nodeviews/TableComponent.tsx +2 -1
- package/src/plugins/table/pm-plugins/decorations/plugin.ts +2 -9
- package/src/plugins/table/pm-plugins/decorations/utils/column-controls.ts +1 -3
- package/src/plugins/table/pm-plugins/drag-and-drop/actions.ts +14 -1
- package/src/plugins/table/pm-plugins/drag-and-drop/commands.ts +32 -1
- package/src/plugins/table/pm-plugins/drag-and-drop/plugin.ts +50 -2
- package/src/plugins/table/pm-plugins/drag-and-drop/reducer.ts +7 -0
- package/src/plugins/table/pm-plugins/drag-and-drop/types.ts +5 -0
- package/src/plugins/table/types.ts +14 -2
- package/src/plugins/table/ui/DragHandle/index.tsx +5 -1
- package/src/plugins/table/ui/DragPreview/index.tsx +2 -1
- package/src/plugins/table/ui/FloatingDeleteButton/index.tsx +2 -1
- package/src/plugins/table/ui/FloatingDeleteButton/types.ts +3 -1
- package/src/plugins/table/ui/FloatingDragMenu/DragMenu.tsx +99 -0
- package/src/plugins/table/ui/FloatingDragMenu/index.tsx +91 -0
- package/src/plugins/table/ui/FloatingInsertButton/InsertButton.tsx +79 -4
- package/src/plugins/table/ui/FloatingInsertButton/getPopupOptions.ts +31 -7
- package/src/plugins/table/ui/FloatingInsertButton/index.tsx +28 -13
- package/src/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.tsx +47 -3
- package/src/plugins/table/ui/TableFloatingColumnControls/index.tsx +11 -4
- package/src/plugins/table/ui/TableFloatingControls/RowControls/DragControls.tsx +65 -25
- package/src/plugins/table/ui/TableFloatingControls/index.tsx +7 -0
- package/src/plugins/table/ui/common-styles.ts +57 -2
- package/src/plugins/table/ui/consts.ts +2 -0
- package/src/plugins/table/ui/ui-styles.ts +27 -1
- package/src/plugins/table/utils/dom.ts +11 -4
- package/src/plugins/table/utils/drag-menu.ts +65 -0
- package/src/plugins/table/utils/index.ts +2 -0
- package/tsconfig.app.json +3 -0
|
@@ -2,7 +2,7 @@ export { getSelectedColumnIndexes, getSelectedRowIndexes, normalizeSelection, is
|
|
|
2
2
|
export { findControlsHoverDecoration, createControlsHoverDecoration, createColumnControlsDecoration, createColumnSelectedDecoration, createCellHoverDecoration, updateDecorations, createResizeHandleDecoration, createColumnInsertLine, createColumnLineResize, createRowInsertLine } from './decoration';
|
|
3
3
|
export { isIsolating, containsHeaderColumn, containsHeaderRow, checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled, isLayoutSupported, getTableWidth, tablesHaveDifferentColumnWidths, tablesHaveDifferentNoOfColumns, isTableNested, anyChildCellMergedAcrossRow, supportedHeaderRow } from './nodes';
|
|
4
4
|
export { unwrapContentFromTable, removeTableFromFirstChild, removeTableFromLastChild, transformSliceToRemoveOpenTable, transformSliceToCorrectEmptyTableCells, transformSliceToFixHardBreakProblemOnCopyFromCell } from './paste';
|
|
5
|
-
export { isCell, isCornerButton, isInsertRowButton, isColumnControlsDecorations, isTableControlsButton, isTableContainerOrWrapper, isRowDragControlsButton, isRowControlsButton, getColumnOrRowIndex, getMousePositionHorizontalRelativeByElement, getMousePositionVerticalRelativeByElement, updateResizeHandles, isResizeHandleDecoration, hasResizeHandler } from './dom';
|
|
5
|
+
export { isCell, isCornerButton, isInsertRowButton, isColumnControlsDecorations, isTableControlsButton, isTableContainerOrWrapper, isRowDragControlsButton, isRowControlsButton, isDragColumnFloatingInsertDot, isDragRowFloatingInsertDot, getColumnOrRowIndex, getMousePositionHorizontalRelativeByElement, getMousePositionVerticalRelativeByElement, updateResizeHandles, isResizeHandleDecoration, hasResizeHandler } from './dom';
|
|
6
6
|
export { getColumnsWidths, isColumnDeleteButtonVisible, getColumnDeleteButtonParams, getColumnClassNames } from './column-controls';
|
|
7
7
|
export { getRowHeights, isRowDeleteButtonVisible, getRowDeleteButtonParams, getRowsParams, getRowClassNames, copyPreviousRow } from './row-controls';
|
|
8
8
|
export { getSelectedTableInfo, getSelectedCellInfo } from './analytics';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
+
import type { TableDirection } from '../../types';
|
|
2
3
|
import type { DropTargetType } from './consts';
|
|
3
4
|
export interface DragAndDropAction<T, D> {
|
|
4
5
|
type: T;
|
|
@@ -7,6 +8,7 @@ export interface DragAndDropAction<T, D> {
|
|
|
7
8
|
export declare const DragAndDropActionType: {
|
|
8
9
|
readonly SET_DROP_TARGET: "SET_DROP_TARGET";
|
|
9
10
|
readonly CLEAR_DROP_TARGET: "CLEAR_DROP_TARGET";
|
|
11
|
+
readonly TOGGLE_DRAG_MENU: "TOGGLE_DRAG_MENU";
|
|
10
12
|
};
|
|
11
13
|
export type DragAndDropSetDropTargetAction = DragAndDropAction<typeof DragAndDropActionType.SET_DROP_TARGET, {
|
|
12
14
|
type: DropTargetType;
|
|
@@ -16,4 +18,9 @@ export type DragAndDropSetDropTargetAction = DragAndDropAction<typeof DragAndDro
|
|
|
16
18
|
export type DragAndDropClearDropTargetAction = DragAndDropAction<typeof DragAndDropActionType.CLEAR_DROP_TARGET, {
|
|
17
19
|
decorationSet: DecorationSet;
|
|
18
20
|
}>;
|
|
19
|
-
export type
|
|
21
|
+
export type DragAndDropToggleDragMenuAction = DragAndDropAction<typeof DragAndDropActionType.TOGGLE_DRAG_MENU, {
|
|
22
|
+
isDragMenuOpen: boolean;
|
|
23
|
+
direction: TableDirection;
|
|
24
|
+
index: number;
|
|
25
|
+
}>;
|
|
26
|
+
export type DragAndDropPluginAction = DragAndDropSetDropTargetAction | DragAndDropClearDropTargetAction | DragAndDropToggleDragMenuAction;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import type { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import type { DraggableType } from '../../types';
|
|
4
|
+
import type { DraggableType, TableDirection } from '../../types';
|
|
5
5
|
import { TableDecorations } from '../../types';
|
|
6
6
|
import { DropTargetType } from './consts';
|
|
7
7
|
export declare const getDecorations: (state: EditorState) => DecorationSet;
|
|
@@ -9,3 +9,4 @@ export declare const updatePluginStateDecorations: (state: EditorState, decorati
|
|
|
9
9
|
export declare const setDropTarget: (type: DropTargetType, index: number, tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
|
|
10
10
|
export declare const clearDropTarget: (tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
|
|
11
11
|
export declare const moveSource: (sourceType: DraggableType, sourceIndex: number, targetIndex: number) => import("@atlaskit/editor-common/types").Command;
|
|
12
|
+
export declare const toggleDragMenu: (isDragMenuOpen: boolean | undefined, direction?: TableDirection, index?: number) => import("@atlaskit/editor-common/types").Command;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
+
import type { TableDirection } from '../../types';
|
|
2
3
|
import type { DropTargetType } from './consts';
|
|
3
4
|
export interface DragAndDropPluginState {
|
|
4
5
|
decorationSet: DecorationSet;
|
|
5
6
|
dropTargetType: DropTargetType;
|
|
6
7
|
dropTargetIndex: number;
|
|
8
|
+
isDragMenuOpen: boolean;
|
|
9
|
+
dragMenuDirection?: TableDirection;
|
|
10
|
+
dragMenuIndex: number;
|
|
7
11
|
}
|
|
@@ -269,6 +269,9 @@ export declare const TableCssClassName: {
|
|
|
269
269
|
CONTROLS_INSERT_LINE: string;
|
|
270
270
|
CONTROLS_BUTTON_OVERLAY: string;
|
|
271
271
|
LAYOUT_BUTTON: string;
|
|
272
|
+
DRAG_CONTROLS_INSERT_BUTTON: string;
|
|
273
|
+
DRAG_CONTROLS_INSERT_BUTTON_INNER: string;
|
|
274
|
+
DRAG_CONTROLS_INSERT_BUTTON_WRAP: string;
|
|
272
275
|
CONTROLS_INSERT_MARKER: string;
|
|
273
276
|
CONTROLS_INSERT_COLUMN: string;
|
|
274
277
|
CONTROLS_INSERT_ROW: string;
|
|
@@ -281,8 +284,12 @@ export declare const TableCssClassName: {
|
|
|
281
284
|
CORNER_CONTROLS_INSERT_COLUMN_MARKER: string;
|
|
282
285
|
CONTROLS_CORNER_BUTTON: string;
|
|
283
286
|
/** Controls with drag handle */
|
|
284
|
-
|
|
285
|
-
|
|
287
|
+
DRAG_ROW_CONTROLS: string;
|
|
288
|
+
DRAG_ROW_FLOATING_INSERT_DOT_WRAPPER: string;
|
|
289
|
+
DRAG_ROW_FLOATING_INSERT_DOT: string;
|
|
290
|
+
DRAG_COLUMN_CONTROLS: string;
|
|
291
|
+
DRAG_COLUMN_FLOATING_INSERT_DOT_WRAPPER: string;
|
|
292
|
+
DRAG_COLUMN_FLOATING_INSERT_DOT: string;
|
|
286
293
|
DRAG_HANDLE_BUTTON_CONTAINER: string;
|
|
287
294
|
/** Other classes */
|
|
288
295
|
NUMBERED_COLUMN: string;
|
|
@@ -373,6 +380,7 @@ export type InvalidNodeAttr = {
|
|
|
373
380
|
spanValue: number;
|
|
374
381
|
tableLocalId: string;
|
|
375
382
|
};
|
|
383
|
+
export type TableDirection = 'row' | 'column';
|
|
376
384
|
/**
|
|
377
385
|
* Drag and Drop interfaces
|
|
378
386
|
*/
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import type { MouseEventHandler } from 'react';
|
|
2
|
+
import type { TableDirection } from '../../types';
|
|
2
3
|
type DragHandleAppearance = 'default' | 'selected' | 'disabled' | 'danger';
|
|
3
4
|
type DragHandleProps = {
|
|
4
5
|
tableLocalId: string;
|
|
5
6
|
indexes: number[];
|
|
6
7
|
previewWidth?: number;
|
|
7
8
|
previewHeight?: number;
|
|
8
|
-
direction?:
|
|
9
|
+
direction?: TableDirection;
|
|
9
10
|
appearance?: DragHandleAppearance;
|
|
10
11
|
onClick?: MouseEventHandler;
|
|
11
12
|
onMouseOver?: MouseEventHandler;
|
|
12
13
|
onMouseOut?: MouseEventHandler;
|
|
14
|
+
onMouseUp?: MouseEventHandler;
|
|
13
15
|
};
|
|
14
|
-
export declare const DragHandle: ({ tableLocalId, direction, appearance, indexes, previewWidth, previewHeight, onMouseOver, onMouseOut, onClick, }: DragHandleProps) => JSX.Element;
|
|
16
|
+
export declare const DragHandle: ({ tableLocalId, direction, appearance, indexes, previewWidth, previewHeight, onMouseOver, onMouseOut, onMouseUp, onClick, }: DragHandleProps) => JSX.Element;
|
|
15
17
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import type { TableDirection } from '../../types';
|
|
2
3
|
export declare const DragPreview: ({ direction, width, height, }: {
|
|
3
|
-
direction:
|
|
4
|
+
direction: TableDirection;
|
|
4
5
|
width: number;
|
|
5
6
|
height: number;
|
|
6
7
|
}) => JSX.Element;
|
|
@@ -3,6 +3,7 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
|
3
3
|
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { RowStickyState } from '../../pm-plugins/sticky-headers';
|
|
6
|
+
import type { TableDirection } from '../../types';
|
|
6
7
|
import type { CellSelectionType } from './types';
|
|
7
8
|
export interface Props {
|
|
8
9
|
editorView: EditorView;
|
|
@@ -23,7 +24,7 @@ export interface State {
|
|
|
23
24
|
position?: string;
|
|
24
25
|
scrollLeft: number;
|
|
25
26
|
}
|
|
26
|
-
export declare function getSelectionType(selection: Selection):
|
|
27
|
+
export declare function getSelectionType(selection: Selection): TableDirection | undefined;
|
|
27
28
|
declare class FloatingDeleteButton extends Component<Props, State> {
|
|
28
29
|
static displayName: string;
|
|
29
30
|
wrapper: HTMLElement | null;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import type { TableDirection } from '../../types';
|
|
2
|
+
export type CellSelectionType = TableDirection | undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import type { PluginConfig, TableDirection } from '../../types';
|
|
5
|
+
type DragMenuProps = {
|
|
6
|
+
direction?: TableDirection;
|
|
7
|
+
index?: number;
|
|
8
|
+
tableRef?: HTMLTableElement;
|
|
9
|
+
tableNode?: PmNode;
|
|
10
|
+
editorView: EditorView;
|
|
11
|
+
isOpen?: boolean;
|
|
12
|
+
targetCellPosition?: number;
|
|
13
|
+
mountPoint?: HTMLElement;
|
|
14
|
+
boundariesElement?: HTMLElement;
|
|
15
|
+
scrollableElement?: HTMLElement;
|
|
16
|
+
pluginConfig?: PluginConfig;
|
|
17
|
+
};
|
|
18
|
+
export declare const DragMenu: ({ direction, index, isOpen, editorView, tableNode, mountPoint, boundariesElement, scrollableElement, }: DragMenuProps) => JSX.Element | null;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import type { TableDirection } from '../../types';
|
|
5
|
+
export interface Props {
|
|
6
|
+
editorView: EditorView;
|
|
7
|
+
isOpen: boolean;
|
|
8
|
+
tableRef?: HTMLTableElement;
|
|
9
|
+
tableNode?: PmNode;
|
|
10
|
+
mountPoint?: HTMLElement;
|
|
11
|
+
boundariesElement?: HTMLElement;
|
|
12
|
+
scrollableElement?: HTMLElement;
|
|
13
|
+
direction?: TableDirection;
|
|
14
|
+
index?: number;
|
|
15
|
+
targetCellPosition?: number;
|
|
16
|
+
}
|
|
17
|
+
declare const FloatingDragMenu: {
|
|
18
|
+
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, tableRef, tableNode, direction, index, targetCellPosition, }: Props): JSX.Element | null;
|
|
19
|
+
displayName: string;
|
|
20
|
+
};
|
|
21
|
+
export default FloatingDragMenu;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import type { SyntheticEvent } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
+
import type { TableDirection } from '../../types';
|
|
4
5
|
export interface ButtonProps {
|
|
5
|
-
type:
|
|
6
|
+
type: TableDirection;
|
|
6
7
|
tableRef: HTMLElement;
|
|
7
8
|
onMouseDown: (event: SyntheticEvent<HTMLButtonElement>) => void;
|
|
8
9
|
hasStickyHeaders: boolean;
|
|
9
10
|
}
|
|
11
|
+
export declare const InsertButtonForDragAndDrop: ({ onMouseDown, tableRef, type, intl: { formatMessage }, hasStickyHeaders, }: ButtonProps & WrappedComponentProps) => JSX.Element;
|
|
12
|
+
export declare const DragAndDropInsertButton: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps<"intl">>> & {
|
|
13
|
+
WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps<"intl">>;
|
|
14
|
+
};
|
|
10
15
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps<"intl">>> & {
|
|
11
16
|
WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps<"intl">>;
|
|
12
17
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { PopupProps } from '@atlaskit/editor-common/ui';
|
|
2
|
-
|
|
2
|
+
import type { TableDirection } from '../../types';
|
|
3
|
+
declare function getPopupOptions(direction: TableDirection, index: number, hasNumberedColumns: boolean, isDragAndDropEnabled: boolean, tableContainer: HTMLElement | null): Partial<PopupProps>;
|
|
3
4
|
export default getPopupOptions;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
import type { DispatchAnalyticsEvent, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
5
4
|
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
6
|
-
import { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
7
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
+
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
7
|
export interface Props {
|
|
9
8
|
editorView: EditorView;
|
|
10
9
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
@@ -14,6 +13,7 @@ export interface Props {
|
|
|
14
13
|
insertRowButtonIndex?: number;
|
|
15
14
|
isHeaderColumnEnabled?: boolean;
|
|
16
15
|
isHeaderRowEnabled?: boolean;
|
|
16
|
+
isDragAndDropEnabled?: boolean;
|
|
17
17
|
mountPoint?: HTMLElement;
|
|
18
18
|
boundariesElement?: HTMLElement;
|
|
19
19
|
scrollableElement?: HTMLElement;
|
|
@@ -12,6 +12,7 @@ export interface ColumnControlsProps {
|
|
|
12
12
|
localId?: string;
|
|
13
13
|
rowHeights?: number[];
|
|
14
14
|
colWidths?: (number | undefined)[];
|
|
15
|
+
hasHeaderColumn?: boolean;
|
|
15
16
|
}
|
|
16
|
-
export declare const ColumnControls: ({ editorView, tableActive, tableRef, hoveredCell, isResizing, stickyTop, localId, isInDanger, rowHeights, colWidths, }: ColumnControlsProps) => JSX.Element;
|
|
17
|
+
export declare const ColumnControls: ({ editorView, tableActive, tableRef, hoveredCell, isResizing, stickyTop, localId, isInDanger, rowHeights, colWidths, hasHeaderColumn, }: ColumnControlsProps) => JSX.Element;
|
|
17
18
|
export default ColumnControls;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
5
|
import type { CellHoverMeta } from '../../../types';
|
|
5
6
|
type DragControlsProps = {
|
|
6
7
|
editorView: EditorView;
|
|
7
8
|
tableRef: HTMLTableElement;
|
|
9
|
+
tableNode?: PmNode;
|
|
8
10
|
tableActive?: boolean;
|
|
9
11
|
hoveredCell?: CellHoverMeta;
|
|
10
12
|
isInDanger?: boolean;
|
|
13
|
+
isResizing?: boolean;
|
|
14
|
+
hasHeaderRow?: boolean;
|
|
11
15
|
hoverRows: (rows: number[], danger?: boolean) => void;
|
|
12
16
|
selectRow: (row: number, expand: boolean) => void;
|
|
13
17
|
updateCellHoverLocation: (rowIndex: number) => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Component } from 'react';
|
|
2
2
|
import type { TableColumnOrdering } from '@atlaskit/custom-steps';
|
|
3
|
+
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
4
|
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
4
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
6
|
import type { RowStickyState } from '../../pm-plugins/sticky-headers';
|
|
@@ -8,6 +9,7 @@ export interface Props {
|
|
|
8
9
|
editorView: EditorView;
|
|
9
10
|
selection?: Selection;
|
|
10
11
|
tableRef?: HTMLTableElement;
|
|
12
|
+
tableNode?: PmNode;
|
|
11
13
|
tableActive?: boolean;
|
|
12
14
|
isInDanger?: boolean;
|
|
13
15
|
isResizing?: boolean;
|
|
@@ -21,6 +23,7 @@ export interface Props {
|
|
|
21
23
|
hoveredCell?: CellHoverMeta;
|
|
22
24
|
ordering?: TableColumnOrdering;
|
|
23
25
|
stickyHeader?: RowStickyState;
|
|
26
|
+
insertRowButtonIndex?: number;
|
|
24
27
|
}
|
|
25
28
|
interface State {
|
|
26
29
|
tableHeight: number;
|
|
@@ -3,6 +3,7 @@ export declare const InsertMarker: (props: ThemeProps, cssString?: string) => im
|
|
|
3
3
|
export declare const HeaderButton: (props: ThemeProps, cssString?: string) => import("@emotion/react").SerializedStyles;
|
|
4
4
|
export declare const HeaderButtonHover: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
5
5
|
export declare const HeaderButtonDanger: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
6
|
+
export declare const dragInsertButtonWrapper: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
6
7
|
export declare const insertColumnButtonWrapper: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
7
8
|
export declare const insertRowButtonWrapper: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
8
9
|
export declare const columnControlsLineMarker: () => import("@emotion/react").SerializedStyles;
|
|
@@ -5,10 +5,13 @@ export declare const isInsertRowButton: (node: HTMLElement | null) => boolean |
|
|
|
5
5
|
export declare const getColumnOrRowIndex: (target: HTMLElement) => [number, number];
|
|
6
6
|
export declare const isColumnControlsDecorations: (node: HTMLElement | null) => boolean;
|
|
7
7
|
export declare const isRowControlsButton: (node: HTMLElement | null) => boolean;
|
|
8
|
-
export declare const isRowDragControlsButton: (node: HTMLElement | null) => true | HTMLElement | null;
|
|
9
8
|
export declare const isResizeHandleDecoration: (node: HTMLElement | null) => boolean;
|
|
10
9
|
export declare const isTableControlsButton: (node: HTMLElement | null) => boolean;
|
|
11
10
|
export declare const isTableContainerOrWrapper: (node: HTMLElement | null) => boolean;
|
|
11
|
+
/** drag-and-drop classes */
|
|
12
|
+
export declare const isRowDragControlsButton: (node: HTMLElement | null) => true | HTMLElement | null;
|
|
13
|
+
export declare const isDragRowFloatingInsertDot: (node: HTMLElement | null) => boolean;
|
|
14
|
+
export declare const isDragColumnFloatingInsertDot: (node: HTMLElement | null) => boolean;
|
|
12
15
|
export declare const getMousePositionHorizontalRelativeByElement: (mouseEvent: MouseEvent, elementContentRects?: ElementContentRects, gapInPixels?: number) => 'left' | 'right' | null;
|
|
13
16
|
export declare const getMousePositionVerticalRelativeByElement: (mouseEvent: MouseEvent) => 'top' | 'bottom' | null;
|
|
14
17
|
export declare const updateResizeHandles: (tableRef?: HTMLElement) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Command, DropdownOptionT } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
3
|
+
import type { TableDirection } from '../types';
|
|
4
|
+
export interface DragMenuConfig extends DropdownOptionT<Command> {
|
|
5
|
+
id: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const getDragMenuConfig: (direction: TableDirection, tableMap?: TableMap, index?: number) => DragMenuConfig[];
|
|
@@ -2,7 +2,7 @@ export { getSelectedColumnIndexes, getSelectedRowIndexes, normalizeSelection, is
|
|
|
2
2
|
export { findControlsHoverDecoration, createControlsHoverDecoration, createColumnControlsDecoration, createColumnSelectedDecoration, createCellHoverDecoration, updateDecorations, createResizeHandleDecoration, createColumnInsertLine, createColumnLineResize, createRowInsertLine, } from './decoration';
|
|
3
3
|
export { isIsolating, containsHeaderColumn, containsHeaderRow, checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled, isLayoutSupported, getTableWidth, tablesHaveDifferentColumnWidths, tablesHaveDifferentNoOfColumns, isTableNested, anyChildCellMergedAcrossRow, supportedHeaderRow, } from './nodes';
|
|
4
4
|
export { unwrapContentFromTable, removeTableFromFirstChild, removeTableFromLastChild, transformSliceToRemoveOpenTable, transformSliceToCorrectEmptyTableCells, transformSliceToFixHardBreakProblemOnCopyFromCell, } from './paste';
|
|
5
|
-
export { isCell, isCornerButton, isInsertRowButton, isColumnControlsDecorations, isTableControlsButton, isTableContainerOrWrapper, isRowDragControlsButton, isRowControlsButton, getColumnOrRowIndex, getMousePositionHorizontalRelativeByElement, getMousePositionVerticalRelativeByElement, updateResizeHandles, isResizeHandleDecoration, hasResizeHandler, } from './dom';
|
|
5
|
+
export { isCell, isCornerButton, isInsertRowButton, isColumnControlsDecorations, isTableControlsButton, isTableContainerOrWrapper, isRowDragControlsButton, isRowControlsButton, isDragColumnFloatingInsertDot, isDragRowFloatingInsertDot, getColumnOrRowIndex, getMousePositionHorizontalRelativeByElement, getMousePositionVerticalRelativeByElement, updateResizeHandles, isResizeHandleDecoration, hasResizeHandler, } from './dom';
|
|
6
6
|
export { getColumnsWidths, isColumnDeleteButtonVisible, getColumnDeleteButtonParams, getColumnClassNames, } from './column-controls';
|
|
7
7
|
export { getRowHeights, isRowDeleteButtonVisible, getRowDeleteButtonParams, getRowsParams, getRowClassNames, copyPreviousRow, } from './row-controls';
|
|
8
8
|
export type { RowParams } from './row-controls';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
+
import type { TableDirection } from '../../types';
|
|
2
3
|
import type { DropTargetType } from './consts';
|
|
3
4
|
export interface DragAndDropAction<T, D> {
|
|
4
5
|
type: T;
|
|
@@ -7,6 +8,7 @@ export interface DragAndDropAction<T, D> {
|
|
|
7
8
|
export declare const DragAndDropActionType: {
|
|
8
9
|
readonly SET_DROP_TARGET: "SET_DROP_TARGET";
|
|
9
10
|
readonly CLEAR_DROP_TARGET: "CLEAR_DROP_TARGET";
|
|
11
|
+
readonly TOGGLE_DRAG_MENU: "TOGGLE_DRAG_MENU";
|
|
10
12
|
};
|
|
11
13
|
export type DragAndDropSetDropTargetAction = DragAndDropAction<typeof DragAndDropActionType.SET_DROP_TARGET, {
|
|
12
14
|
type: DropTargetType;
|
|
@@ -16,4 +18,9 @@ export type DragAndDropSetDropTargetAction = DragAndDropAction<typeof DragAndDro
|
|
|
16
18
|
export type DragAndDropClearDropTargetAction = DragAndDropAction<typeof DragAndDropActionType.CLEAR_DROP_TARGET, {
|
|
17
19
|
decorationSet: DecorationSet;
|
|
18
20
|
}>;
|
|
19
|
-
export type
|
|
21
|
+
export type DragAndDropToggleDragMenuAction = DragAndDropAction<typeof DragAndDropActionType.TOGGLE_DRAG_MENU, {
|
|
22
|
+
isDragMenuOpen: boolean;
|
|
23
|
+
direction: TableDirection;
|
|
24
|
+
index: number;
|
|
25
|
+
}>;
|
|
26
|
+
export type DragAndDropPluginAction = DragAndDropSetDropTargetAction | DragAndDropClearDropTargetAction | DragAndDropToggleDragMenuAction;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import type { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import type { DraggableType } from '../../types';
|
|
4
|
+
import type { DraggableType, TableDirection } from '../../types';
|
|
5
5
|
import { TableDecorations } from '../../types';
|
|
6
6
|
import { DropTargetType } from './consts';
|
|
7
7
|
export declare const getDecorations: (state: EditorState) => DecorationSet;
|
|
@@ -9,3 +9,4 @@ export declare const updatePluginStateDecorations: (state: EditorState, decorati
|
|
|
9
9
|
export declare const setDropTarget: (type: DropTargetType, index: number, tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
|
|
10
10
|
export declare const clearDropTarget: (tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
|
|
11
11
|
export declare const moveSource: (sourceType: DraggableType, sourceIndex: number, targetIndex: number) => import("@atlaskit/editor-common/types").Command;
|
|
12
|
+
export declare const toggleDragMenu: (isDragMenuOpen: boolean | undefined, direction?: TableDirection, index?: number) => import("@atlaskit/editor-common/types").Command;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
+
import type { TableDirection } from '../../types';
|
|
2
3
|
import type { DropTargetType } from './consts';
|
|
3
4
|
export interface DragAndDropPluginState {
|
|
4
5
|
decorationSet: DecorationSet;
|
|
5
6
|
dropTargetType: DropTargetType;
|
|
6
7
|
dropTargetIndex: number;
|
|
8
|
+
isDragMenuOpen: boolean;
|
|
9
|
+
dragMenuDirection?: TableDirection;
|
|
10
|
+
dragMenuIndex: number;
|
|
7
11
|
}
|
|
@@ -269,6 +269,9 @@ export declare const TableCssClassName: {
|
|
|
269
269
|
CONTROLS_INSERT_LINE: string;
|
|
270
270
|
CONTROLS_BUTTON_OVERLAY: string;
|
|
271
271
|
LAYOUT_BUTTON: string;
|
|
272
|
+
DRAG_CONTROLS_INSERT_BUTTON: string;
|
|
273
|
+
DRAG_CONTROLS_INSERT_BUTTON_INNER: string;
|
|
274
|
+
DRAG_CONTROLS_INSERT_BUTTON_WRAP: string;
|
|
272
275
|
CONTROLS_INSERT_MARKER: string;
|
|
273
276
|
CONTROLS_INSERT_COLUMN: string;
|
|
274
277
|
CONTROLS_INSERT_ROW: string;
|
|
@@ -281,8 +284,12 @@ export declare const TableCssClassName: {
|
|
|
281
284
|
CORNER_CONTROLS_INSERT_COLUMN_MARKER: string;
|
|
282
285
|
CONTROLS_CORNER_BUTTON: string;
|
|
283
286
|
/** Controls with drag handle */
|
|
284
|
-
|
|
285
|
-
|
|
287
|
+
DRAG_ROW_CONTROLS: string;
|
|
288
|
+
DRAG_ROW_FLOATING_INSERT_DOT_WRAPPER: string;
|
|
289
|
+
DRAG_ROW_FLOATING_INSERT_DOT: string;
|
|
290
|
+
DRAG_COLUMN_CONTROLS: string;
|
|
291
|
+
DRAG_COLUMN_FLOATING_INSERT_DOT_WRAPPER: string;
|
|
292
|
+
DRAG_COLUMN_FLOATING_INSERT_DOT: string;
|
|
286
293
|
DRAG_HANDLE_BUTTON_CONTAINER: string;
|
|
287
294
|
/** Other classes */
|
|
288
295
|
NUMBERED_COLUMN: string;
|
|
@@ -373,6 +380,7 @@ export type InvalidNodeAttr = {
|
|
|
373
380
|
spanValue: number;
|
|
374
381
|
tableLocalId: string;
|
|
375
382
|
};
|
|
383
|
+
export type TableDirection = 'row' | 'column';
|
|
376
384
|
/**
|
|
377
385
|
* Drag and Drop interfaces
|
|
378
386
|
*/
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import type { MouseEventHandler } from 'react';
|
|
2
|
+
import type { TableDirection } from '../../types';
|
|
2
3
|
type DragHandleAppearance = 'default' | 'selected' | 'disabled' | 'danger';
|
|
3
4
|
type DragHandleProps = {
|
|
4
5
|
tableLocalId: string;
|
|
5
6
|
indexes: number[];
|
|
6
7
|
previewWidth?: number;
|
|
7
8
|
previewHeight?: number;
|
|
8
|
-
direction?:
|
|
9
|
+
direction?: TableDirection;
|
|
9
10
|
appearance?: DragHandleAppearance;
|
|
10
11
|
onClick?: MouseEventHandler;
|
|
11
12
|
onMouseOver?: MouseEventHandler;
|
|
12
13
|
onMouseOut?: MouseEventHandler;
|
|
14
|
+
onMouseUp?: MouseEventHandler;
|
|
13
15
|
};
|
|
14
|
-
export declare const DragHandle: ({ tableLocalId, direction, appearance, indexes, previewWidth, previewHeight, onMouseOver, onMouseOut, onClick, }: DragHandleProps) => JSX.Element;
|
|
16
|
+
export declare const DragHandle: ({ tableLocalId, direction, appearance, indexes, previewWidth, previewHeight, onMouseOver, onMouseOut, onMouseUp, onClick, }: DragHandleProps) => JSX.Element;
|
|
15
17
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import type { TableDirection } from '../../types';
|
|
2
3
|
export declare const DragPreview: ({ direction, width, height, }: {
|
|
3
|
-
direction:
|
|
4
|
+
direction: TableDirection;
|
|
4
5
|
width: number;
|
|
5
6
|
height: number;
|
|
6
7
|
}) => JSX.Element;
|
|
@@ -3,6 +3,7 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
|
3
3
|
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { RowStickyState } from '../../pm-plugins/sticky-headers';
|
|
6
|
+
import type { TableDirection } from '../../types';
|
|
6
7
|
import type { CellSelectionType } from './types';
|
|
7
8
|
export interface Props {
|
|
8
9
|
editorView: EditorView;
|
|
@@ -23,7 +24,7 @@ export interface State {
|
|
|
23
24
|
position?: string;
|
|
24
25
|
scrollLeft: number;
|
|
25
26
|
}
|
|
26
|
-
export declare function getSelectionType(selection: Selection):
|
|
27
|
+
export declare function getSelectionType(selection: Selection): TableDirection | undefined;
|
|
27
28
|
declare class FloatingDeleteButton extends Component<Props, State> {
|
|
28
29
|
static displayName: string;
|
|
29
30
|
wrapper: HTMLElement | null;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import type { TableDirection } from '../../types';
|
|
2
|
+
export type CellSelectionType = TableDirection | undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import type { PluginConfig, TableDirection } from '../../types';
|
|
5
|
+
type DragMenuProps = {
|
|
6
|
+
direction?: TableDirection;
|
|
7
|
+
index?: number;
|
|
8
|
+
tableRef?: HTMLTableElement;
|
|
9
|
+
tableNode?: PmNode;
|
|
10
|
+
editorView: EditorView;
|
|
11
|
+
isOpen?: boolean;
|
|
12
|
+
targetCellPosition?: number;
|
|
13
|
+
mountPoint?: HTMLElement;
|
|
14
|
+
boundariesElement?: HTMLElement;
|
|
15
|
+
scrollableElement?: HTMLElement;
|
|
16
|
+
pluginConfig?: PluginConfig;
|
|
17
|
+
};
|
|
18
|
+
export declare const DragMenu: ({ direction, index, isOpen, editorView, tableNode, mountPoint, boundariesElement, scrollableElement, }: DragMenuProps) => JSX.Element | null;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import type { TableDirection } from '../../types';
|
|
5
|
+
export interface Props {
|
|
6
|
+
editorView: EditorView;
|
|
7
|
+
isOpen: boolean;
|
|
8
|
+
tableRef?: HTMLTableElement;
|
|
9
|
+
tableNode?: PmNode;
|
|
10
|
+
mountPoint?: HTMLElement;
|
|
11
|
+
boundariesElement?: HTMLElement;
|
|
12
|
+
scrollableElement?: HTMLElement;
|
|
13
|
+
direction?: TableDirection;
|
|
14
|
+
index?: number;
|
|
15
|
+
targetCellPosition?: number;
|
|
16
|
+
}
|
|
17
|
+
declare const FloatingDragMenu: {
|
|
18
|
+
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, tableRef, tableNode, direction, index, targetCellPosition, }: Props): JSX.Element | null;
|
|
19
|
+
displayName: string;
|
|
20
|
+
};
|
|
21
|
+
export default FloatingDragMenu;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import type { SyntheticEvent } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
+
import type { TableDirection } from '../../types';
|
|
4
5
|
export interface ButtonProps {
|
|
5
|
-
type:
|
|
6
|
+
type: TableDirection;
|
|
6
7
|
tableRef: HTMLElement;
|
|
7
8
|
onMouseDown: (event: SyntheticEvent<HTMLButtonElement>) => void;
|
|
8
9
|
hasStickyHeaders: boolean;
|
|
9
10
|
}
|
|
11
|
+
export declare const InsertButtonForDragAndDrop: ({ onMouseDown, tableRef, type, intl: { formatMessage }, hasStickyHeaders, }: ButtonProps & WrappedComponentProps) => JSX.Element;
|
|
12
|
+
export declare const DragAndDropInsertButton: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps<"intl">>> & {
|
|
13
|
+
WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps<"intl">>;
|
|
14
|
+
};
|
|
10
15
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps<"intl">>> & {
|
|
11
16
|
WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps<"intl">>;
|
|
12
17
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { PopupProps } from '@atlaskit/editor-common/ui';
|
|
2
|
-
|
|
2
|
+
import type { TableDirection } from '../../types';
|
|
3
|
+
declare function getPopupOptions(direction: TableDirection, index: number, hasNumberedColumns: boolean, isDragAndDropEnabled: boolean, tableContainer: HTMLElement | null): Partial<PopupProps>;
|
|
3
4
|
export default getPopupOptions;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
import type { DispatchAnalyticsEvent, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
5
4
|
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
6
|
-
import { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
7
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
+
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
7
|
export interface Props {
|
|
9
8
|
editorView: EditorView;
|
|
10
9
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
@@ -14,6 +13,7 @@ export interface Props {
|
|
|
14
13
|
insertRowButtonIndex?: number;
|
|
15
14
|
isHeaderColumnEnabled?: boolean;
|
|
16
15
|
isHeaderRowEnabled?: boolean;
|
|
16
|
+
isDragAndDropEnabled?: boolean;
|
|
17
17
|
mountPoint?: HTMLElement;
|
|
18
18
|
boundariesElement?: HTMLElement;
|
|
19
19
|
scrollableElement?: HTMLElement;
|
package/dist/types-ts4.5/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export interface ColumnControlsProps {
|
|
|
12
12
|
localId?: string;
|
|
13
13
|
rowHeights?: number[];
|
|
14
14
|
colWidths?: (number | undefined)[];
|
|
15
|
+
hasHeaderColumn?: boolean;
|
|
15
16
|
}
|
|
16
|
-
export declare const ColumnControls: ({ editorView, tableActive, tableRef, hoveredCell, isResizing, stickyTop, localId, isInDanger, rowHeights, colWidths, }: ColumnControlsProps) => JSX.Element;
|
|
17
|
+
export declare const ColumnControls: ({ editorView, tableActive, tableRef, hoveredCell, isResizing, stickyTop, localId, isInDanger, rowHeights, colWidths, hasHeaderColumn, }: ColumnControlsProps) => JSX.Element;
|
|
17
18
|
export default ColumnControls;
|
package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/RowControls/DragControls.d.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
5
|
import type { CellHoverMeta } from '../../../types';
|
|
5
6
|
type DragControlsProps = {
|
|
6
7
|
editorView: EditorView;
|
|
7
8
|
tableRef: HTMLTableElement;
|
|
9
|
+
tableNode?: PmNode;
|
|
8
10
|
tableActive?: boolean;
|
|
9
11
|
hoveredCell?: CellHoverMeta;
|
|
10
12
|
isInDanger?: boolean;
|
|
13
|
+
isResizing?: boolean;
|
|
14
|
+
hasHeaderRow?: boolean;
|
|
11
15
|
hoverRows: (rows: number[], danger?: boolean) => void;
|
|
12
16
|
selectRow: (row: number, expand: boolean) => void;
|
|
13
17
|
updateCellHoverLocation: (rowIndex: number) => void;
|