@atlaskit/editor-tables 2.9.54 → 2.9.56
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 +13 -0
- package/dist/es2019/utils/find.js +0 -1
- package/dist/esm/utils/find.js +0 -1
- package/dist/types/cell-bookmark.d.ts +4 -3
- package/dist/types/cell-selection.d.ts +6 -4
- package/dist/types/utils/analytics-helpers.d.ts +1 -1
- package/dist/types/utils/cells.d.ts +3 -2
- package/dist/types/utils/clone-tr.d.ts +1 -1
- package/dist/types/utils/colspan.d.ts +1 -1
- package/dist/types/utils/draw-cell-selection.d.ts +1 -1
- package/dist/types/utils/empty-cells.d.ts +3 -3
- package/dist/types/utils/find.d.ts +4 -4
- package/dist/types/utils/fix-tables.d.ts +2 -2
- package/dist/types/utils/for-each-cell.d.ts +2 -2
- package/dist/types/utils/get-cell-selection-ranges.d.ts +1 -1
- package/dist/types/utils/get-cells-in-column.d.ts +2 -2
- package/dist/types/utils/get-cells-in-row.d.ts +2 -2
- package/dist/types/utils/get-cells-in-table.d.ts +2 -2
- package/dist/types/utils/get-selection-rect.d.ts +2 -2
- package/dist/types/utils/go-to-next-cell.d.ts +1 -1
- package/dist/types/utils/handle-paste.d.ts +2 -2
- package/dist/types/utils/is-selected.d.ts +2 -2
- package/dist/types/utils/is-selection-type.d.ts +2 -2
- package/dist/types/utils/normalize-selection.d.ts +1 -1
- package/dist/types/utils/remove-column.d.ts +2 -2
- package/dist/types/utils/remove-row.d.ts +2 -2
- package/dist/types/utils/remove-table.d.ts +1 -1
- package/dist/types/utils/reorder-utils.d.ts +2 -2
- package/dist/types/utils/replace-table.d.ts +1 -1
- package/dist/types/utils/selection-cell.d.ts +2 -2
- package/dist/types/utils/selection-rect.d.ts +2 -2
- package/dist/types/utils/set-cell-attrs.d.ts +3 -3
- package/dist/types/utils/split-cell-with-type.d.ts +3 -2
- package/dist/types/utils/split-cell.d.ts +1 -1
- package/dist/types/utils/table-node-types.d.ts +1 -1
- package/dist/types/utils/tables.d.ts +2 -2
- package/dist/types/utils/test-utils.d.ts +1 -1
- package/dist/types/utils/toggle-header.d.ts +3 -3
- package/dist/types-ts4.5/cell-bookmark.d.ts +4 -3
- package/dist/types-ts4.5/cell-selection.d.ts +6 -4
- package/dist/types-ts4.5/utils/analytics-helpers.d.ts +1 -1
- package/dist/types-ts4.5/utils/cells.d.ts +3 -2
- package/dist/types-ts4.5/utils/clone-tr.d.ts +1 -1
- package/dist/types-ts4.5/utils/colspan.d.ts +1 -1
- package/dist/types-ts4.5/utils/draw-cell-selection.d.ts +1 -1
- package/dist/types-ts4.5/utils/empty-cells.d.ts +3 -3
- package/dist/types-ts4.5/utils/find.d.ts +4 -4
- package/dist/types-ts4.5/utils/fix-tables.d.ts +2 -2
- package/dist/types-ts4.5/utils/for-each-cell.d.ts +2 -2
- package/dist/types-ts4.5/utils/get-cell-selection-ranges.d.ts +1 -1
- package/dist/types-ts4.5/utils/get-cells-in-column.d.ts +2 -2
- package/dist/types-ts4.5/utils/get-cells-in-row.d.ts +2 -2
- package/dist/types-ts4.5/utils/get-cells-in-table.d.ts +2 -2
- package/dist/types-ts4.5/utils/get-selection-rect.d.ts +2 -2
- package/dist/types-ts4.5/utils/go-to-next-cell.d.ts +1 -1
- package/dist/types-ts4.5/utils/handle-paste.d.ts +2 -2
- package/dist/types-ts4.5/utils/is-selected.d.ts +2 -2
- package/dist/types-ts4.5/utils/is-selection-type.d.ts +2 -2
- package/dist/types-ts4.5/utils/normalize-selection.d.ts +1 -1
- package/dist/types-ts4.5/utils/remove-column.d.ts +2 -2
- package/dist/types-ts4.5/utils/remove-row.d.ts +2 -2
- package/dist/types-ts4.5/utils/remove-table.d.ts +1 -1
- package/dist/types-ts4.5/utils/reorder-utils.d.ts +2 -2
- package/dist/types-ts4.5/utils/replace-table.d.ts +1 -1
- package/dist/types-ts4.5/utils/selection-cell.d.ts +2 -2
- package/dist/types-ts4.5/utils/selection-rect.d.ts +2 -2
- package/dist/types-ts4.5/utils/set-cell-attrs.d.ts +3 -3
- package/dist/types-ts4.5/utils/split-cell-with-type.d.ts +3 -2
- package/dist/types-ts4.5/utils/split-cell.d.ts +1 -1
- package/dist/types-ts4.5/utils/table-node-types.d.ts +1 -1
- package/dist/types-ts4.5/utils/tables.d.ts +2 -2
- package/dist/types-ts4.5/utils/test-utils.d.ts +1 -1
- package/dist/types-ts4.5/utils/toggle-header.d.ts +3 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-tables
|
|
2
2
|
|
|
3
|
+
## 2.9.56
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`5221db0d676ef`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5221db0d676ef) -
|
|
8
|
+
Mechanical type-import autofix for tables, collab, and synchrony packages.
|
|
9
|
+
|
|
10
|
+
## 2.9.55
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 2.9.54
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { findParentNode, findParentNodeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
2
2
|
import { TableMap } from '../table-map';
|
|
3
|
-
|
|
4
3
|
// Iterates over parent nodes, returning the closest table node.
|
|
5
4
|
export const findTable = selection => findParentNode(node => node.type.spec.tableRole && node.type.spec.tableRole === 'table')(selection);
|
|
6
5
|
|
package/dist/esm/utils/find.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { findParentNode, findParentNodeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
2
2
|
import { TableMap } from '../table-map';
|
|
3
|
-
|
|
4
3
|
// Iterates over parent nodes, returning the closest table node.
|
|
5
4
|
export var findTable = function findTable(selection) {
|
|
6
5
|
return findParentNode(function (node) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Selection
|
|
3
|
-
import {
|
|
1
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import type { SelectionBookmark } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import type { Mappable } from '@atlaskit/editor-prosemirror/transform';
|
|
4
5
|
export declare class CellBookmark implements SelectionBookmark {
|
|
5
6
|
readonly anchor: number;
|
|
6
7
|
readonly head: number;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
+
import type { Mapping } from '@atlaskit/editor-prosemirror/transform';
|
|
4
6
|
import { CellBookmark } from './cell-bookmark';
|
|
5
|
-
import {
|
|
7
|
+
import type { SerializedCellSelection } from './types';
|
|
6
8
|
export declare class CellSelection extends Selection {
|
|
7
9
|
readonly $anchorCell: ResolvedPos;
|
|
8
10
|
readonly $headCell: ResolvedPos;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import { TableMap } from '../table-map';
|
|
3
3
|
import { findTable } from './find';
|
|
4
4
|
export declare function getSelectedTableInfo(selection: Selection): {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Node
|
|
2
|
-
import {
|
|
1
|
+
import { Node } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { Axis } from '../types';
|
|
3
4
|
export declare function pointsAtCell($pos: ResolvedPos): false | Node | null;
|
|
4
5
|
export declare function cellNear($pos: ResolvedPos): ResolvedPos | null;
|
|
5
6
|
export declare function cellAround($pos: ResolvedPos): ResolvedPos | null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
export declare const cloneTr: (tr: Transaction) => Transaction;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { CellAttributes, CellAttributesWithColSpan } from '../types';
|
|
2
2
|
export declare function removeColSpan(attrs: CellAttributes, pos: number, n?: number): CellAttributes;
|
|
3
3
|
export declare function assertColspan(attrs: CellAttributes): void;
|
|
4
4
|
export declare function addColSpan<T extends CellAttributesWithColSpan>(attrs: T, pos: number, n?: number): T;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
export declare function drawCellSelection(state: EditorState): DecorationSet | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import type { NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
4
4
|
export declare const emptyCell: (cell: NodeWithPos, schema: Schema) => (tr: Transaction) => Transaction;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
4
|
+
import type { Rect } from '../table-map';
|
|
5
5
|
export declare const findTable: (selection: Selection) => ContentNodeWithPos | undefined;
|
|
6
6
|
export declare const findTableClosestToPos: ($pos: ResolvedPos) => ContentNodeWithPos | undefined;
|
|
7
7
|
export declare const findCellClosestToPos: ($pos: ResolvedPos) => ContentNodeWithPos | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
export type ReportFixedTable = ({ state, tr, reason, }: {
|
|
4
4
|
reason: string;
|
|
5
5
|
state: EditorState;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
3
3
|
export declare const forEachCellInColumn: (columnIndex: number, cellTransform: (cell: ContentNodeWithPos, tr: Transaction) => Transaction, setCursorToLastCell?: boolean) => (tr: Transaction) => Transaction;
|
|
4
4
|
export declare const forEachCellInRow: (rowIndex: number, cellTransform: (cell: ContentNodeWithPos, tr: Transaction) => Transaction, setCursorToLastCell: boolean) => (tr: Transaction) => Transaction;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import { SelectionRange } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
export declare function getCellSelectionRanges($anchorCell: ResolvedPos, $headCell: ResolvedPos): SelectionRange[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
3
3
|
export declare const getCellsInColumn: (columnIndexes: number | number[]) => (selection: Selection) => ContentNodeWithPos[] | undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
3
3
|
export declare const getCellsInRow: (rowIndex: number | number[]) => (selection: Selection) => ContentNodeWithPos[] | undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
3
3
|
export declare const getCellsInTable: (selection: Selection) => ContentNodeWithPos[] | undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { Rect } from '../table-map';
|
|
3
3
|
export declare const getSelectionRect: (selection: Selection) => Rect | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Command, Direction } from '../types';
|
|
2
2
|
export declare function goToNextCell(direction: Direction): Command;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
type PasteOptions = {
|
|
4
4
|
pasteSource: string;
|
|
5
5
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { Rect } from '../table-map';
|
|
3
3
|
export declare const isRectSelected: (rect: Rect) => (selection: Selection) => boolean;
|
|
4
4
|
export declare const isColumnSelected: (columnIndex: number) => (selection: Selection) => boolean;
|
|
5
5
|
export declare const isRowSelected: (rowIndex: number) => (selection: Selection) => boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { NodeSelection, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
interface CellSelectionShape extends Selection {
|
|
4
4
|
$anchorCell: ResolvedPos;
|
|
5
5
|
$headCell: ResolvedPos;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
export declare function normalizeSelection(state: EditorState, transaction?: Transaction, allowTableNodeSelection?: boolean): Transaction | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
export declare const removeColumnAt: (columnIndex: number) => (tr: Transaction) => Transaction;
|
|
4
4
|
export declare const removeSelectedColumns: (tr: Transaction) => Transaction;
|
|
5
5
|
export declare const removeColumnClosestToPos: ($pos: ResolvedPos) => (tr: Transaction) => Transaction;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
export declare const removeRowAt: (rowIndex: number) => (tr: Transaction) => Transaction;
|
|
4
4
|
export declare const removeSelectedRows: (tr: Transaction) => Transaction;
|
|
5
5
|
export declare const removeRowClosestToPos: ($pos: ResolvedPos) => (tr: Transaction) => Transaction;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
export declare const removeTable: (tr: Transaction) => Transaction;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
3
3
|
type ArrayOfRows = Array<PMNode | null>[];
|
|
4
4
|
export declare const transpose: (array: Array<any>) => Array<any>;
|
|
5
5
|
export declare const convertArrayOfRowsToTableNode: (tableNode: PMNode, arrayOfNodes: ArrayOfRows) => PMNode;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import {
|
|
2
|
+
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
export declare const replaceSelectedTable: (state: EditorState, content: string | Slice) => Transaction;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
export declare function selectionCell(selection: Selection): ResolvedPos | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { Rect, TableContext } from '../table-map';
|
|
3
3
|
export type SelectionRect = Rect & TableContext;
|
|
4
4
|
export declare function selectedRect(state: EditorState): SelectionRect;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
3
|
+
import type { CellAttributes } from '../types';
|
|
4
4
|
export declare const setCellAttrs: (cell: NodeWithPos, attrs: CellAttributes) => (tr: Transaction) => Transaction;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { NodeType, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { Command } from '../types';
|
|
3
4
|
export declare function cellWrapping($pos: ResolvedPos): PMNode | null;
|
|
4
5
|
export type GetCellTypeArgs = {
|
|
5
6
|
col: number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Command } from '../types';
|
|
2
2
|
export declare const splitCell: Command;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
export declare function isInTable(state: EditorState): boolean;
|
|
4
4
|
export declare function inSameTable($a: ResolvedPos, $b: ResolvedPos): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { Command } from '../types';
|
|
2
|
+
import type { SelectionRect } from './selection-rect';
|
|
3
|
+
import type { TableNodeCache } from './table-node-types';
|
|
4
4
|
export type ToggleType = 'column' | 'row';
|
|
5
5
|
export declare function isHeaderEnabledByType(type: ToggleType, rect: SelectionRect, types: TableNodeCache): boolean;
|
|
6
6
|
export declare function toggleHeader(type: ToggleType): Command;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Selection
|
|
3
|
-
import {
|
|
1
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import type { SelectionBookmark } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import type { Mappable } from '@atlaskit/editor-prosemirror/transform';
|
|
4
5
|
export declare class CellBookmark implements SelectionBookmark {
|
|
5
6
|
readonly anchor: number;
|
|
6
7
|
readonly head: number;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
+
import type { Mapping } from '@atlaskit/editor-prosemirror/transform';
|
|
4
6
|
import { CellBookmark } from './cell-bookmark';
|
|
5
|
-
import {
|
|
7
|
+
import type { SerializedCellSelection } from './types';
|
|
6
8
|
export declare class CellSelection extends Selection {
|
|
7
9
|
readonly $anchorCell: ResolvedPos;
|
|
8
10
|
readonly $headCell: ResolvedPos;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import { TableMap } from '../table-map';
|
|
3
3
|
import { findTable } from './find';
|
|
4
4
|
export declare function getSelectedTableInfo(selection: Selection): {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Node
|
|
2
|
-
import {
|
|
1
|
+
import { Node } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { Axis } from '../types';
|
|
3
4
|
export declare function pointsAtCell($pos: ResolvedPos): false | Node | null;
|
|
4
5
|
export declare function cellNear($pos: ResolvedPos): ResolvedPos | null;
|
|
5
6
|
export declare function cellAround($pos: ResolvedPos): ResolvedPos | null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
export declare const cloneTr: (tr: Transaction) => Transaction;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { CellAttributes, CellAttributesWithColSpan } from '../types';
|
|
2
2
|
export declare function removeColSpan(attrs: CellAttributes, pos: number, n?: number): CellAttributes;
|
|
3
3
|
export declare function assertColspan(attrs: CellAttributes): void;
|
|
4
4
|
export declare function addColSpan<T extends CellAttributesWithColSpan>(attrs: T, pos: number, n?: number): T;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
export declare function drawCellSelection(state: EditorState): DecorationSet | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import type { NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
4
4
|
export declare const emptyCell: (cell: NodeWithPos, schema: Schema) => (tr: Transaction) => Transaction;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
4
|
+
import type { Rect } from '../table-map';
|
|
5
5
|
export declare const findTable: (selection: Selection) => ContentNodeWithPos | undefined;
|
|
6
6
|
export declare const findTableClosestToPos: ($pos: ResolvedPos) => ContentNodeWithPos | undefined;
|
|
7
7
|
export declare const findCellClosestToPos: ($pos: ResolvedPos) => ContentNodeWithPos | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
export type ReportFixedTable = ({ state, tr, reason, }: {
|
|
4
4
|
reason: string;
|
|
5
5
|
state: EditorState;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
3
3
|
export declare const forEachCellInColumn: (columnIndex: number, cellTransform: (cell: ContentNodeWithPos, tr: Transaction) => Transaction, setCursorToLastCell?: boolean) => (tr: Transaction) => Transaction;
|
|
4
4
|
export declare const forEachCellInRow: (rowIndex: number, cellTransform: (cell: ContentNodeWithPos, tr: Transaction) => Transaction, setCursorToLastCell: boolean) => (tr: Transaction) => Transaction;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import { SelectionRange } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
export declare function getCellSelectionRanges($anchorCell: ResolvedPos, $headCell: ResolvedPos): SelectionRange[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
3
3
|
export declare const getCellsInColumn: (columnIndexes: number | number[]) => (selection: Selection) => ContentNodeWithPos[] | undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
3
3
|
export declare const getCellsInRow: (rowIndex: number | number[]) => (selection: Selection) => ContentNodeWithPos[] | undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
3
3
|
export declare const getCellsInTable: (selection: Selection) => ContentNodeWithPos[] | undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { Rect } from '../table-map';
|
|
3
3
|
export declare const getSelectionRect: (selection: Selection) => Rect | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Command, Direction } from '../types';
|
|
2
2
|
export declare function goToNextCell(direction: Direction): Command;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
type PasteOptions = {
|
|
4
4
|
pasteSource: string;
|
|
5
5
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { Rect } from '../table-map';
|
|
3
3
|
export declare const isRectSelected: (rect: Rect) => (selection: Selection) => boolean;
|
|
4
4
|
export declare const isColumnSelected: (columnIndex: number) => (selection: Selection) => boolean;
|
|
5
5
|
export declare const isRowSelected: (rowIndex: number) => (selection: Selection) => boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { NodeSelection, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
interface CellSelectionShape extends Selection {
|
|
4
4
|
$anchorCell: ResolvedPos;
|
|
5
5
|
$headCell: ResolvedPos;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
export declare function normalizeSelection(state: EditorState, transaction?: Transaction, allowTableNodeSelection?: boolean): Transaction | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
export declare const removeColumnAt: (columnIndex: number) => (tr: Transaction) => Transaction;
|
|
4
4
|
export declare const removeSelectedColumns: (tr: Transaction) => Transaction;
|
|
5
5
|
export declare const removeColumnClosestToPos: ($pos: ResolvedPos) => (tr: Transaction) => Transaction;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
export declare const removeRowAt: (rowIndex: number) => (tr: Transaction) => Transaction;
|
|
4
4
|
export declare const removeSelectedRows: (tr: Transaction) => Transaction;
|
|
5
5
|
export declare const removeRowClosestToPos: ($pos: ResolvedPos) => (tr: Transaction) => Transaction;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
export declare const removeTable: (tr: Transaction) => Transaction;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
3
3
|
type ArrayOfRows = Array<PMNode | null>[];
|
|
4
4
|
export declare const transpose: (array: Array<any>) => Array<any>;
|
|
5
5
|
export declare const convertArrayOfRowsToTableNode: (tableNode: PMNode, arrayOfNodes: ArrayOfRows) => PMNode;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import {
|
|
2
|
+
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
export declare const replaceSelectedTable: (state: EditorState, content: string | Slice) => Transaction;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
export declare function selectionCell(selection: Selection): ResolvedPos | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { Rect, TableContext } from '../table-map';
|
|
3
3
|
export type SelectionRect = Rect & TableContext;
|
|
4
4
|
export declare function selectedRect(state: EditorState): SelectionRect;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
3
|
+
import type { CellAttributes } from '../types';
|
|
4
4
|
export declare const setCellAttrs: (cell: NodeWithPos, attrs: CellAttributes) => (tr: Transaction) => Transaction;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { NodeType, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { Command } from '../types';
|
|
3
4
|
export declare function cellWrapping($pos: ResolvedPos): PMNode | null;
|
|
4
5
|
export type GetCellTypeArgs = {
|
|
5
6
|
col: number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Command } from '../types';
|
|
2
2
|
export declare const splitCell: Command;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
export declare function isInTable(state: EditorState): boolean;
|
|
4
4
|
export declare function inSameTable($a: ResolvedPos, $b: ResolvedPos): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { Command } from '../types';
|
|
2
|
+
import type { SelectionRect } from './selection-rect';
|
|
3
|
+
import type { TableNodeCache } from './table-node-types';
|
|
4
4
|
export type ToggleType = 'column' | 'row';
|
|
5
5
|
export declare function isHeaderEnabledByType(type: ToggleType, rect: SelectionRect, types: TableNodeCache): boolean;
|
|
6
6
|
export declare function toggleHeader(type: ToggleType): Command;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-tables",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.56",
|
|
4
4
|
"description": "A package that contains common classes and utility functions for editor tables",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
31
31
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
32
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
32
|
+
"@atlaskit/tmp-editor-statsig": "^46.2.0",
|
|
33
33
|
"@babel/runtime": "^7.0.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|