@atlaskit/editor-plugin-table 7.25.7 → 7.25.9
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 +17 -0
- package/dist/cjs/commands/column-resize.js +2 -1
- package/dist/cjs/commands/delete.js +5 -5
- package/dist/cjs/commands/insert.js +20 -20
- package/dist/cjs/commands-with-analytics.js +18 -17
- package/dist/cjs/event-handlers.js +5 -5
- package/dist/cjs/nodeviews/TableComponent.js +5 -11
- package/dist/cjs/nodeviews/TableResizer.js +1 -1
- package/dist/cjs/nodeviews/table.js +3 -6
- package/dist/cjs/plugin.js +11 -7
- package/dist/cjs/pm-plugins/keymap.js +19 -19
- package/dist/cjs/pm-plugins/main.js +1 -3
- package/dist/cjs/pm-plugins/table-resizing/commands.js +5 -4
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +5 -4
- package/dist/cjs/pm-plugins/table-resizing/plugin.js +2 -2
- package/dist/cjs/pm-plugins/table-resizing/utils/scale-table.js +4 -4
- package/dist/cjs/toolbar.js +31 -31
- package/dist/cjs/transforms/column-width.js +4 -3
- package/dist/cjs/transforms/delete-columns.js +5 -5
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +3 -3
- package/dist/cjs/ui/FloatingContextualMenu/index.js +4 -2
- package/dist/cjs/ui/FloatingDeleteButton/index.js +1 -1
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +2 -1
- package/dist/cjs/ui/FloatingDragMenu/index.js +4 -2
- package/dist/cjs/ui/FloatingInsertButton/index.js +1 -1
- package/dist/cjs/utils/drag-menu.js +10 -10
- package/dist/es2019/commands/column-resize.js +2 -1
- package/dist/es2019/commands/delete.js +2 -2
- package/dist/es2019/commands/insert.js +8 -8
- package/dist/es2019/commands-with-analytics.js +11 -10
- package/dist/es2019/event-handlers.js +2 -2
- package/dist/es2019/nodeviews/TableComponent.js +5 -11
- package/dist/es2019/nodeviews/TableResizer.js +1 -1
- package/dist/es2019/nodeviews/table.js +3 -6
- package/dist/es2019/plugin.js +11 -7
- package/dist/es2019/pm-plugins/keymap.js +9 -9
- package/dist/es2019/pm-plugins/main.js +2 -4
- package/dist/es2019/pm-plugins/table-resizing/commands.js +5 -4
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +5 -4
- package/dist/es2019/pm-plugins/table-resizing/plugin.js +2 -2
- package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +2 -2
- package/dist/es2019/toolbar.js +13 -13
- package/dist/es2019/transforms/column-width.js +4 -5
- package/dist/es2019/transforms/delete-columns.js +2 -2
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +3 -3
- package/dist/es2019/ui/FloatingContextualMenu/index.js +4 -2
- package/dist/es2019/ui/FloatingDeleteButton/index.js +1 -1
- package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +2 -1
- package/dist/es2019/ui/FloatingDragMenu/index.js +4 -2
- package/dist/es2019/ui/FloatingInsertButton/index.js +1 -1
- package/dist/es2019/utils/drag-menu.js +4 -4
- package/dist/esm/commands/column-resize.js +2 -1
- package/dist/esm/commands/delete.js +5 -5
- package/dist/esm/commands/insert.js +20 -20
- package/dist/esm/commands-with-analytics.js +18 -17
- package/dist/esm/event-handlers.js +5 -5
- package/dist/esm/nodeviews/TableComponent.js +5 -11
- package/dist/esm/nodeviews/TableResizer.js +1 -1
- package/dist/esm/nodeviews/table.js +3 -6
- package/dist/esm/plugin.js +11 -7
- package/dist/esm/pm-plugins/keymap.js +19 -19
- package/dist/esm/pm-plugins/main.js +2 -4
- package/dist/esm/pm-plugins/table-resizing/commands.js +5 -4
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +5 -4
- package/dist/esm/pm-plugins/table-resizing/plugin.js +2 -2
- package/dist/esm/pm-plugins/table-resizing/utils/scale-table.js +4 -4
- package/dist/esm/toolbar.js +31 -31
- package/dist/esm/transforms/column-width.js +4 -4
- package/dist/esm/transforms/delete-columns.js +5 -5
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +3 -3
- package/dist/esm/ui/FloatingContextualMenu/index.js +4 -2
- package/dist/esm/ui/FloatingDeleteButton/index.js +1 -1
- package/dist/esm/ui/FloatingDragMenu/DragMenu.js +2 -1
- package/dist/esm/ui/FloatingDragMenu/index.js +4 -2
- package/dist/esm/ui/FloatingInsertButton/index.js +1 -1
- package/dist/esm/utils/drag-menu.js +10 -10
- package/dist/types/commands/column-resize.d.ts +3 -1
- package/dist/types/commands/delete.d.ts +2 -1
- package/dist/types/commands/insert.d.ts +5 -4
- package/dist/types/commands-with-analytics.d.ts +6 -6
- package/dist/types/event-handlers.d.ts +2 -1
- package/dist/types/pm-plugins/keymap.d.ts +2 -2
- package/dist/types/pm-plugins/table-resizing/commands.d.ts +4 -2
- package/dist/types/pm-plugins/table-resizing/event-handlers.d.ts +2 -1
- package/dist/types/pm-plugins/table-resizing/plugin.d.ts +2 -2
- package/dist/types/pm-plugins/table-resizing/utils/scale-table.d.ts +2 -1
- package/dist/types/toolbar.d.ts +4 -4
- package/dist/types/transforms/column-width.d.ts +3 -2
- package/dist/types/transforms/delete-columns.d.ts +2 -1
- package/dist/types/ui/FloatingContextualMenu/ContextualMenu.d.ts +2 -0
- package/dist/types/ui/FloatingContextualMenu/index.d.ts +3 -2
- package/dist/types/ui/FloatingDeleteButton/index.d.ts +2 -1
- package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +3 -2
- package/dist/types/ui/FloatingDragMenu/index.d.ts +3 -2
- package/dist/types/ui/FloatingInsertButton/index.d.ts +2 -0
- package/dist/types/utils/drag-menu.d.ts +2 -2
- package/dist/types-ts4.5/commands/column-resize.d.ts +3 -1
- package/dist/types-ts4.5/commands/delete.d.ts +2 -1
- package/dist/types-ts4.5/commands/insert.d.ts +5 -4
- package/dist/types-ts4.5/commands-with-analytics.d.ts +6 -6
- package/dist/types-ts4.5/event-handlers.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/keymap.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/table-resizing/commands.d.ts +4 -2
- package/dist/types-ts4.5/pm-plugins/table-resizing/event-handlers.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/plugin.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/scale-table.d.ts +2 -1
- package/dist/types-ts4.5/toolbar.d.ts +4 -4
- package/dist/types-ts4.5/transforms/column-width.d.ts +3 -2
- package/dist/types-ts4.5/transforms/delete-columns.d.ts +2 -1
- package/dist/types-ts4.5/ui/FloatingContextualMenu/ContextualMenu.d.ts +2 -0
- package/dist/types-ts4.5/ui/FloatingContextualMenu/index.d.ts +3 -2
- package/dist/types-ts4.5/ui/FloatingDeleteButton/index.d.ts +2 -1
- package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +3 -2
- package/dist/types-ts4.5/ui/FloatingDragMenu/index.d.ts +3 -2
- package/dist/types-ts4.5/ui/FloatingInsertButton/index.d.ts +2 -0
- package/dist/types-ts4.5/utils/drag-menu.d.ts +2 -2
- package/package.json +8 -14
- package/src/commands/column-resize.ts +4 -2
- package/src/commands/delete.ts +3 -0
- package/src/commands/insert.ts +9 -0
- package/src/commands-with-analytics.ts +17 -3
- package/src/event-handlers.ts +3 -0
- package/src/nodeviews/TableComponent.tsx +3 -6
- package/src/nodeviews/TableResizer.tsx +1 -0
- package/src/nodeviews/table.tsx +3 -7
- package/src/plugin.tsx +7 -0
- package/src/pm-plugins/keymap.ts +10 -3
- package/src/pm-plugins/main.ts +1 -5
- package/src/pm-plugins/table-resizing/commands.ts +13 -3
- package/src/pm-plugins/table-resizing/event-handlers.ts +5 -2
- package/src/pm-plugins/table-resizing/plugin.ts +3 -1
- package/src/pm-plugins/table-resizing/utils/scale-table.ts +3 -1
- package/src/toolbar.tsx +14 -2
- package/src/transforms/column-width.ts +11 -3
- package/src/transforms/delete-columns.ts +3 -0
- package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +5 -1
- package/src/ui/FloatingContextualMenu/index.tsx +4 -1
- package/src/ui/FloatingDeleteButton/index.tsx +3 -2
- package/src/ui/FloatingDragMenu/DragMenu.tsx +4 -1
- package/src/ui/FloatingDragMenu/index.tsx +4 -1
- package/src/ui/FloatingInsertButton/index.tsx +3 -0
- package/src/utils/drag-menu.ts +5 -2
package/dist/types/toolbar.d.ts
CHANGED
|
@@ -6,13 +6,13 @@ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
|
6
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
7
|
import { Rect } from '@atlaskit/editor-tables/table-map';
|
|
8
8
|
import type { TablePluginOptions } from './plugin';
|
|
9
|
-
import type { AlignmentOptions, PluginConfig, ToolbarMenuConfig, ToolbarMenuContext, ToolbarMenuState } from './types';
|
|
9
|
+
import type { AlignmentOptions, PluginConfig, PluginInjectionAPI, ToolbarMenuConfig, ToolbarMenuContext, ToolbarMenuState } from './types';
|
|
10
10
|
export declare const getToolbarMenuConfig: (config: ToolbarMenuConfig, state: ToolbarMenuState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingWithFixedColumnWidthsOptionShown?: boolean, areTableColumnWidthsFixed?: boolean) => FloatingToolbarItem<Command>;
|
|
11
|
-
export declare const getToolbarCellOptionsConfig: (editorState: EditorState, editorView: EditorView | undefined | null, initialSelectionRect: Rect, { formatMessage }: ToolbarMenuContext, getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => FloatingToolbarDropdown<Command>;
|
|
11
|
+
export declare const getToolbarCellOptionsConfig: (editorState: EditorState, editorView: EditorView | undefined | null, initialSelectionRect: Rect, { formatMessage }: ToolbarMenuContext, getEditorContainerWidth: GetEditorContainerWidth, api: PluginInjectionAPI | undefined | null, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => FloatingToolbarDropdown<Command>;
|
|
12
12
|
export declare const getClosestSelectionRect: (state: EditorState) => Rect | undefined;
|
|
13
13
|
export declare const getClosestSelectionOrTableRect: (state: EditorState) => Rect | undefined;
|
|
14
|
-
export declare const getToolbarConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorFeatureFlags: GetEditorFeatureFlags, getEditorView: () => EditorView | null, options?: TablePluginOptions, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (config: PluginConfig) => FloatingToolbarHandler;
|
|
15
|
-
export declare const getDistributeConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, isCommentEditor?: boolean) => Command;
|
|
14
|
+
export declare const getToolbarConfig: (getEditorContainerWidth: GetEditorContainerWidth, api: PluginInjectionAPI | undefined | null, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorFeatureFlags: GetEditorFeatureFlags, getEditorView: () => EditorView | null, options?: TablePluginOptions, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (config: PluginConfig) => FloatingToolbarHandler;
|
|
15
|
+
export declare const getDistributeConfig: (getEditorContainerWidth: GetEditorContainerWidth, api: PluginInjectionAPI | undefined | null, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, isCommentEditor?: boolean) => Command;
|
|
16
16
|
type AlignmentIcon = {
|
|
17
17
|
id?: string;
|
|
18
18
|
value: AlignmentOptions;
|
|
@@ -3,6 +3,7 @@ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
|
3
3
|
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { ResizeState } from '../pm-plugins/table-resizing/utils';
|
|
6
|
+
import type { PluginInjectionAPI } from '../types';
|
|
6
7
|
/**
|
|
7
8
|
* Given a new ResizeState object, create a transaction that replaces and updates the table node based on new state.
|
|
8
9
|
* @param resizeState
|
|
@@ -10,7 +11,7 @@ import type { ResizeState } from '../pm-plugins/table-resizing/utils';
|
|
|
10
11
|
* @param start
|
|
11
12
|
* @returns
|
|
12
13
|
*/
|
|
13
|
-
export declare const updateColumnWidths: (resizeState: ResizeState, table: PMNode, start: number) => (tr: Transaction) => Transaction;
|
|
14
|
+
export declare const updateColumnWidths: (resizeState: ResizeState, table: PMNode, start: number, _api: PluginInjectionAPI | undefined | null) => (tr: Transaction) => Transaction;
|
|
14
15
|
/**
|
|
15
16
|
* This function is called when user inserts/deletes a column in a table to;
|
|
16
17
|
* - rescale all columns (if the table did not overflow before the insertion)
|
|
@@ -21,4 +22,4 @@ export declare const updateColumnWidths: (resizeState: ResizeState, table: PMNod
|
|
|
21
22
|
* @param view
|
|
22
23
|
* @returns Updated transaction with rescaled columns for a given table
|
|
23
24
|
*/
|
|
24
|
-
export declare const rescaleColumns: (isTableScalingEnabled
|
|
25
|
+
export declare const rescaleColumns: (isTableScalingEnabled: boolean | undefined, isTableFixedColumnWidthsOptionEnabled: boolean | undefined, shouldUseIncreasedScalingPercent: boolean | undefined, api: PluginInjectionAPI | undefined | null) => (table: ContentNodeWithPos, view: EditorView | undefined) => (tr: Transaction) => Transaction;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
4
|
-
|
|
4
|
+
import type { PluginInjectionAPI } from '../types';
|
|
5
|
+
export declare const deleteColumns: (rect: Rect, allowCustomStep: boolean, api: PluginInjectionAPI | undefined | null, view?: EditorView, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (tr: Transaction) => Transaction;
|
|
@@ -9,6 +9,7 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
|
9
9
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
10
10
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
11
11
|
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
12
|
+
import type { PluginInjectionAPI } from '../../types';
|
|
12
13
|
export interface Props {
|
|
13
14
|
editorView: EditorView;
|
|
14
15
|
isOpen: boolean;
|
|
@@ -20,6 +21,7 @@ export interface Props {
|
|
|
20
21
|
allowBackgroundColor?: boolean;
|
|
21
22
|
boundariesElement?: HTMLElement;
|
|
22
23
|
offset?: Array<number>;
|
|
24
|
+
api: PluginInjectionAPI | undefined | null;
|
|
23
25
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
24
26
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
25
27
|
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
@@ -6,11 +6,12 @@ import { jsx } from '@emotion/react';
|
|
|
6
6
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
7
7
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
8
8
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
9
|
-
import type { PluginConfig } from '../../types';
|
|
9
|
+
import type { PluginConfig, PluginInjectionAPI } from '../../types';
|
|
10
10
|
export interface Props {
|
|
11
11
|
editorView: EditorView;
|
|
12
12
|
isOpen: boolean;
|
|
13
13
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
14
|
+
api: PluginInjectionAPI | undefined | null;
|
|
14
15
|
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
15
16
|
targetCellPosition?: number;
|
|
16
17
|
mountPoint?: HTMLElement;
|
|
@@ -22,7 +23,7 @@ export interface Props {
|
|
|
22
23
|
isCommentEditor?: boolean;
|
|
23
24
|
}
|
|
24
25
|
declare const FloatingContextualMenu: {
|
|
25
|
-
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth, getEditorFeatureFlags, isCellMenuOpenByKeyboard, isCommentEditor, }: Props): jsx.JSX.Element | null;
|
|
26
|
+
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth, getEditorFeatureFlags, isCellMenuOpenByKeyboard, isCommentEditor, api, }: Props): jsx.JSX.Element | null;
|
|
26
27
|
displayName: string;
|
|
27
28
|
};
|
|
28
29
|
export default FloatingContextualMenu;
|
|
@@ -3,11 +3,12 @@ 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
|
+
import type { PluginInjectionAPI, TableDirection } from '../../types';
|
|
7
7
|
import type { CellSelectionType } from './types';
|
|
8
8
|
export interface Props {
|
|
9
9
|
editorView: EditorView;
|
|
10
10
|
selection: Selection;
|
|
11
|
+
api: PluginInjectionAPI | undefined | null;
|
|
11
12
|
tableRef?: HTMLTableElement;
|
|
12
13
|
mountPoint?: HTMLElement;
|
|
13
14
|
boundariesElement?: HTMLElement;
|
|
@@ -11,7 +11,7 @@ import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
|
11
11
|
import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
|
|
12
12
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
13
13
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
14
|
-
import type { PluginConfig, TableDirection } from '../../types';
|
|
14
|
+
import type { PluginConfig, PluginInjectionAPI, TableDirection } from '../../types';
|
|
15
15
|
type DragMenuProps = {
|
|
16
16
|
direction?: TableDirection;
|
|
17
17
|
index?: number;
|
|
@@ -22,6 +22,7 @@ type DragMenuProps = {
|
|
|
22
22
|
targetCellPosition?: number;
|
|
23
23
|
pluginConfig?: PluginConfig;
|
|
24
24
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
25
|
+
api: PluginInjectionAPI | undefined | null;
|
|
25
26
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
26
27
|
fitWidth?: number;
|
|
27
28
|
fitHeight?: number;
|
|
@@ -35,7 +36,7 @@ type DragMenuProps = {
|
|
|
35
36
|
tableSortColumnReorder?: boolean;
|
|
36
37
|
ariaNotifyPlugin?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void;
|
|
37
38
|
};
|
|
38
|
-
export declare const DragMenu: React.MemoExoticComponent<({ direction, index, target, isOpen, editorView, tableNode, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, fitHeight, fitWidth, mountPoint, scrollableElement, boundariesElement, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent, isTableFixedColumnWidthsOptionEnabled, tableSortColumnReorder, ariaNotifyPlugin, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
|
|
39
|
+
export declare const DragMenu: React.MemoExoticComponent<({ direction, index, target, isOpen, editorView, tableNode, targetCellPosition, getEditorContainerWidth, api, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, fitHeight, fitWidth, mountPoint, scrollableElement, boundariesElement, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent, isTableFixedColumnWidthsOptionEnabled, tableSortColumnReorder, ariaNotifyPlugin, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
|
|
39
40
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<DragMenuProps & WrappedComponentProps>> & {
|
|
40
41
|
WrappedComponent: React.ComponentType<DragMenuProps & WrappedComponentProps>;
|
|
41
42
|
};
|
|
@@ -5,7 +5,7 @@ import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessib
|
|
|
5
5
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
7
|
import type { RowStickyState } from '../../pm-plugins/sticky-headers';
|
|
8
|
-
import type { PluginConfig, TableDirection } from '../../types';
|
|
8
|
+
import type { PluginConfig, PluginInjectionAPI, TableDirection } from '../../types';
|
|
9
9
|
export interface Props {
|
|
10
10
|
editorView: EditorView;
|
|
11
11
|
isOpen: boolean;
|
|
@@ -18,6 +18,7 @@ export interface Props {
|
|
|
18
18
|
index?: number;
|
|
19
19
|
targetCellPosition?: number;
|
|
20
20
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
21
|
+
api: PluginInjectionAPI | undefined | null;
|
|
21
22
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
22
23
|
stickyHeaders?: RowStickyState;
|
|
23
24
|
pluginConfig?: PluginConfig;
|
|
@@ -26,7 +27,7 @@ export interface Props {
|
|
|
26
27
|
ariaNotifyPlugin?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void;
|
|
27
28
|
}
|
|
28
29
|
declare const FloatingDragMenu: {
|
|
29
|
-
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, tableNode, direction, index, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, stickyHeaders, pluginConfig, isTableScalingEnabled, getEditorFeatureFlags, ariaNotifyPlugin, }: Props): JSX.Element | null;
|
|
30
|
+
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, tableNode, direction, index, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, stickyHeaders, pluginConfig, isTableScalingEnabled, getEditorFeatureFlags, ariaNotifyPlugin, api, }: Props): JSX.Element | null;
|
|
30
31
|
displayName: string;
|
|
31
32
|
};
|
|
32
33
|
export default FloatingDragMenu;
|
|
@@ -4,6 +4,7 @@ import type { DispatchAnalyticsEvent, EditorAnalyticsAPI } from '@atlaskit/edito
|
|
|
4
4
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
5
5
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
+
import type { PluginInjectionAPI } from '../../types';
|
|
7
8
|
export interface Props {
|
|
8
9
|
editorView: EditorView;
|
|
9
10
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
@@ -19,6 +20,7 @@ export interface Props {
|
|
|
19
20
|
boundariesElement?: HTMLElement;
|
|
20
21
|
scrollableElement?: HTMLElement;
|
|
21
22
|
hasStickyHeaders?: boolean;
|
|
23
|
+
api: PluginInjectionAPI | undefined | null;
|
|
22
24
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
23
25
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
24
26
|
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
@@ -5,7 +5,7 @@ import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessib
|
|
|
5
5
|
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
7
|
import type { Rect, TableMap } from '@atlaskit/editor-tables/table-map';
|
|
8
|
-
import type { DraggableData, DraggableType, TableDirection } from '../types';
|
|
8
|
+
import type { DraggableData, DraggableType, PluginInjectionAPI, TableDirection } from '../types';
|
|
9
9
|
export declare const getTargetIndex: (selectedIndexes: number[], direction: DraggableData['direction']) => number;
|
|
10
10
|
export declare const canMove: (sourceType: DraggableType, direction: DraggableData['direction'], totalItemsOfSourceTypeCount: number, selection: Selection, selectionRect?: Rect) => boolean;
|
|
11
11
|
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';
|
|
@@ -14,4 +14,4 @@ export interface DragMenuConfig extends Omit<DropdownOptionT<Command>, 'icon'> {
|
|
|
14
14
|
icon?: React.ComponentType<React.PropsWithChildren<IconProps>>;
|
|
15
15
|
keymap?: string;
|
|
16
16
|
}
|
|
17
|
-
export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, hasMergedCellsInTable: boolean, editorView: EditorView, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean, tableDuplicateCellColouring?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, tableSortColumnReorder?: boolean, ariaNotifyPlugin?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined) => DragMenuConfig[];
|
|
17
|
+
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, tableDuplicateCellColouring?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, tableSortColumnReorder?: boolean, ariaNotifyPlugin?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined) => DragMenuConfig[];
|
|
@@ -3,6 +3,7 @@ import type { Command, GetEditorContainerWidth } from '@atlaskit/editor-common/t
|
|
|
3
3
|
import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
|
|
4
4
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import type { Direction } from '@atlaskit/editor-tables/types';
|
|
6
|
+
import type { PluginInjectionAPI } from '../types';
|
|
6
7
|
export declare const initiateKeyboardColumnResizing: ({ ariaNotify, getIntl, }: {
|
|
7
8
|
ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined;
|
|
8
9
|
getIntl?: (() => IntlShape) | undefined;
|
|
@@ -12,12 +13,13 @@ export declare const activateNextResizeArea: ({ direction, ariaNotify, getIntl,
|
|
|
12
13
|
ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined;
|
|
13
14
|
getIntl?: (() => IntlShape) | undefined;
|
|
14
15
|
}) => Command;
|
|
15
|
-
export declare const changeColumnWidthByStep: ({ stepSize, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, isCommentEditor, ariaNotify, getIntl, }: {
|
|
16
|
+
export declare const changeColumnWidthByStep: ({ stepSize, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, isCommentEditor, ariaNotify, api, getIntl, }: {
|
|
16
17
|
stepSize: number;
|
|
17
18
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
18
19
|
isTableScalingEnabled: boolean;
|
|
19
20
|
isTableFixedColumnWidthsOptionEnabled: boolean;
|
|
20
21
|
isCommentEditor: boolean;
|
|
22
|
+
api: PluginInjectionAPI | undefined | null;
|
|
21
23
|
ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined;
|
|
22
24
|
getIntl?: (() => IntlShape) | undefined;
|
|
23
25
|
originalTr?: Transaction | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { Command } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
3
|
-
|
|
3
|
+
import type { PluginInjectionAPI } from '../types';
|
|
4
|
+
export declare const deleteColumnsCommand: (rect: Rect, api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
@@ -3,10 +3,11 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
3
3
|
import type { Command, EditorCommand } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
-
|
|
7
|
-
export declare
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
6
|
+
import type { PluginInjectionAPI } from '../types';
|
|
7
|
+
export declare function addColumnAt(api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean): (column: number, allowAddColumnCustomStep: boolean | undefined, view: EditorView | undefined) => (tr: Transaction) => Transaction;
|
|
8
|
+
export declare const addColumnBefore: (api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
9
|
+
export declare const addColumnAfter: (api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
10
|
+
export declare const insertColumn: (api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (column: number) => Command;
|
|
10
11
|
export declare const insertRow: (row: number, moveCursorToTheNewRow: boolean, isCellBackgroundDuplicated?: boolean) => Command;
|
|
11
12
|
export declare const createTable: (isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthModeEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined | null, isCommentEditor?: boolean, isTableResizingEnabled?: boolean) => Command;
|
|
12
13
|
export declare const insertTableWithSize: (isFullWidthModeEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, isCommentEditor?: boolean) => (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
|
|
@@ -9,18 +9,18 @@ import type { NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
|
9
9
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
10
10
|
import { type Rect } from '@atlaskit/editor-tables/table-map';
|
|
11
11
|
import type { ResizeStateWithAnalytics } from './pm-plugins/table-resizing/utils';
|
|
12
|
-
import type { AlignmentOptions, InsertRowMethods, InsertRowOptions, RowInsertPosition } from './types';
|
|
12
|
+
import type { AlignmentOptions, InsertRowMethods, InsertRowOptions, PluginInjectionAPI, RowInsertPosition } from './types';
|
|
13
13
|
export declare const emptyMultipleCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.KEYBOARD | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, targetCellPosition?: number) => Command;
|
|
14
14
|
export declare const mergeCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | null | undefined) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB) => Command;
|
|
15
15
|
export declare const splitCellWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB) => Command;
|
|
16
16
|
export declare const setColorWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, cellColor: string, editorView?: EditorView | null) => Command;
|
|
17
17
|
export declare const addRowAroundSelection: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (side: RowInsertPosition) => Command;
|
|
18
18
|
export declare const insertRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isCellbackgroundDuplicated?: boolean) => (inputMethod: InsertRowMethods, options: InsertRowOptions) => Command;
|
|
19
|
-
export declare const changeColumnWidthByStepWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled: boolean, isTableFixedColumnWidthsOptionEnabled: boolean, isCommentEditor: boolean, inputMethod: INPUT_METHOD.SHORTCUT, ariaNotify?: ((message: string) => void) | undefined, getIntl?: () => IntlShape) => Command;
|
|
20
|
-
export declare const insertColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isCellbackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, position: number) => Command;
|
|
19
|
+
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) | undefined, getIntl?: () => IntlShape) => Command;
|
|
20
|
+
export declare const insertColumnWithAnalytics: (api: PluginInjectionAPI | undefined | null, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isCellbackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, position: number) => Command;
|
|
21
21
|
export declare const deleteRowsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TABLE_CONTEXT_MENU, rect: Rect, isHeaderRowRequired: boolean) => Command;
|
|
22
|
-
export declare const deleteColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TABLE_CONTEXT_MENU, rect: Rect) => Command;
|
|
23
|
-
export declare const deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
22
|
+
export declare const deleteColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TABLE_CONTEXT_MENU, rect: Rect) => Command;
|
|
23
|
+
export declare const deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
24
24
|
export declare const deleteTableWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
25
25
|
export declare const deleteTableIfSelectedWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.FLOATING_TB | INPUT_METHOD.KEYBOARD) => Command;
|
|
26
26
|
export declare const toggleHeaderRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
@@ -28,7 +28,7 @@ export declare const toggleHeaderColumnWithAnalytics: (editorAnalyticsAPI: Edito
|
|
|
28
28
|
export declare const toggleNumberColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
29
29
|
export declare const toggleTableLayoutWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
30
30
|
export declare const sortColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, columnIndex: number, sortOrder: SortOrder) => Command;
|
|
31
|
-
export declare const distributeColumnsWidthsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, { resizeState, table, attributes }: ResizeStateWithAnalytics) => Command;
|
|
31
|
+
export declare const distributeColumnsWidthsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, api: PluginInjectionAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, { resizeState, table, attributes }: ResizeStateWithAnalytics) => Command;
|
|
32
32
|
export declare const wrapTableInExpandWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
33
33
|
export declare const toggleFixedColumnWidthsOptionAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, inputMethod: INPUT_METHOD.FLOATING_TB) => Command;
|
|
34
34
|
export declare const setTableAlignmentWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isCommentEditor: boolean) => (newAlignment: AlignmentOptions, previousAlignment: TableLayout, inputMethod: INPUT_METHOD.FLOATING_TB, reason: CHANGE_ALIGNMENT_REASON) => Command;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import type { PluginInjectionAPI } from './types';
|
|
4
5
|
export declare const handleBlur: (view: EditorView, event: Event) => boolean;
|
|
5
6
|
export declare const handleFocus: (view: EditorView, event: Event) => boolean;
|
|
6
7
|
export declare const handleClick: (view: EditorView, event: Event) => boolean;
|
|
@@ -12,7 +13,7 @@ export declare const handleMouseEnter: (view: EditorView, mouseEvent: Event) =>
|
|
|
12
13
|
export declare const handleMouseLeave: (view: EditorView, event: Event) => boolean;
|
|
13
14
|
export declare const handleMouseMove: (view: EditorView, event: Event) => boolean;
|
|
14
15
|
export declare function handleTripleClick(view: EditorView, pos: number): boolean;
|
|
15
|
-
export declare const handleCut: (oldTr: Transaction, oldState: EditorState, newState: EditorState, editorAnalyticsAPI?: EditorAnalyticsAPI, editorView?: EditorView, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Transaction;
|
|
16
|
+
export declare const handleCut: (oldTr: Transaction, oldState: EditorState, newState: EditorState, api: PluginInjectionAPI | undefined | null, editorAnalyticsAPI?: EditorAnalyticsAPI, editorView?: EditorView, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Transaction;
|
|
16
17
|
export declare const isTableInFocus: (view: EditorView) => boolean;
|
|
17
18
|
export declare const whenTableInFocus: (eventHandler: (view: EditorView, mouseEvent: Event) => boolean) => (view: EditorView, mouseEvent: Event) => boolean;
|
|
18
19
|
export declare const withCellTracking: (eventHandler: (view: EditorView, mouseEvent: Event) => boolean) => (view: EditorView, mouseEvent: Event) => boolean;
|
|
@@ -2,6 +2,6 @@ import type { IntlShape } from 'react-intl-next/src/types';
|
|
|
2
2
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
4
|
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
5
|
-
import type { PluginInjectionAPIWithA11y } from '../types';
|
|
6
|
-
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, dragAndDropEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthEnabled?: boolean, pluginInjectionApi?: PluginInjectionAPIWithA11y, getIntl?: () => IntlShape, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean, isTableResizingEnabled?: boolean): SafePlugin;
|
|
5
|
+
import type { PluginInjectionAPI, PluginInjectionAPIWithA11y } from '../types';
|
|
6
|
+
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, api: PluginInjectionAPI | undefined | null, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, dragAndDropEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthEnabled?: boolean, pluginInjectionApi?: PluginInjectionAPIWithA11y, getIntl?: () => IntlShape, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean, isTableResizingEnabled?: boolean): SafePlugin;
|
|
7
7
|
export default keymapPlugin;
|
|
@@ -2,14 +2,16 @@ import type { Command } from '@atlaskit/editor-common/types';
|
|
|
2
2
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
+
import type { PluginInjectionAPI } from '../../types';
|
|
5
6
|
import type { ResizeState } from './utils';
|
|
6
|
-
export declare const evenColumns: ({ resizeState, table, start, event, }: {
|
|
7
|
+
export declare const evenColumns: ({ resizeState, table, start, event, api, }: {
|
|
8
|
+
api: PluginInjectionAPI | undefined | null;
|
|
7
9
|
resizeState: ResizeState;
|
|
8
10
|
table: PMNode;
|
|
9
11
|
start: number;
|
|
10
12
|
event: MouseEvent;
|
|
11
13
|
}) => Command;
|
|
12
|
-
export declare const distributeColumnsWidths: (newResizeState: ResizeState, table: ContentNodeWithPos) => Command;
|
|
14
|
+
export declare const distributeColumnsWidths: (newResizeState: ResizeState, table: ContentNodeWithPos, api: PluginInjectionAPI | undefined | null) => Command;
|
|
13
15
|
export declare const setResizeHandlePos: (resizeHandlePos: number | null) => Command;
|
|
14
16
|
export declare const stopResizing: (tr?: Transaction) => Command;
|
|
15
17
|
export declare const setDragging: (dragging: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
|
|
4
|
+
import type { PluginInjectionAPI } from '../../types';
|
|
5
|
+
export declare const handleMouseDown: (view: EditorView, event: MouseEvent, localResizeHandlePos: number, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, isTableScalingEnabled: boolean, api: PluginInjectionAPI | undefined | null, editorAnalyticsAPI?: EditorAnalyticsAPI, isNewColumnResizingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isCommentEditor?: boolean) => boolean;
|
|
@@ -2,5 +2,5 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
|
2
2
|
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
4
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
5
|
-
import type { ColumnResizingPluginState } from '../../types';
|
|
6
|
-
export declare function createPlugin(dispatch: Dispatch<ColumnResizingPluginState>, { lastColumnResizable }: ColumnResizingPluginState, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, editorAnalyticsAPI?: EditorAnalyticsAPI, isTableScalingEnabled?: boolean, isNewColumnResizingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isCommentEditor?: boolean): SafePlugin<ColumnResizingPluginState>;
|
|
5
|
+
import type { ColumnResizingPluginState, PluginInjectionAPI } from '../../types';
|
|
6
|
+
export declare function createPlugin(dispatch: Dispatch<ColumnResizingPluginState>, { lastColumnResizable }: ColumnResizingPluginState, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, api: PluginInjectionAPI | undefined | null, editorAnalyticsAPI?: EditorAnalyticsAPI, isTableScalingEnabled?: boolean, isNewColumnResizingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isCommentEditor?: boolean): SafePlugin<ColumnResizingPluginState>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import type { DomAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
4
|
+
import type { PluginInjectionAPI } from '../../../types';
|
|
4
5
|
import type { ResizeState } from '../utils/types';
|
|
5
6
|
export interface ScaleOptions {
|
|
6
7
|
node: PMNode;
|
|
@@ -17,4 +18,4 @@ export declare const scale: (tableRef: HTMLTableElement, options: ScaleOptions,
|
|
|
17
18
|
export declare const scaleWithParent: (tableRef: HTMLTableElement, parentWidth: number, table: PMNode, start: number, domAtPos: DomAtPos, isTableScalingEnabledOnCurrentTable?: boolean, shouldUseIncreasedScalingPercent?: boolean) => ResizeState;
|
|
18
19
|
export declare function scaleTableTo(state: ResizeState, maxSize: number): ResizeState;
|
|
19
20
|
export declare const previewScaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabled?: boolean, isTableWithFixedColumnWidthsOptionEnabled?: boolean, isCommentEditor?: boolean) => void;
|
|
20
|
-
export declare const scaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabledOnCurrentTable?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (tr: Transaction) => Transaction;
|
|
21
|
+
export declare const scaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, api: PluginInjectionAPI | undefined | null, isTableScalingEnabledOnCurrentTable?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (tr: Transaction) => Transaction;
|
|
@@ -6,13 +6,13 @@ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
|
6
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
7
|
import { Rect } from '@atlaskit/editor-tables/table-map';
|
|
8
8
|
import type { TablePluginOptions } from './plugin';
|
|
9
|
-
import type { AlignmentOptions, PluginConfig, ToolbarMenuConfig, ToolbarMenuContext, ToolbarMenuState } from './types';
|
|
9
|
+
import type { AlignmentOptions, PluginConfig, PluginInjectionAPI, ToolbarMenuConfig, ToolbarMenuContext, ToolbarMenuState } from './types';
|
|
10
10
|
export declare const getToolbarMenuConfig: (config: ToolbarMenuConfig, state: ToolbarMenuState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingWithFixedColumnWidthsOptionShown?: boolean, areTableColumnWidthsFixed?: boolean) => FloatingToolbarItem<Command>;
|
|
11
|
-
export declare const getToolbarCellOptionsConfig: (editorState: EditorState, editorView: EditorView | undefined | null, initialSelectionRect: Rect, { formatMessage }: ToolbarMenuContext, getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => FloatingToolbarDropdown<Command>;
|
|
11
|
+
export declare const getToolbarCellOptionsConfig: (editorState: EditorState, editorView: EditorView | undefined | null, initialSelectionRect: Rect, { formatMessage }: ToolbarMenuContext, getEditorContainerWidth: GetEditorContainerWidth, api: PluginInjectionAPI | undefined | null, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => FloatingToolbarDropdown<Command>;
|
|
12
12
|
export declare const getClosestSelectionRect: (state: EditorState) => Rect | undefined;
|
|
13
13
|
export declare const getClosestSelectionOrTableRect: (state: EditorState) => Rect | undefined;
|
|
14
|
-
export declare const getToolbarConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorFeatureFlags: GetEditorFeatureFlags, getEditorView: () => EditorView | null, options?: TablePluginOptions, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (config: PluginConfig) => FloatingToolbarHandler;
|
|
15
|
-
export declare const getDistributeConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, isCommentEditor?: boolean) => Command;
|
|
14
|
+
export declare const getToolbarConfig: (getEditorContainerWidth: GetEditorContainerWidth, api: PluginInjectionAPI | undefined | null, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorFeatureFlags: GetEditorFeatureFlags, getEditorView: () => EditorView | null, options?: TablePluginOptions, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (config: PluginConfig) => FloatingToolbarHandler;
|
|
15
|
+
export declare const getDistributeConfig: (getEditorContainerWidth: GetEditorContainerWidth, api: PluginInjectionAPI | undefined | null, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, isCommentEditor?: boolean) => Command;
|
|
16
16
|
type AlignmentIcon = {
|
|
17
17
|
id?: string;
|
|
18
18
|
value: AlignmentOptions;
|
|
@@ -3,6 +3,7 @@ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
|
3
3
|
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { ResizeState } from '../pm-plugins/table-resizing/utils';
|
|
6
|
+
import type { PluginInjectionAPI } from '../types';
|
|
6
7
|
/**
|
|
7
8
|
* Given a new ResizeState object, create a transaction that replaces and updates the table node based on new state.
|
|
8
9
|
* @param resizeState
|
|
@@ -10,7 +11,7 @@ import type { ResizeState } from '../pm-plugins/table-resizing/utils';
|
|
|
10
11
|
* @param start
|
|
11
12
|
* @returns
|
|
12
13
|
*/
|
|
13
|
-
export declare const updateColumnWidths: (resizeState: ResizeState, table: PMNode, start: number) => (tr: Transaction) => Transaction;
|
|
14
|
+
export declare const updateColumnWidths: (resizeState: ResizeState, table: PMNode, start: number, _api: PluginInjectionAPI | undefined | null) => (tr: Transaction) => Transaction;
|
|
14
15
|
/**
|
|
15
16
|
* This function is called when user inserts/deletes a column in a table to;
|
|
16
17
|
* - rescale all columns (if the table did not overflow before the insertion)
|
|
@@ -21,4 +22,4 @@ export declare const updateColumnWidths: (resizeState: ResizeState, table: PMNod
|
|
|
21
22
|
* @param view
|
|
22
23
|
* @returns Updated transaction with rescaled columns for a given table
|
|
23
24
|
*/
|
|
24
|
-
export declare const rescaleColumns: (isTableScalingEnabled
|
|
25
|
+
export declare const rescaleColumns: (isTableScalingEnabled: boolean | undefined, isTableFixedColumnWidthsOptionEnabled: boolean | undefined, shouldUseIncreasedScalingPercent: boolean | undefined, api: PluginInjectionAPI | undefined | null) => (table: ContentNodeWithPos, view: EditorView | undefined) => (tr: Transaction) => Transaction;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
4
|
-
|
|
4
|
+
import type { PluginInjectionAPI } from '../types';
|
|
5
|
+
export declare const deleteColumns: (rect: Rect, allowCustomStep: boolean, api: PluginInjectionAPI | undefined | null, view?: EditorView, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (tr: Transaction) => Transaction;
|
|
@@ -9,6 +9,7 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
|
9
9
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
10
10
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
11
11
|
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
12
|
+
import type { PluginInjectionAPI } from '../../types';
|
|
12
13
|
export interface Props {
|
|
13
14
|
editorView: EditorView;
|
|
14
15
|
isOpen: boolean;
|
|
@@ -20,6 +21,7 @@ export interface Props {
|
|
|
20
21
|
allowBackgroundColor?: boolean;
|
|
21
22
|
boundariesElement?: HTMLElement;
|
|
22
23
|
offset?: Array<number>;
|
|
24
|
+
api: PluginInjectionAPI | undefined | null;
|
|
23
25
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
24
26
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
25
27
|
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
@@ -6,11 +6,12 @@ import { jsx } from '@emotion/react';
|
|
|
6
6
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
7
7
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
8
8
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
9
|
-
import type { PluginConfig } from '../../types';
|
|
9
|
+
import type { PluginConfig, PluginInjectionAPI } from '../../types';
|
|
10
10
|
export interface Props {
|
|
11
11
|
editorView: EditorView;
|
|
12
12
|
isOpen: boolean;
|
|
13
13
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
14
|
+
api: PluginInjectionAPI | undefined | null;
|
|
14
15
|
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
15
16
|
targetCellPosition?: number;
|
|
16
17
|
mountPoint?: HTMLElement;
|
|
@@ -22,7 +23,7 @@ export interface Props {
|
|
|
22
23
|
isCommentEditor?: boolean;
|
|
23
24
|
}
|
|
24
25
|
declare const FloatingContextualMenu: {
|
|
25
|
-
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth, getEditorFeatureFlags, isCellMenuOpenByKeyboard, isCommentEditor, }: Props): jsx.JSX.Element | null;
|
|
26
|
+
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth, getEditorFeatureFlags, isCellMenuOpenByKeyboard, isCommentEditor, api, }: Props): jsx.JSX.Element | null;
|
|
26
27
|
displayName: string;
|
|
27
28
|
};
|
|
28
29
|
export default FloatingContextualMenu;
|
|
@@ -3,11 +3,12 @@ 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
|
+
import type { PluginInjectionAPI, TableDirection } from '../../types';
|
|
7
7
|
import type { CellSelectionType } from './types';
|
|
8
8
|
export interface Props {
|
|
9
9
|
editorView: EditorView;
|
|
10
10
|
selection: Selection;
|
|
11
|
+
api: PluginInjectionAPI | undefined | null;
|
|
11
12
|
tableRef?: HTMLTableElement;
|
|
12
13
|
mountPoint?: HTMLElement;
|
|
13
14
|
boundariesElement?: HTMLElement;
|
|
@@ -11,7 +11,7 @@ import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
|
11
11
|
import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
|
|
12
12
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
13
13
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
14
|
-
import type { PluginConfig, TableDirection } from '../../types';
|
|
14
|
+
import type { PluginConfig, PluginInjectionAPI, TableDirection } from '../../types';
|
|
15
15
|
type DragMenuProps = {
|
|
16
16
|
direction?: TableDirection;
|
|
17
17
|
index?: number;
|
|
@@ -22,6 +22,7 @@ type DragMenuProps = {
|
|
|
22
22
|
targetCellPosition?: number;
|
|
23
23
|
pluginConfig?: PluginConfig;
|
|
24
24
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
25
|
+
api: PluginInjectionAPI | undefined | null;
|
|
25
26
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
26
27
|
fitWidth?: number;
|
|
27
28
|
fitHeight?: number;
|
|
@@ -35,7 +36,7 @@ type DragMenuProps = {
|
|
|
35
36
|
tableSortColumnReorder?: boolean;
|
|
36
37
|
ariaNotifyPlugin?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void;
|
|
37
38
|
};
|
|
38
|
-
export declare const DragMenu: React.MemoExoticComponent<({ direction, index, target, isOpen, editorView, tableNode, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, fitHeight, fitWidth, mountPoint, scrollableElement, boundariesElement, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent, isTableFixedColumnWidthsOptionEnabled, tableSortColumnReorder, ariaNotifyPlugin, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
|
|
39
|
+
export declare const DragMenu: React.MemoExoticComponent<({ direction, index, target, isOpen, editorView, tableNode, targetCellPosition, getEditorContainerWidth, api, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, fitHeight, fitWidth, mountPoint, scrollableElement, boundariesElement, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent, isTableFixedColumnWidthsOptionEnabled, tableSortColumnReorder, ariaNotifyPlugin, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
|
|
39
40
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<DragMenuProps & WrappedComponentProps>> & {
|
|
40
41
|
WrappedComponent: React.ComponentType<DragMenuProps & WrappedComponentProps>;
|
|
41
42
|
};
|
|
@@ -5,7 +5,7 @@ import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessib
|
|
|
5
5
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
7
|
import type { RowStickyState } from '../../pm-plugins/sticky-headers';
|
|
8
|
-
import type { PluginConfig, TableDirection } from '../../types';
|
|
8
|
+
import type { PluginConfig, PluginInjectionAPI, TableDirection } from '../../types';
|
|
9
9
|
export interface Props {
|
|
10
10
|
editorView: EditorView;
|
|
11
11
|
isOpen: boolean;
|
|
@@ -18,6 +18,7 @@ export interface Props {
|
|
|
18
18
|
index?: number;
|
|
19
19
|
targetCellPosition?: number;
|
|
20
20
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
21
|
+
api: PluginInjectionAPI | undefined | null;
|
|
21
22
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
22
23
|
stickyHeaders?: RowStickyState;
|
|
23
24
|
pluginConfig?: PluginConfig;
|
|
@@ -26,7 +27,7 @@ export interface Props {
|
|
|
26
27
|
ariaNotifyPlugin?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void;
|
|
27
28
|
}
|
|
28
29
|
declare const FloatingDragMenu: {
|
|
29
|
-
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, tableNode, direction, index, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, stickyHeaders, pluginConfig, isTableScalingEnabled, getEditorFeatureFlags, ariaNotifyPlugin, }: Props): JSX.Element | null;
|
|
30
|
+
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, tableNode, direction, index, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, stickyHeaders, pluginConfig, isTableScalingEnabled, getEditorFeatureFlags, ariaNotifyPlugin, api, }: Props): JSX.Element | null;
|
|
30
31
|
displayName: string;
|
|
31
32
|
};
|
|
32
33
|
export default FloatingDragMenu;
|
|
@@ -4,6 +4,7 @@ import type { DispatchAnalyticsEvent, EditorAnalyticsAPI } from '@atlaskit/edito
|
|
|
4
4
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
5
5
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
+
import type { PluginInjectionAPI } from '../../types';
|
|
7
8
|
export interface Props {
|
|
8
9
|
editorView: EditorView;
|
|
9
10
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
@@ -19,6 +20,7 @@ export interface Props {
|
|
|
19
20
|
boundariesElement?: HTMLElement;
|
|
20
21
|
scrollableElement?: HTMLElement;
|
|
21
22
|
hasStickyHeaders?: boolean;
|
|
23
|
+
api: PluginInjectionAPI | undefined | null;
|
|
22
24
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
23
25
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
24
26
|
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
@@ -5,7 +5,7 @@ import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessib
|
|
|
5
5
|
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
7
|
import type { Rect, TableMap } from '@atlaskit/editor-tables/table-map';
|
|
8
|
-
import type { DraggableData, DraggableType, TableDirection } from '../types';
|
|
8
|
+
import type { DraggableData, DraggableType, PluginInjectionAPI, TableDirection } from '../types';
|
|
9
9
|
export declare const getTargetIndex: (selectedIndexes: number[], direction: DraggableData['direction']) => number;
|
|
10
10
|
export declare const canMove: (sourceType: DraggableType, direction: DraggableData['direction'], totalItemsOfSourceTypeCount: number, selection: Selection, selectionRect?: Rect) => boolean;
|
|
11
11
|
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';
|
|
@@ -14,4 +14,4 @@ export interface DragMenuConfig extends Omit<DropdownOptionT<Command>, 'icon'> {
|
|
|
14
14
|
icon?: React.ComponentType<React.PropsWithChildren<IconProps>>;
|
|
15
15
|
keymap?: string;
|
|
16
16
|
}
|
|
17
|
-
export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, hasMergedCellsInTable: boolean, editorView: EditorView, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean, tableDuplicateCellColouring?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, tableSortColumnReorder?: boolean, ariaNotifyPlugin?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined) => DragMenuConfig[];
|
|
17
|
+
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, tableDuplicateCellColouring?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, tableSortColumnReorder?: boolean, ariaNotifyPlugin?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined) => DragMenuConfig[];
|