@atlaskit/editor-plugin-table 12.1.14 → 12.2.0
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 +25 -0
- package/afm-cc/tsconfig.json +6 -0
- package/afm-dev-agents/tsconfig.json +6 -0
- package/afm-jira/tsconfig.json +6 -0
- package/afm-passionfruit/tsconfig.json +120 -0
- package/afm-post-office/tsconfig.json +6 -0
- package/afm-rovo-extension/tsconfig.json +6 -0
- package/afm-townsquare/tsconfig.json +6 -0
- package/afm-volt/tsconfig.json +13 -4
- package/dist/cjs/nodeviews/TableComponent.js +77 -26
- package/dist/cjs/nodeviews/TableContainer.js +270 -10
- package/dist/cjs/nodeviews/TableResizer.js +9 -2
- package/dist/cjs/nodeviews/TableRow.js +24 -1
- package/dist/cjs/nodeviews/table-node-views.js +1 -1
- package/dist/cjs/nodeviews/table.js +22 -7
- package/dist/cjs/nodeviews/toDOM.js +23 -7
- package/dist/cjs/pm-plugins/main.js +57 -22
- package/dist/cjs/pm-plugins/table-resizing/utils/colgroup.js +72 -1
- package/dist/cjs/pm-plugins/table-resizing/utils/misc.js +70 -1
- package/dist/cjs/tablePlugin.js +17 -3
- package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +2 -7
- package/dist/es2019/nodeviews/TableComponent.js +80 -26
- package/dist/es2019/nodeviews/TableContainer.js +256 -2
- package/dist/es2019/nodeviews/TableResizer.js +9 -2
- package/dist/es2019/nodeviews/TableRow.js +24 -1
- package/dist/es2019/nodeviews/table-node-views.js +1 -1
- package/dist/es2019/nodeviews/table.js +21 -6
- package/dist/es2019/nodeviews/toDOM.js +24 -8
- package/dist/es2019/pm-plugins/main.js +57 -22
- package/dist/es2019/pm-plugins/table-resizing/utils/colgroup.js +72 -3
- package/dist/es2019/pm-plugins/table-resizing/utils/misc.js +70 -1
- package/dist/es2019/tablePlugin.js +17 -3
- package/dist/es2019/ui/TableFloatingControls/NumberColumn/index.js +5 -14
- package/dist/esm/nodeviews/TableComponent.js +77 -26
- package/dist/esm/nodeviews/TableContainer.js +270 -10
- package/dist/esm/nodeviews/TableResizer.js +9 -2
- package/dist/esm/nodeviews/TableRow.js +24 -1
- package/dist/esm/nodeviews/table-node-views.js +1 -1
- package/dist/esm/nodeviews/table.js +22 -7
- package/dist/esm/nodeviews/toDOM.js +24 -8
- package/dist/esm/pm-plugins/main.js +57 -22
- package/dist/esm/pm-plugins/table-resizing/utils/colgroup.js +74 -3
- package/dist/esm/pm-plugins/table-resizing/utils/misc.js +70 -1
- package/dist/esm/tablePlugin.js +17 -3
- package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +1 -6
- package/dist/types/nodeviews/ExternalDropTargets.d.ts +1 -1
- package/dist/types/nodeviews/TableComponent.d.ts +1 -0
- package/dist/types/nodeviews/TableContainer.d.ts +7 -2
- package/dist/types/nodeviews/TableResizer.d.ts +1 -1
- package/dist/types/nodeviews/TableRow.d.ts +3 -1
- package/dist/types/nodeviews/table.d.ts +1 -1
- package/dist/types/nodeviews/toDOM.d.ts +5 -0
- package/dist/types/nodeviews/types.d.ts +1 -0
- package/dist/types/pm-plugins/analytics/commands.d.ts +2 -2
- package/dist/types/pm-plugins/analytics/plugin-factory.d.ts +1 -1
- package/dist/types/pm-plugins/analytics/utils/moved-event.d.ts +1 -1
- package/dist/types/pm-plugins/commands/column-resize.d.ts +10 -10
- package/dist/types/pm-plugins/commands/commands-with-analytics.d.ts +1 -1
- package/dist/types/pm-plugins/commands/go-to-next-cell.d.ts +1 -1
- package/dist/types/pm-plugins/commands/misc.d.ts +2 -2
- package/dist/types/pm-plugins/commands/selection.d.ts +6 -6
- package/dist/types/pm-plugins/drag-and-drop/commands-with-analytics.d.ts +3 -3
- package/dist/types/pm-plugins/drag-and-drop/commands.d.ts +1 -1
- package/dist/types/pm-plugins/drag-and-drop/plugin-factory.d.ts +1 -1
- package/dist/types/pm-plugins/plugin-factory.d.ts +1 -1
- package/dist/types/pm-plugins/sticky-headers/plugin-state.d.ts +1 -1
- package/dist/types/pm-plugins/table-resizing/plugin-factory.d.ts +1 -1
- package/dist/types/pm-plugins/table-resizing/utils/colgroup.d.ts +1 -0
- package/dist/types/pm-plugins/table-resizing/utils/misc.d.ts +41 -0
- package/dist/types/pm-plugins/utils/create.d.ts +10 -10
- package/dist/types/pm-plugins/utils/decoration.d.ts +3 -3
- package/dist/types/pm-plugins/utils/dom.d.ts +2 -2
- package/dist/types/pm-plugins/utils/drag-menu.d.ts +3 -3
- package/dist/types/pm-plugins/utils/merged-cells.d.ts +3 -2
- package/dist/types/tablePluginType.d.ts +2 -0
- package/dist/types/ui/DragHandle/index.d.ts +4 -14
- package/dist/types/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +1 -7
- package/dist/types/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +4 -14
- package/dist/types/ui/TableFloatingControls/RowControls/DragControls.d.ts +1 -1
- package/dist/types/ui/TableFloatingControls/index.d.ts +1 -7
- package/dist/types/ui/global-styles.d.ts +2 -8
- package/dist/types/ui/hooks/useInternalTablePluginStateSelector.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/ExternalDropTargets.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/TableComponent.d.ts +1 -0
- package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +7 -2
- package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/TableRow.d.ts +3 -1
- package/dist/types-ts4.5/nodeviews/table.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/toDOM.d.ts +5 -0
- package/dist/types-ts4.5/nodeviews/types.d.ts +1 -0
- package/dist/types-ts4.5/pm-plugins/analytics/commands.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/analytics/plugin-factory.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/analytics/utils/moved-event.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/commands/column-resize.d.ts +10 -10
- package/dist/types-ts4.5/pm-plugins/commands/commands-with-analytics.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/commands/go-to-next-cell.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/commands/misc.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/commands/selection.d.ts +6 -6
- package/dist/types-ts4.5/pm-plugins/drag-and-drop/commands-with-analytics.d.ts +3 -3
- package/dist/types-ts4.5/pm-plugins/drag-and-drop/commands.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/drag-and-drop/plugin-factory.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/plugin-factory.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/sticky-headers/plugin-state.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/plugin-factory.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/colgroup.d.ts +1 -0
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/misc.d.ts +41 -0
- package/dist/types-ts4.5/pm-plugins/utils/create.d.ts +10 -10
- package/dist/types-ts4.5/pm-plugins/utils/decoration.d.ts +3 -3
- package/dist/types-ts4.5/pm-plugins/utils/dom.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/utils/drag-menu.d.ts +3 -3
- package/dist/types-ts4.5/pm-plugins/utils/merged-cells.d.ts +3 -2
- package/dist/types-ts4.5/tablePluginType.d.ts +2 -0
- package/dist/types-ts4.5/ui/DragHandle/index.d.ts +4 -14
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +1 -7
- package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +4 -14
- package/dist/types-ts4.5/ui/TableFloatingControls/RowControls/DragControls.d.ts +1 -1
- package/dist/types-ts4.5/ui/TableFloatingControls/index.d.ts +1 -7
- package/dist/types-ts4.5/ui/global-styles.d.ts +2 -8
- package/dist/types-ts4.5/ui/hooks/useInternalTablePluginStateSelector.d.ts +1 -1
- package/package.json +10 -11
- package/src/nodeviews/TableComponent.tsx +113 -23
- package/src/nodeviews/TableContainer.tsx +331 -2
- package/src/nodeviews/TableResizer.tsx +10 -5
- package/src/nodeviews/TableRow.ts +38 -1
- package/src/nodeviews/table-node-views.ts +1 -1
- package/src/nodeviews/table.tsx +23 -0
- package/src/nodeviews/toDOM.ts +75 -9
- package/src/nodeviews/types.ts +1 -0
- package/src/pm-plugins/main.ts +41 -18
- package/src/pm-plugins/table-resizing/utils/colgroup.ts +139 -6
- package/src/pm-plugins/table-resizing/utils/misc.ts +87 -0
- package/src/tablePlugin.tsx +21 -0
- package/src/tablePluginType.ts +2 -0
- package/src/ui/TableFloatingControls/NumberColumn/index.tsx +5 -14
- package/tsconfig.app.json +6 -0
- package/types/package.json +1 -1
- package/ui/common-styles/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("../types").TablePluginState | ((state: import("prosemirror-state").EditorState) => import("../types").TablePluginState)) => import("prosemirror-state").SafeStateField<import("../types").TablePluginState>, createCommand: <A = import("../types").TablePluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (
|
|
1
|
+
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("../types").TablePluginState | ((state: import("prosemirror-state").EditorState) => import("../types").TablePluginState)) => import("prosemirror-state").SafeStateField<import("../types").TablePluginState>, createCommand: <A = import("../types").TablePluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("../types").TablePluginState;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { StickyPluginAction, StickyPluginState } from './types';
|
|
2
|
-
declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: StickyPluginState | ((state: import("prosemirror-state").EditorState) => StickyPluginState)) => import("prosemirror-state").SafeStateField<StickyPluginState>, createCommand: <A = StickyPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (
|
|
2
|
+
declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: StickyPluginState | ((state: import("prosemirror-state").EditorState) => StickyPluginState)) => import("prosemirror-state").SafeStateField<StickyPluginState>, createCommand: <A = StickyPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) => import("@atlaskit/editor-common/types").Command;
|
|
3
3
|
export { createPluginState, createCommand };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ColumnResizingPluginState } from '../../types';
|
|
2
|
-
export declare const createCommand: <A = import("../../types").ColumnResizingPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (
|
|
2
|
+
export declare const createCommand: <A = import("../../types").ColumnResizingPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) => import("@atlaskit/editor-common/types").Command;
|
|
3
3
|
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: ColumnResizingPluginState | ((state: import("prosemirror-state").EditorState) => ColumnResizingPluginState)) => import("prosemirror-state").SafeStateField<ColumnResizingPluginState>;
|
|
4
4
|
export declare const getPluginState: (state: import("prosemirror-state").EditorState) => ColumnResizingPluginState;
|
|
@@ -9,6 +9,7 @@ type Col = Array<string | {
|
|
|
9
9
|
* overflow.
|
|
10
10
|
*/
|
|
11
11
|
export declare const getColWidthFix: (colwidth: number, tableColumnCount: number) => number;
|
|
12
|
+
export declare const generateColgroupFromNode: (table: PmNode, isCommentEditor?: boolean, isChromelessEditor?: boolean, isNested?: boolean, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Col[];
|
|
12
13
|
export declare const generateColgroup: (table: PmNode, tableRef?: HTMLElement, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => Col[];
|
|
13
14
|
export declare const insertColgroupFromNode: (tableRef: HTMLTableElement | null, table: PmNode, isTableScalingEnabled?: boolean, shouldRemove?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => HTMLCollection;
|
|
14
15
|
export declare const hasTableBeenResized: (table: PmNode) => boolean;
|
|
@@ -22,6 +22,47 @@ export declare const getTableMaxWidth: ({ table, tableStart, state, layout, getE
|
|
|
22
22
|
*/
|
|
23
23
|
export declare const getTableElementWidth: (table: PMNode) => number;
|
|
24
24
|
export declare const getTableContainerElementWidth: (table: PMNode) => number;
|
|
25
|
+
/**
|
|
26
|
+
* This function is used to set the max width for table resizer container.
|
|
27
|
+
* @param isCommentEditor Whether the editor is in comment mode.
|
|
28
|
+
* @param isChromelessEditor Whether the editor is chromeless.
|
|
29
|
+
* @param isTableScalingEnabled Whether table scaling is enabled.
|
|
30
|
+
* @returns The CSS max-width value
|
|
31
|
+
*/
|
|
32
|
+
export declare const getTableResizerContainerMaxWidthInCSS: (isCommentEditor?: boolean, isChromelessEditor?: boolean, isTableScalingEnabled?: boolean) => string;
|
|
33
|
+
/**
|
|
34
|
+
* This function is used in NodeView for TableResizer to set the max width for table resizer container
|
|
35
|
+
* @param node The ProseMirror node representing the table.
|
|
36
|
+
* @param isCommentEditor Whether the editor is in comment mode.
|
|
37
|
+
* @param isChromelessEditor Whether the editor is chromeless.
|
|
38
|
+
* @returns The CSS max-width value for the table resizer container.
|
|
39
|
+
*/
|
|
40
|
+
export declare const getTableResizerItemWidth: (node: PMNode, isCommentEditor?: boolean, isChromelessEditor?: boolean) => number | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* This function is used to set the CSS width value for the table resizer-item.
|
|
43
|
+
* Because comment and chromeless editors don't have container-type: inline-size set,
|
|
44
|
+
* we need to calculate the width based on the table node width.
|
|
45
|
+
* If the table node width is not set, it will return 'auto'.
|
|
46
|
+
* This is used in table toDOM
|
|
47
|
+
* @param node The ProseMirror node representing the table.
|
|
48
|
+
* @param isCommentEditor Whether the editor is in comment mode.
|
|
49
|
+
* @param isChromelessEditor Whether the editor is chromeless.
|
|
50
|
+
* @returns The CSS width value for the table container.
|
|
51
|
+
*/
|
|
52
|
+
export declare const getTableResizerItemWidthInCSS: (node: PMNode, isCommentEditor?: boolean, isChromelessEditor?: boolean) => string;
|
|
53
|
+
/**
|
|
54
|
+
* This function is used to set the table width --ak-editor-table-width CSS property for full page editor.
|
|
55
|
+
* Which is applied to the table resizer container.
|
|
56
|
+
* For Full page appearance, we don't need to use containerWidth from JS, as we can use cqw value.
|
|
57
|
+
* So we set dynamic containerWidth from JS to CSS property.
|
|
58
|
+
* @param node The ProseMirror node representing the table.
|
|
59
|
+
* @param isCommentEditor Whether the editor is in comment mode.
|
|
60
|
+
* @param isChromelessEditor Whether the editor is chromeless.
|
|
61
|
+
* @param isTableScalingEnabled Whether table scaling is enabled.
|
|
62
|
+
* @param tableWidthFromJS The width of the container element. In toDOM it'd be undefined, but will have a value from nodeView.
|
|
63
|
+
* @returns The CSS width value for the table.
|
|
64
|
+
*/
|
|
65
|
+
export declare const getTableResizerContainerForFullPageWidthInCSS: (node: PMNode, isTableScalingEnabled?: boolean) => string;
|
|
25
66
|
export declare const getTableScalingPercent: (table: PMNode, tableRef: HTMLElement | null, shouldUseIncreasedScalingPercent?: boolean) => number;
|
|
26
67
|
export declare const getScalingPercentForTableWithoutWidth: (table: PMNode, tableRef: HTMLElement | null) => number;
|
|
27
68
|
export declare const getStaticTableScalingPercent: (table: PMNode, tableRenderWidth: number, shouldUseIncreasedScalingPercent?: boolean) => number;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
export declare const createTableWithWidth: ({ isTableScalingEnabled, isTableAlignmentEnabled, isFullWidthModeEnabled, isCommentEditor, isChromelessEditor, isTableResizingEnabled, isNestedTable, createTableProps, }: {
|
|
3
|
-
isTableScalingEnabled?: boolean
|
|
4
|
-
isTableAlignmentEnabled?: boolean
|
|
5
|
-
isFullWidthModeEnabled?: boolean
|
|
6
|
-
isCommentEditor?: boolean
|
|
7
|
-
isChromelessEditor?: boolean
|
|
8
|
-
isTableResizingEnabled?: boolean
|
|
9
|
-
isNestedTable?: boolean
|
|
3
|
+
isTableScalingEnabled?: boolean;
|
|
4
|
+
isTableAlignmentEnabled?: boolean;
|
|
5
|
+
isFullWidthModeEnabled?: boolean;
|
|
6
|
+
isCommentEditor?: boolean;
|
|
7
|
+
isChromelessEditor?: boolean;
|
|
8
|
+
isTableResizingEnabled?: boolean;
|
|
9
|
+
isNestedTable?: boolean;
|
|
10
10
|
createTableProps?: {
|
|
11
|
-
rowsCount?: number
|
|
12
|
-
colsCount?: number
|
|
13
|
-
}
|
|
11
|
+
rowsCount?: number;
|
|
12
|
+
colsCount?: number;
|
|
13
|
+
};
|
|
14
14
|
}) => (schema: Schema) => import("prosemirror-model").Node;
|
|
@@ -9,11 +9,11 @@ import { TableDecorations } from '../../types';
|
|
|
9
9
|
export declare const findColumnControlSelectedDecoration: (decorationSet: DecorationSet) => Decoration[];
|
|
10
10
|
export declare const findControlsHoverDecoration: (decorationSet: DecorationSet) => Decoration[];
|
|
11
11
|
export declare const createCellHoverDecoration: (cells: Cell[]) => Decoration[];
|
|
12
|
-
export declare const createControlsHoverDecoration: (cells: Cell[], type:
|
|
12
|
+
export declare const createControlsHoverDecoration: (cells: Cell[], type: "row" | "column" | "table", tr: Transaction | ReadonlyTransaction, isDragAndDropEnable: boolean | undefined, hoveredIndexes: number[], danger?: boolean, selected?: boolean) => Decoration[];
|
|
13
13
|
export declare const createColumnSelectedDecoration: (tr: Transaction | ReadonlyTransaction) => Decoration[];
|
|
14
14
|
export declare const createColumnControlsDecoration: (selection: Selection) => Decoration[];
|
|
15
15
|
export declare const updateDecorations: (node: PmNode, decorationSet: DecorationSet, decorations: Decoration[], key: TableDecorations) => DecorationSet;
|
|
16
|
-
export declare const createResizeHandleDecoration: (tr: Transaction | ReadonlyTransaction, rowIndexTarget: number, columnEndIndexTarget: Omit<CellColumnPositioning,
|
|
17
|
-
export declare const createColumnLineResize: (selection: Selection, cellColumnPositioning: Omit<CellColumnPositioning,
|
|
16
|
+
export declare const createResizeHandleDecoration: (tr: Transaction | ReadonlyTransaction, rowIndexTarget: number, columnEndIndexTarget: Omit<CellColumnPositioning, "left">, includeTooltip: boolean | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI) => [Decoration[], Decoration[]];
|
|
17
|
+
export declare const createColumnLineResize: (selection: Selection, cellColumnPositioning: Omit<CellColumnPositioning, "left">, isDragAndDropEnabled?: boolean) => Decoration[];
|
|
18
18
|
export declare const createColumnInsertLine: (columnIndex: number, selection: Selection, hasMergedCells: boolean) => Decoration[];
|
|
19
19
|
export declare const createRowInsertLine: (rowIndex: number, selection: Selection, hasMergedCells: boolean) => Decoration[];
|
|
@@ -20,8 +20,8 @@ export declare const isDragCornerButton: (node: HTMLElement | null) => boolean;
|
|
|
20
20
|
* @param gapInPixels
|
|
21
21
|
* @returns
|
|
22
22
|
*/
|
|
23
|
-
export declare const getMousePositionHorizontalRelativeByElement: (mouseEvent: MouseEvent, offsetX: number, gapInPixels?: number) =>
|
|
24
|
-
export declare const getMousePositionVerticalRelativeByElement: (mouseEvent: MouseEvent) =>
|
|
23
|
+
export declare const getMousePositionHorizontalRelativeByElement: (mouseEvent: MouseEvent, offsetX: number, gapInPixels?: number) => "left" | "right" | null;
|
|
24
|
+
export declare const getMousePositionVerticalRelativeByElement: (mouseEvent: MouseEvent) => "top" | "bottom" | null;
|
|
25
25
|
export declare const hasResizeHandler: ({ columnEndIndexTarget, target, }: {
|
|
26
26
|
columnEndIndexTarget: number;
|
|
27
27
|
target: HTMLElement;
|
|
@@ -7,8 +7,8 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
7
7
|
import type { Rect, TableMap } from '@atlaskit/editor-tables/table-map';
|
|
8
8
|
import type { NewIconProps } from '@atlaskit/icon/types';
|
|
9
9
|
import type { DraggableData, DraggableType, PluginInjectionAPI, TableDirection } from '../../types';
|
|
10
|
-
export declare const getTargetIndex: (selectedIndexes: number[], direction: DraggableData[
|
|
11
|
-
export declare const canMove: (sourceType: DraggableType, direction: DraggableData[
|
|
10
|
+
export declare const getTargetIndex: (selectedIndexes: number[], direction: DraggableData["direction"]) => number;
|
|
11
|
+
export declare const canMove: (sourceType: DraggableType, direction: DraggableData["direction"], totalItemsOfSourceTypeCount: number, selection: Selection, selectionRect?: Rect) => boolean;
|
|
12
12
|
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';
|
|
13
13
|
export interface DragMenuConfig extends Omit<DropdownOptionT<Command>, 'icon'> {
|
|
14
14
|
id: DragMenuOptionIdType;
|
|
@@ -16,4 +16,4 @@ export interface DragMenuConfig extends Omit<DropdownOptionT<Command>, 'icon'> {
|
|
|
16
16
|
iconFallback?: React.ComponentType<React.PropsWithChildren<NewIconProps>>;
|
|
17
17
|
keymap?: string;
|
|
18
18
|
}
|
|
19
|
-
export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, hasMergedCellsInTable: boolean, editorView: EditorView, api: PluginInjectionAPI | undefined | null, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, ariaNotifyPlugin?: (
|
|
19
|
+
export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, hasMergedCellsInTable: boolean, editorView: EditorView, api: PluginInjectionAPI | undefined | null, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, ariaNotifyPlugin?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void, isCommentEditor?: boolean) => DragMenuConfig[];
|
|
@@ -3,7 +3,8 @@ import { TableMap } from '@atlaskit/editor-tables';
|
|
|
3
3
|
type MergeType = 'row' | 'column';
|
|
4
4
|
export declare const hasMergedCellsInBetween: (indexes: number[], type: MergeType) => (selection: Selection) => boolean;
|
|
5
5
|
export declare const hasMergedCellsWithColumnNextToColumnIndex: (colIndex: number, selection: Selection) => boolean;
|
|
6
|
-
export declare const hasMergedCellsWithRowNextToRowIndex: (rowIndex: number,
|
|
6
|
+
export declare const hasMergedCellsWithRowNextToRowIndex: (rowIndex: number, // logical row index in the table. It starts at 0 and goes up to tableMap.height - 1.
|
|
7
|
+
selection: Selection) => boolean;
|
|
7
8
|
export declare const hasMergedCellsInSelection: (indexes: number[], type: MergeType) => (selection: Selection) => boolean;
|
|
8
9
|
/**
|
|
9
10
|
* this check the selection has merged cells with previous/next col or row.
|
|
@@ -13,7 +14,7 @@ export declare const hasMergedCellsInSelection: (indexes: number[], type: MergeT
|
|
|
13
14
|
* @param direction - check selection is selected by row or column
|
|
14
15
|
* @returns boolean
|
|
15
16
|
*/
|
|
16
|
-
export declare const checkEdgeHasMergedCells: (indexes: number[], tableMap: TableMap, direction:
|
|
17
|
+
export declare const checkEdgeHasMergedCells: (indexes: number[], tableMap: TableMap, direction: "row" | "column") => boolean;
|
|
17
18
|
/**
|
|
18
19
|
* this function will find the duplicate position in the array(table map position array).
|
|
19
20
|
*
|
|
@@ -9,6 +9,7 @@ import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
|
|
|
9
9
|
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
10
10
|
import type { GuidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
11
11
|
import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
|
|
12
|
+
import type { LimitedModePlugin } from '@atlaskit/editor-plugin-limited-mode';
|
|
12
13
|
import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
13
14
|
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
14
15
|
import type { PluginConfig, TableSharedState } from './types';
|
|
@@ -42,6 +43,7 @@ export type TablePluginDependencies = [
|
|
|
42
43
|
ContentInsertionPlugin,
|
|
43
44
|
WidthPlugin,
|
|
44
45
|
SelectionPlugin,
|
|
46
|
+
OptionalPlugin<LimitedModePlugin>,
|
|
45
47
|
OptionalPlugin<GuidelinePlugin>,
|
|
46
48
|
OptionalPlugin<BatchAttributeUpdatesPlugin>,
|
|
47
49
|
OptionalPlugin<AccessibilityUtilsPlugin>,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { MouseEventHandler } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
6
|
import type { TriggerType } from '../../pm-plugins/drag-and-drop/types';
|
|
7
|
+
import type { TablePlugin } from '../../tablePluginType';
|
|
6
8
|
import type { CellHoverMeta, TableDirection } from '../../types';
|
|
7
9
|
export type DragHandleAppearance = 'default' | 'selected' | 'disabled' | 'danger' | 'placeholder';
|
|
8
10
|
type DragHandleProps = {
|
|
@@ -27,22 +29,10 @@ export declare const DragHandle: React.FC<import("react-intl-next").WithIntlProp
|
|
|
27
29
|
WrappedComponent: React.ComponentType<DragHandleProps & WrappedComponentProps>;
|
|
28
30
|
};
|
|
29
31
|
export declare const DragHandleWithSharedState: React.FC<import("react-intl-next").WithIntlProps<DragHandleProps & {
|
|
30
|
-
api?:
|
|
31
|
-
pluginConfiguration: import("../../tablePluginType").TablePluginOptions | undefined;
|
|
32
|
-
actions: import("../../tablePluginType").TablePluginActions;
|
|
33
|
-
sharedState?: import("../../types").TableSharedState | undefined;
|
|
34
|
-
commands: import("../../tablePluginType").TablePluginCommands;
|
|
35
|
-
dependencies: import("../../tablePluginType").TablePluginDependencies;
|
|
36
|
-
}> | undefined;
|
|
32
|
+
api?: ExtractInjectionAPI<TablePlugin>;
|
|
37
33
|
} & WrappedComponentProps>> & {
|
|
38
34
|
WrappedComponent: React.ComponentType<DragHandleProps & {
|
|
39
|
-
api?:
|
|
40
|
-
pluginConfiguration: import("../../tablePluginType").TablePluginOptions | undefined;
|
|
41
|
-
actions: import("../../tablePluginType").TablePluginActions;
|
|
42
|
-
sharedState?: import("../../types").TableSharedState | undefined;
|
|
43
|
-
commands: import("../../tablePluginType").TablePluginCommands;
|
|
44
|
-
dependencies: import("../../tablePluginType").TablePluginDependencies;
|
|
45
|
-
}> | undefined;
|
|
35
|
+
api?: ExtractInjectionAPI<TablePlugin>;
|
|
46
36
|
} & WrappedComponentProps>;
|
|
47
37
|
};
|
|
48
38
|
export {};
|
|
@@ -21,12 +21,6 @@ interface ColumnControlsProps {
|
|
|
21
21
|
getScrollOffset?: () => number;
|
|
22
22
|
}
|
|
23
23
|
export declare const ColumnControls: ({ editorView, tableActive, tableRef, hoveredCell, stickyTop, localId, isInDanger, rowHeights, colWidths, isTableHovered, tableContainerWidth, isNumberColumnEnabled, isDragging, getScrollOffset, api, }: ColumnControlsProps & {
|
|
24
|
-
api?:
|
|
25
|
-
pluginConfiguration: import("../../../tablePluginType").TablePluginOptions | undefined;
|
|
26
|
-
actions: import("../../../tablePluginType").TablePluginActions;
|
|
27
|
-
sharedState?: import("../../../types").TableSharedState | undefined;
|
|
28
|
-
commands: import("../../../tablePluginType").TablePluginCommands;
|
|
29
|
-
dependencies: import("../../../tablePluginType").TablePluginDependencies;
|
|
30
|
-
}> | undefined;
|
|
24
|
+
api?: ExtractInjectionAPI<TablePlugin>;
|
|
31
25
|
}) => React.JSX.Element;
|
|
32
26
|
export {};
|
|
@@ -1,23 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { TablePlugin } from '../../../tablePluginType';
|
|
3
5
|
import type { CornerControlProps } from './types';
|
|
4
6
|
export declare const DragCornerControlsWithSelection: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps & {
|
|
5
|
-
api?:
|
|
6
|
-
pluginConfiguration: import("../../../tablePluginType").TablePluginOptions | undefined;
|
|
7
|
-
actions: import("../../../tablePluginType").TablePluginActions;
|
|
8
|
-
sharedState?: import("../../../types").TableSharedState | undefined;
|
|
9
|
-
commands: import("../../../tablePluginType").TablePluginCommands;
|
|
10
|
-
dependencies: import("../../../tablePluginType").TablePluginDependencies;
|
|
11
|
-
}> | undefined;
|
|
7
|
+
api?: ExtractInjectionAPI<TablePlugin>;
|
|
12
8
|
}>> & {
|
|
13
9
|
WrappedComponent: React.ComponentType<CornerControlProps & WrappedComponentProps & {
|
|
14
|
-
api?:
|
|
15
|
-
pluginConfiguration: import("../../../tablePluginType").TablePluginOptions | undefined;
|
|
16
|
-
actions: import("../../../tablePluginType").TablePluginActions;
|
|
17
|
-
sharedState?: import("../../../types").TableSharedState | undefined;
|
|
18
|
-
commands: import("../../../tablePluginType").TablePluginCommands;
|
|
19
|
-
dependencies: import("../../../tablePluginType").TablePluginDependencies;
|
|
20
|
-
}> | undefined;
|
|
10
|
+
api?: ExtractInjectionAPI<TablePlugin>;
|
|
21
11
|
}>;
|
|
22
12
|
};
|
|
23
13
|
export declare const DragCornerControls: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps>> & {
|
|
@@ -23,5 +23,5 @@ type DragControlsProps = {
|
|
|
23
23
|
selection?: Selection;
|
|
24
24
|
};
|
|
25
25
|
export declare const DragControls: ({ tableRef, tableNode, tableWidth, hoveredCell, tableActive, editorView, isInDanger, isResizing, isTableHovered, hoverRows, selectRow, selectRows, updateCellHoverLocation, api, selection, }: DragControlsProps) => React.JSX.Element | null;
|
|
26
|
-
export declare const DragControlsWithSelection: ({ editorView, tableRef, tableNode, tableWidth, tableActive, hoveredCell, isInDanger, isTableHovered, isResizing, hoverRows, selectRow, selectRows, updateCellHoverLocation, api, }: Exclude<DragControlsProps,
|
|
26
|
+
export declare const DragControlsWithSelection: ({ editorView, tableRef, tableNode, tableWidth, tableActive, hoveredCell, isInDanger, isTableHovered, isResizing, hoverRows, selectRow, selectRows, updateCellHoverLocation, api, }: Exclude<DragControlsProps, "selection">) => React.JSX.Element;
|
|
27
27
|
export {};
|
|
@@ -31,12 +31,6 @@ interface TableFloatingControlsProps {
|
|
|
31
31
|
isChromelessEditor?: boolean;
|
|
32
32
|
}
|
|
33
33
|
export declare const TableFloatingControls: ({ editorView, tableRef, tableNode, isInDanger, isResizing, isNumberColumnEnabled, isHeaderRowEnabled, isHeaderColumnEnabled, tableActive, hasHeaderRow, hoveredRows, stickyHeader, isDragAndDropEnabled, hoveredCell, isTableHovered, tableWrapperWidth, api, isChromelessEditor, }: TableFloatingControlsProps & {
|
|
34
|
-
api?:
|
|
35
|
-
pluginConfiguration: import("../../tablePluginType").TablePluginOptions | undefined;
|
|
36
|
-
actions: import("../../tablePluginType").TablePluginActions;
|
|
37
|
-
sharedState?: import("../../types").TableSharedState | undefined;
|
|
38
|
-
commands: import("../../tablePluginType").TablePluginCommands;
|
|
39
|
-
dependencies: import("../../tablePluginType").TablePluginDependencies;
|
|
40
|
-
}> | undefined;
|
|
34
|
+
api?: ExtractInjectionAPI<TablePlugin>;
|
|
41
35
|
}) => React.JSX.Element | null;
|
|
42
36
|
export default TableFloatingControls;
|
|
@@ -7,12 +7,6 @@ import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
|
7
7
|
import type { PluginInjectionAPI } from '../types';
|
|
8
8
|
export declare const GlobalStylesWrapper: ({ featureFlags, isDragAndDropEnabledOption, api, }: {
|
|
9
9
|
featureFlags: FeatureFlags | undefined;
|
|
10
|
-
isDragAndDropEnabledOption?: boolean
|
|
11
|
-
api?:
|
|
12
|
-
pluginConfiguration: import("..").TablePluginOptions | undefined;
|
|
13
|
-
actions: import("..").TablePluginActions;
|
|
14
|
-
sharedState?: import("../types").TableSharedState | undefined;
|
|
15
|
-
commands: import("..").TablePluginCommands;
|
|
16
|
-
dependencies: import("..").TablePluginDependencies;
|
|
17
|
-
}> | undefined;
|
|
10
|
+
isDragAndDropEnabledOption?: boolean;
|
|
11
|
+
api?: PluginInjectionAPI;
|
|
18
12
|
}) => jsx.JSX.Element;
|
|
@@ -18,5 +18,5 @@ type Options = {
|
|
|
18
18
|
* @returns
|
|
19
19
|
* @example
|
|
20
20
|
*/
|
|
21
|
-
export declare const useInternalTablePluginStateSelector: <K extends
|
|
21
|
+
export declare const useInternalTablePluginStateSelector: <K extends keyof TableSharedStateInternal>(api: ExtractInjectionAPI<TablePlugin> | undefined, key: K, options?: Options) => TableSharedStateInternal[K] | undefined;
|
|
22
22
|
export {};
|
|
@@ -3,7 +3,7 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
export declare const ExternalDropTargets: ({ editorView, node, getScrollOffset, getTableWrapperWidth, }: {
|
|
5
5
|
editorView: EditorView;
|
|
6
|
-
node?: PMNode
|
|
6
|
+
node?: PMNode;
|
|
7
7
|
getScrollOffset: () => number;
|
|
8
8
|
getTableWrapperWidth: () => number;
|
|
9
9
|
}) => React.JSX.Element | null;
|
|
@@ -39,6 +39,7 @@ interface ComponentProps {
|
|
|
39
39
|
isTableHovered?: boolean;
|
|
40
40
|
isWholeTableInDanger?: boolean;
|
|
41
41
|
selection?: Selection;
|
|
42
|
+
limitedMode?: boolean;
|
|
42
43
|
}
|
|
43
44
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<ComponentProps>> & {
|
|
44
45
|
WrappedComponent: React.ComponentType<ComponentProps>;
|
|
@@ -13,6 +13,7 @@ type ResizableTableContainerProps = {
|
|
|
13
13
|
getPos: () => number | undefined;
|
|
14
14
|
tableRef: HTMLTableElement;
|
|
15
15
|
isResizing?: boolean;
|
|
16
|
+
isWindowResized?: boolean;
|
|
16
17
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
17
18
|
tableWrapperHeight?: number;
|
|
18
19
|
isWholeTableInDanger?: boolean;
|
|
@@ -21,8 +22,11 @@ type ResizableTableContainerProps = {
|
|
|
21
22
|
isTableAlignmentEnabled?: boolean;
|
|
22
23
|
shouldUseIncreasedScalingPercent?: boolean;
|
|
23
24
|
isCommentEditor?: boolean;
|
|
25
|
+
isChromelessEditor?: boolean;
|
|
24
26
|
};
|
|
25
|
-
export declare const ResizableTableContainer: React.
|
|
27
|
+
export declare const ResizableTableContainer: React.FC<ResizableTableContainerProps & {
|
|
28
|
+
children?: React.ReactNode | undefined;
|
|
29
|
+
}>;
|
|
26
30
|
type TableContainerProps = {
|
|
27
31
|
node: PMNode;
|
|
28
32
|
className: string;
|
|
@@ -32,6 +36,7 @@ type TableContainerProps = {
|
|
|
32
36
|
tableRef: HTMLTableElement;
|
|
33
37
|
isNested: boolean;
|
|
34
38
|
isResizing?: boolean;
|
|
39
|
+
isWindowResized?: boolean;
|
|
35
40
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
36
41
|
tableWrapperHeight?: number;
|
|
37
42
|
isWholeTableInDanger?: boolean;
|
|
@@ -43,5 +48,5 @@ type TableContainerProps = {
|
|
|
43
48
|
isCommentEditor?: boolean;
|
|
44
49
|
isChromelessEditor?: boolean;
|
|
45
50
|
};
|
|
46
|
-
export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, }: PropsWithChildren<TableContainerProps>) => React.JSX.Element;
|
|
51
|
+
export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, isWindowResized, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, }: PropsWithChildren<TableContainerProps>) => React.JSX.Element;
|
|
47
52
|
export {};
|
|
@@ -8,7 +8,7 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
8
8
|
import type { PluginInjectionAPI } from '../types';
|
|
9
9
|
interface TableResizerProps {
|
|
10
10
|
width: number;
|
|
11
|
-
maxWidth: number;
|
|
11
|
+
maxWidth: number | string;
|
|
12
12
|
containerWidth: number;
|
|
13
13
|
lineLength: number;
|
|
14
14
|
updateWidth: (width: number) => void;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
2
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import { type PluginInjectionAPI } from '../types';
|
|
4
5
|
import TableNodeView from './TableNodeViewBase';
|
|
5
6
|
export default class TableRow extends TableNodeView<HTMLTableRowElement> implements NodeView {
|
|
6
7
|
private nodeVisibilityObserverCleanupFn?;
|
|
7
|
-
|
|
8
|
+
cleanup: () => void;
|
|
9
|
+
constructor(node: PMNode, view: EditorView, getPos: () => number | undefined, eventDispatcher: EventDispatcher, api?: PluginInjectionAPI);
|
|
8
10
|
subscribeWhenRowVisible(): void;
|
|
9
11
|
/**
|
|
10
12
|
* Variables
|
|
@@ -20,7 +20,7 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
20
20
|
constructor(props: Props);
|
|
21
21
|
getContentDOM(): {
|
|
22
22
|
dom: HTMLElement;
|
|
23
|
-
contentDOM?: HTMLElement
|
|
23
|
+
contentDOM?: HTMLElement;
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
26
26
|
* Handles moving the table from ProseMirror's DOM structure into a React-rendered table node.
|
|
@@ -5,6 +5,11 @@ type Config = {
|
|
|
5
5
|
tableResizingEnabled: boolean;
|
|
6
6
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
7
7
|
isNestingSupported?: boolean;
|
|
8
|
+
isTableScalingEnabled?: boolean;
|
|
9
|
+
shouldUseIncreasedScalingPercent?: boolean;
|
|
10
|
+
isCommentEditor?: boolean;
|
|
11
|
+
isChromelessEditor?: boolean;
|
|
12
|
+
isNested?: boolean;
|
|
8
13
|
};
|
|
9
14
|
export declare const tableNodeSpecWithFixedToDOM: (config: Config) => NodeSpec & {
|
|
10
15
|
toDOM: (node: PMNode) => DOMOutputSpec;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import type { ActionType, RowOrColumnMovedState } from './types';
|
|
3
|
-
export declare const updateRowOrColumnMoved: (nextState: Omit<RowOrColumnMovedState,
|
|
3
|
+
export declare const updateRowOrColumnMoved: (nextState: Omit<RowOrColumnMovedState, "currentActions">, nextAction: ActionType) => import("@atlaskit/editor-common/types").Command;
|
|
4
4
|
export declare const resetRowOrColumnMovedTransform: () => (tr: Transaction) => Transaction;
|
|
5
|
-
export declare const updateRowOrColumnMovedTransform: (nextState: Omit<RowOrColumnMovedState,
|
|
5
|
+
export declare const updateRowOrColumnMovedTransform: (nextState: Omit<RowOrColumnMovedState, "currentActions">, nextAction: ActionType) => (state: EditorState, tr: Transaction) => Transaction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("./types").AnalyticPluginState | ((state: import("prosemirror-state").EditorState) => import("./types").AnalyticPluginState)) => import("prosemirror-state").SafeStateField<import("./types").AnalyticPluginState>, createCommand: <A = import("./actions").AnalyticPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (
|
|
1
|
+
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("./types").AnalyticPluginState | ((state: import("prosemirror-state").EditorState) => import("./types").AnalyticPluginState)) => import("prosemirror-state").SafeStateField<import("./types").AnalyticPluginState>, createCommand: <A = import("./actions").AnalyticPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("./types").AnalyticPluginState;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ActionType, RowOrColumnMovedState } from '../types';
|
|
2
|
-
export declare const getMovedPayload: (nextState: Omit<RowOrColumnMovedState,
|
|
2
|
+
export declare const getMovedPayload: (nextState: Omit<RowOrColumnMovedState, "currentActions">, nextAction: ActionType, prevState: RowOrColumnMovedState) => RowOrColumnMovedState | {
|
|
3
3
|
currentActions: string[];
|
|
4
4
|
numberOfCells: number | undefined;
|
|
5
5
|
type: "row" | "column" | undefined;
|
|
@@ -6,14 +6,14 @@ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
|
6
6
|
import type { Direction } from '@atlaskit/editor-tables/types';
|
|
7
7
|
import type { PluginInjectionAPI } from '../../types';
|
|
8
8
|
export declare const initiateKeyboardColumnResizing: ({ ariaNotify, getIntl, nodeViewPortalProviderAPI, }: {
|
|
9
|
-
ariaNotify?: (
|
|
10
|
-
getIntl?: (
|
|
9
|
+
ariaNotify?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void;
|
|
10
|
+
getIntl?: () => IntlShape;
|
|
11
11
|
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
12
12
|
}) => Command;
|
|
13
13
|
export declare const activateNextResizeArea: ({ direction, ariaNotify, getIntl, nodeViewPortalProviderAPI, }: {
|
|
14
14
|
direction: Direction;
|
|
15
|
-
ariaNotify?: (
|
|
16
|
-
getIntl?: (
|
|
15
|
+
ariaNotify?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void;
|
|
16
|
+
getIntl?: () => IntlShape;
|
|
17
17
|
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
18
18
|
}) => Command;
|
|
19
19
|
export declare const changeColumnWidthByStep: ({ stepSize, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, isCommentEditor, ariaNotify, api, getIntl, }: {
|
|
@@ -23,12 +23,12 @@ export declare const changeColumnWidthByStep: ({ stepSize, getEditorContainerWid
|
|
|
23
23
|
isTableFixedColumnWidthsOptionEnabled: boolean;
|
|
24
24
|
isCommentEditor: boolean;
|
|
25
25
|
api: PluginInjectionAPI | undefined | null;
|
|
26
|
-
ariaNotify?: (
|
|
27
|
-
getIntl?: (
|
|
28
|
-
originalTr?: Transaction
|
|
26
|
+
ariaNotify?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void;
|
|
27
|
+
getIntl?: () => IntlShape;
|
|
28
|
+
originalTr?: Transaction;
|
|
29
29
|
}) => Command;
|
|
30
30
|
export declare const stopKeyboardColumnResizing: ({ ariaNotify, getIntl, originalTr, }: {
|
|
31
|
-
ariaNotify?: (
|
|
32
|
-
getIntl?: (
|
|
33
|
-
originalTr?: Transaction
|
|
31
|
+
ariaNotify?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void;
|
|
32
|
+
getIntl?: () => IntlShape;
|
|
33
|
+
originalTr?: Transaction;
|
|
34
34
|
}) => Command;
|
|
@@ -15,7 +15,7 @@ export declare const splitCellWithAnalytics: (editorAnalyticsAPI: EditorAnalytic
|
|
|
15
15
|
export declare const setColorWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, cellColor: string, editorView?: EditorView | null) => Command;
|
|
16
16
|
export declare const addRowAroundSelection: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (side: RowInsertPosition) => Command;
|
|
17
17
|
export declare const insertRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: InsertRowMethods, options: InsertRowOptions) => Command;
|
|
18
|
-
export declare const changeColumnWidthByStepWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, api: PluginInjectionAPI | undefined | null) => (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled: boolean, isTableFixedColumnWidthsOptionEnabled: boolean, isCommentEditor: boolean, inputMethod: INPUT_METHOD.SHORTCUT, ariaNotify?: (
|
|
18
|
+
export declare const changeColumnWidthByStepWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, api: PluginInjectionAPI | undefined | null) => (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled: boolean, isTableFixedColumnWidthsOptionEnabled: boolean, isCommentEditor: boolean, inputMethod: INPUT_METHOD.SHORTCUT, ariaNotify?: (message: string) => void, getIntl?: () => IntlShape) => Command;
|
|
19
19
|
export declare const insertColumnWithAnalytics: (api: PluginInjectionAPI | undefined | null, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, position: number) => Command;
|
|
20
20
|
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;
|
|
21
21
|
export declare const deleteColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TABLE_CONTEXT_MENU, rect: Rect) => Command;
|
|
@@ -2,7 +2,7 @@ import type { IntlShape } from 'react-intl-next/src/types';
|
|
|
2
2
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import type { Command } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { Direction } from '@atlaskit/editor-tables/types';
|
|
5
|
-
export declare const goToNextCell: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, ariaNotify?: (
|
|
5
|
+
export declare const goToNextCell: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, ariaNotify?: (message: string) => void, getIntl?: () => IntlShape) => (direction: Direction) => Command;
|
|
6
6
|
/**
|
|
7
7
|
* Moves the cursor vertically from a NodeSelection within a table cell.
|
|
8
8
|
* - If content exists above/below within the cell, lets ProseMirror handle it.
|
|
@@ -13,10 +13,10 @@ export declare const triggerUnlessTableHeader: (command: Command) => Command;
|
|
|
13
13
|
export declare const transformSliceRemoveCellBackgroundColor: (slice: Slice, schema: Schema) => Slice;
|
|
14
14
|
export declare const transformSliceToAddTableHeaders: (slice: Slice, schema: Schema) => Slice;
|
|
15
15
|
export declare const transformSliceToRemoveColumnsWidths: (slice: Slice, schema: Schema) => Slice;
|
|
16
|
-
export declare const countCellsInSlice: (slice: Slice, schema: Schema, type?:
|
|
16
|
+
export declare const countCellsInSlice: (slice: Slice, schema: Schema, type?: "row" | "column") => number;
|
|
17
17
|
export declare const getTableSelectionType: (selection: Selection) => "row" | "column" | undefined;
|
|
18
18
|
export declare const getTableElementMoveTypeBySlice: (slice: Slice, state: EditorState) => "row" | "column" | undefined;
|
|
19
|
-
export declare const isInsideFirstCellOfRowOrColumn: (selection: Selection, type?:
|
|
19
|
+
export declare const isInsideFirstCellOfRowOrColumn: (selection: Selection, type?: "row" | "column") => boolean;
|
|
20
20
|
export declare const deleteTable: Command;
|
|
21
21
|
export declare const deleteTableIfSelected: Command;
|
|
22
22
|
export declare const convertFirstRowToHeader: (schema: Schema) => (tr: Transaction) => Transaction;
|
|
@@ -2,9 +2,9 @@ import { type IntlShape } from 'react-intl-next/src/types';
|
|
|
2
2
|
import type { Command, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
|
|
4
4
|
import type tablePlugin from '../../tablePlugin';
|
|
5
|
-
export declare const arrowLeftFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>[
|
|
6
|
-
export declare const arrowRightFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>[
|
|
7
|
-
export declare const selectColumns: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>[
|
|
8
|
-
export declare const selectRows: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>[
|
|
9
|
-
export declare const shiftArrowUpFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>[
|
|
10
|
-
export declare const modASelectTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>[
|
|
5
|
+
export declare const arrowLeftFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>["selection"] | undefined) => () => Command;
|
|
6
|
+
export declare const arrowRightFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>["selection"] | undefined) => () => Command;
|
|
7
|
+
export declare const selectColumns: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>["selection"] | undefined, ariaNotify?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void, getIntl?: () => IntlShape) => (triggeredByKeyboard?: boolean) => Command;
|
|
8
|
+
export declare const selectRows: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>["selection"] | undefined, ariaNotify?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void, getIntl?: () => IntlShape) => (triggeredByKeyboard?: boolean) => Command;
|
|
9
|
+
export declare const shiftArrowUpFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>["selection"] | undefined) => () => Command;
|
|
10
|
+
export declare const modASelectTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>["selection"] | undefined) => () => Command;
|
|
@@ -6,6 +6,6 @@ import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessib
|
|
|
6
6
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import type { DraggableData, DraggableType } from '../../types';
|
|
8
8
|
export declare const clearDropTargetWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.TABLE_CONTEXT_MENU | INPUT_METHOD.DRAG_AND_DROP, sourceType: DraggableType, sourceIndexes: number[] | undefined, status: TABLE_STATUS.CANCELLED | TABLE_STATUS.INVALID, tr?: Transaction) => Command;
|
|
9
|
-
export declare const moveSourceWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, ariaNotify?: (
|
|
10
|
-
export declare const moveSourceWithAnalyticsViaShortcut: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, ariaNotify?: (
|
|
11
|
-
export declare const cloneSourceWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.TABLE_CONTEXT_MENU | INPUT_METHOD.DRAG_AND_DROP | INPUT_METHOD.SHORTCUT, sourceType: DraggableType, sourceIndexes: number[], targetIndex: number, targetDirection:
|
|
9
|
+
export declare const moveSourceWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, ariaNotify?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void, getIntl?: () => IntlShape) => (inputMethod: INPUT_METHOD.TABLE_CONTEXT_MENU | INPUT_METHOD.DRAG_AND_DROP | INPUT_METHOD.SHORTCUT, sourceType: DraggableType, sourceIndexes: number[], targetIndex: number, tr?: Transaction) => Command;
|
|
10
|
+
export declare const moveSourceWithAnalyticsViaShortcut: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, ariaNotify?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void, getIntl?: () => IntlShape) => (sourceType: DraggableType, direction: DraggableData["direction"]) => Command;
|
|
11
|
+
export declare const cloneSourceWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.TABLE_CONTEXT_MENU | INPUT_METHOD.DRAG_AND_DROP | INPUT_METHOD.SHORTCUT, sourceType: DraggableType, sourceIndexes: number[], targetIndex: number, targetDirection: "start" | "end", tr?: Transaction) => Command;
|
|
@@ -6,4 +6,4 @@ export declare const setDropTarget: (type: DropTargetType, index: number, hasMer
|
|
|
6
6
|
export declare const clearDropTarget: (tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
|
|
7
7
|
export declare const moveSource: (sourceType: DraggableType, sourceIndexes: number[], targetIndex: number, tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
|
|
8
8
|
export declare const toggleDragMenu: (isDragMenuOpen: boolean | undefined, direction?: TableDirection, index?: number, trigger?: TriggerType) => import("@atlaskit/editor-common/types").Command;
|
|
9
|
-
export declare const cloneSource: (sourceType: DraggableType, sourceIndexes: number[], targetIndex: number, targetDirection:
|
|
9
|
+
export declare const cloneSource: (sourceType: DraggableType, sourceIndexes: number[], targetIndex: number, targetDirection: "start" | "end", tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
|