@atlaskit/editor-plugin-table 24.4.22 → 24.4.23

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 24.4.23
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
3
9
  ## 24.4.22
4
10
 
5
11
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
2
2
  import type { ActionType, RowOrColumnMovedState } from './types';
3
3
  import type { Command } from '@atlaskit/editor-common/types';
4
- export declare const updateRowOrColumnMoved: (nextState: Omit<RowOrColumnMovedState, "currentActions">, nextAction: ActionType) => Command;
4
+ export declare const updateRowOrColumnMoved: (nextState: Omit<RowOrColumnMovedState, 'currentActions'>, nextAction: ActionType) => Command;
5
5
  export declare const resetRowOrColumnMovedTransform: () => (tr: Transaction) => Transaction;
6
- export declare const updateRowOrColumnMovedTransform: (nextState: Omit<RowOrColumnMovedState, "currentActions">, nextAction: ActionType) => (state: EditorState, tr: Transaction) => Transaction;
6
+ export declare const updateRowOrColumnMovedTransform: (nextState: Omit<RowOrColumnMovedState, 'currentActions'>, nextAction: ActionType) => (state: EditorState, tr: Transaction) => Transaction;
@@ -1,6 +1,6 @@
1
1
  import type { ActionType, RowOrColumnMovedState } from '../types';
2
- export declare const getMovedPayload: (nextState: Omit<RowOrColumnMovedState, "currentActions">, nextAction: ActionType, prevState: RowOrColumnMovedState) => 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
- type: "row" | "column" | undefined;
5
+ type: 'row' | 'column' | undefined;
6
6
  };
@@ -4,5 +4,5 @@ export declare const closeActiveTableMenu: (api?: PluginInjectionAPI | null, opt
4
4
  skipUserIntent?: boolean;
5
5
  }) => EditorCommand;
6
6
  export declare const toggleActiveTableMenu: (activeTableMenu: Exclude<ActiveTableMenu, {
7
- type: "none";
7
+ type: 'none';
8
8
  }>, currentActiveTableMenu: ActiveTableMenu | undefined, api?: PluginInjectionAPI | null) => EditorCommand;
@@ -14,10 +14,10 @@ export declare const transformSliceRemoveCellBackgroundColor: (slice: Slice, sch
14
14
  export declare const transformSliceToFixDarkModeDefaultBackgroundColor: (slice: Slice, schema: Schema) => Slice;
15
15
  export declare const transformSliceToAddTableHeaders: (slice: Slice, schema: Schema) => Slice;
16
16
  export declare const transformSliceToRemoveColumnsWidths: (slice: Slice, schema: Schema) => Slice;
17
- export declare const countCellsInSlice: (slice: Slice, schema: Schema, type?: "row" | "column") => number;
18
- export declare const getTableSelectionType: (selection: Selection) => "row" | "column" | undefined;
19
- export declare const getTableElementMoveTypeBySlice: (slice: Slice, state: EditorState) => "row" | "column" | undefined;
20
- export declare const isInsideFirstCellOfRowOrColumn: (selection: Selection, type?: "row" | "column") => boolean;
17
+ export declare const countCellsInSlice: (slice: Slice, schema: Schema, type?: 'row' | 'column') => number;
18
+ export declare const getTableSelectionType: (selection: Selection) => 'row' | 'column' | undefined;
19
+ export declare const getTableElementMoveTypeBySlice: (slice: Slice, state: EditorState) => 'row' | 'column' | undefined;
20
+ export declare const isInsideFirstCellOfRowOrColumn: (selection: Selection, type?: 'row' | 'column') => boolean;
21
21
  export declare const deleteTable: Command;
22
22
  export declare const deleteTableIfSelected: Command;
23
23
  export declare const convertFirstRowToHeader: (schema: Schema) => (tr: Transaction) => Transaction;
@@ -2,9 +2,9 @@ import type { IntlShape } from 'react-intl/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>["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;
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;
@@ -4,7 +4,7 @@ import type { Command } from '@atlaskit/editor-common/types';
4
4
  * Table layout toggle logic
5
5
  * default -> wide -> full-width -> default
6
6
  */
7
- export declare const getNextLayout: (currentLayout: TableLayout) => "default" | "wide" | "full-width";
7
+ export declare const getNextLayout: (currentLayout: TableLayout) => 'default' | 'wide' | 'full-width';
8
8
  export declare const toggleHeaderRow: Command;
9
9
  export declare const toggleHeaderColumn: Command;
10
10
  export declare const toggleNumberColumn: Command;
@@ -6,9 +6,9 @@ interface DragAndDropAction<T, D> {
6
6
  type: T;
7
7
  }
8
8
  export declare const DragAndDropActionType: {
9
- readonly SET_DROP_TARGET: "SET_DROP_TARGET";
10
- readonly CLEAR_DROP_TARGET: "CLEAR_DROP_TARGET";
11
- readonly TOGGLE_DRAG_MENU: "TOGGLE_DRAG_MENU";
9
+ readonly SET_DROP_TARGET: 'SET_DROP_TARGET';
10
+ readonly CLEAR_DROP_TARGET: 'CLEAR_DROP_TARGET';
11
+ readonly TOGGLE_DRAG_MENU: 'TOGGLE_DRAG_MENU';
12
12
  };
13
13
  type DragAndDropSetDropTargetAction = DragAndDropAction<typeof DragAndDropActionType.SET_DROP_TARGET, {
14
14
  decorationSet: DecorationSet;
@@ -8,6 +8,6 @@ import type { DraggableData, DraggableType, TableDirection } from '../../types';
8
8
  import type { TriggerType } from './types';
9
9
  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;
10
10
  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;
11
- export declare const moveSourceWithAnalyticsViaShortcut: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, ariaNotify?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void, getIntl?: () => IntlShape) => (sourceType: DraggableType, direction: DraggableData["direction"]) => Command;
12
- 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;
11
+ export declare const moveSourceWithAnalyticsViaShortcut: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, ariaNotify?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void, getIntl?: () => IntlShape) => (sourceType: DraggableType, direction: DraggableData['direction']) => Command;
12
+ 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;
13
13
  export declare const toggleDragMenuWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (isDragMenuOpen: boolean | undefined, direction?: TableDirection, index?: number, trigger?: TriggerType) => Command;
@@ -7,4 +7,4 @@ export declare const setDropTarget: (type: DropTargetType, index: number, hasMer
7
7
  export declare const clearDropTarget: (tr?: Transaction) => Command;
8
8
  export declare const moveSource: (sourceType: DraggableType, sourceIndexes: number[], targetIndex: number, tr?: Transaction) => Command;
9
9
  export declare const toggleDragMenu: (isDragMenuOpen: boolean | undefined, direction?: TableDirection, index?: number, trigger?: TriggerType) => Command;
10
- export declare const cloneSource: (sourceType: DraggableType, sourceIndexes: number[], targetIndex: number, targetDirection: "start" | "end", tr?: Transaction) => Command;
10
+ export declare const cloneSource: (sourceType: DraggableType, sourceIndexes: number[], targetIndex: number, targetDirection: 'start' | 'end', tr?: Transaction) => Command;
@@ -1,6 +1,6 @@
1
1
  export declare const DropTargetType: {
2
- readonly NONE: "none";
3
- readonly ROW: "row";
4
- readonly COLUMN: "column";
2
+ readonly NONE: 'none';
3
+ readonly ROW: 'row';
4
+ readonly COLUMN: 'column';
5
5
  };
6
6
  export type DropTargetType = (typeof DropTargetType)[keyof typeof DropTargetType];
@@ -1,4 +1,4 @@
1
1
  import type { DragAndDropPluginAction } from './actions';
2
2
  import type { DragAndDropPluginState } from './types';
3
- declare const _default: (pluginState: DragAndDropPluginState, action: DragAndDropPluginAction) => DragAndDropPluginState;
4
3
  export default _default;
4
+ declare function _default(pluginState: DragAndDropPluginState, action: DragAndDropPluginAction): DragAndDropPluginState;
@@ -1,3 +1,3 @@
1
1
  import type { TablePluginAction, TablePluginState } from '../types';
2
- declare const _default: (pluginState: TablePluginState, action: TablePluginAction) => TablePluginState;
3
2
  export default _default;
3
+ declare function _default(pluginState: TablePluginState, action: TablePluginAction): TablePluginState;
@@ -1,3 +1,3 @@
1
1
  import type { ColumnResizingPluginAction, ColumnResizingPluginState } from '../../types';
2
- declare const _default: (pluginState: ColumnResizingPluginState, action: ColumnResizingPluginAction) => ColumnResizingPluginState;
3
2
  export default _default;
3
+ declare function _default(pluginState: ColumnResizingPluginState, action: ColumnResizingPluginAction): ColumnResizingPluginState;
@@ -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: "row" | "column" | "table", tr: Transaction | ReadonlyTransaction, hoveredIndexes: number[], danger?: boolean, selected?: boolean) => Decoration[];
12
+ export declare const createControlsHoverDecoration: (cells: Cell[], type: 'row' | 'column' | 'table', tr: Transaction | ReadonlyTransaction, 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, "left">, includeTooltip: boolean | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI) => Decoration[];
17
- export declare const createColumnLineResize: (selection: Selection, cellColumnPositioning: Omit<CellColumnPositioning, "left">) => Decoration[];
16
+ export declare const createResizeHandleDecoration: (tr: Transaction | ReadonlyTransaction, rowIndexTarget: number, columnEndIndexTarget: Omit<CellColumnPositioning, 'left'>, includeTooltip: boolean | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI) => Decoration[];
17
+ export declare const createColumnLineResize: (selection: Selection, cellColumnPositioning: Omit<CellColumnPositioning, 'left'>) => 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[];
@@ -31,8 +31,8 @@ export declare const isTableDragHandleButton: (target: EventTarget | null) => bo
31
31
  * @param gapInPixels
32
32
  * @returns
33
33
  */
34
- export declare const getMousePositionHorizontalRelativeByElement: (mouseEvent: MouseEvent, offsetX: number, gapInPixels?: number) => "left" | "right" | null;
35
- export declare const getMousePositionVerticalRelativeByElement: (mouseEvent: MouseEvent) => "top" | "bottom" | null;
34
+ export declare const getMousePositionHorizontalRelativeByElement: (mouseEvent: MouseEvent, offsetX: number, gapInPixels?: number) => 'left' | 'right' | null;
35
+ export declare const getMousePositionVerticalRelativeByElement: (mouseEvent: MouseEvent) => 'top' | 'bottom' | null;
36
36
  export declare const hasResizeHandler: ({ columnEndIndexTarget, target, }: {
37
37
  columnEndIndexTarget: number;
38
38
  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, IconProps } from '@atlaskit/icon/types';
9
9
  import type { DraggableData, DraggableType, PluginInjectionAPI, TableDirection } from '../../types';
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;
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
  icon?: React.ComponentType<React.PropsWithChildren<NewIconProps>>;
@@ -14,7 +14,7 @@ export declare const hasMergedCellsInSelection: (indexes: number[], type: MergeT
14
14
  * @param direction - check selection is selected by row or column
15
15
  * @returns boolean
16
16
  */
17
- export declare const checkEdgeHasMergedCells: (indexes: number[], tableMap: TableMap, direction: "row" | "column") => boolean;
17
+ export declare const checkEdgeHasMergedCells: (indexes: number[], tableMap: TableMap, direction: 'row' | 'column') => boolean;
18
18
  /**
19
19
  * this function will find the duplicate position in the array(table map position array).
20
20
  *
@@ -21,5 +21,5 @@ type DragControlsProps = {
21
21
  updateCellHoverLocation: (rowIndex: number) => void;
22
22
  };
23
23
  export declare const DragControls: ({ tableRef, tableNode, tableWidth, hoveredCell, tableActive, editorView, isInDanger, isResizing, isTableHovered, hoverRows, selectRow, selectRows, updateCellHoverLocation, api, selection, }: DragControlsProps) => React.JSX.Element | null;
24
- export declare const DragControlsWithSelection: ({ editorView, tableRef, tableNode, tableWidth, tableActive, hoveredCell, isInDanger, isTableHovered, isResizing, hoverRows, selectRow, selectRows, updateCellHoverLocation, api, }: Exclude<DragControlsProps, "selection">) => React.JSX.Element;
24
+ export declare const DragControlsWithSelection: ({ editorView, tableRef, tableNode, tableWidth, tableActive, hoveredCell, isInDanger, isTableHovered, isResizing, hoverRows, selectRow, selectRows, updateCellHoverLocation, api, }: Exclude<DragControlsProps, 'selection'>) => React.JSX.Element;
25
25
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "24.4.22",
3
+ "version": "24.4.23",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -29,7 +29,7 @@
29
29
  "@atlaskit/editor-plugin-batch-attribute-updates": "^12.0.0",
30
30
  "@atlaskit/editor-plugin-content-insertion": "^12.0.0",
31
31
  "@atlaskit/editor-plugin-editor-viewmode": "^14.0.0",
32
- "@atlaskit/editor-plugin-extension": "15.0.38",
32
+ "@atlaskit/editor-plugin-extension": "15.0.39",
33
33
  "@atlaskit/editor-plugin-guideline": "^12.0.0",
34
34
  "@atlaskit/editor-plugin-interaction": "^23.0.0",
35
35
  "@atlaskit/editor-plugin-limited-mode": "^9.0.0",
@@ -45,17 +45,17 @@
45
45
  "@atlaskit/editor-ui-control-model": "^2.2.0",
46
46
  "@atlaskit/icon": "^37.2.0",
47
47
  "@atlaskit/icon-lab": "^7.4.0",
48
- "@atlaskit/insm": "^1.0.0",
48
+ "@atlaskit/insm": "^1.1.0",
49
49
  "@atlaskit/menu": "^9.2.0",
50
50
  "@atlaskit/platform-feature-flags": "^2.1.0",
51
51
  "@atlaskit/pragmatic-drag-and-drop": "^2.0.0",
52
52
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.0.0",
53
53
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^2.0.0",
54
54
  "@atlaskit/primitives": "^22.2.0",
55
- "@atlaskit/tmp-editor-statsig": "^134.0.0",
55
+ "@atlaskit/tmp-editor-statsig": "^135.0.0",
56
56
  "@atlaskit/toggle": "^17.1.0",
57
57
  "@atlaskit/tokens": "^16.3.0",
58
- "@atlaskit/tooltip": "^23.1.0",
58
+ "@atlaskit/tooltip": "^23.2.0",
59
59
  "@babel/runtime": "^7.0.0",
60
60
  "@compiled/react": "^1.0.0",
61
61
  "@emotion/react": "^11.7.1",
@@ -67,7 +67,7 @@
67
67
  "uuid": "^3.1.0"
68
68
  },
69
69
  "peerDependencies": {
70
- "@atlaskit/editor-common": "^116.40.0",
70
+ "@atlaskit/editor-common": "^116.41.0",
71
71
  "react": "^18.2.0",
72
72
  "react-dom": "^18.2.0",
73
73
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"