@atlaskit/editor-tables 2.7.4 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/CHANGELOG.md +294 -281
  2. package/afm-jira/tsconfig.json +20 -0
  3. package/afm-post-office/tsconfig.json +20 -0
  4. package/dist/cjs/utils/create-table.js +2 -1
  5. package/dist/es2019/utils/create-table.js +2 -1
  6. package/dist/esm/utils/create-table.js +2 -1
  7. package/dist/types/cell-bookmark.d.ts +3 -3
  8. package/dist/types/cell-selection.d.ts +4 -4
  9. package/dist/types/utils/analytics-helpers.d.ts +3 -2
  10. package/dist/types/utils/cells.d.ts +2 -2
  11. package/dist/types/utils/clone-tr.d.ts +1 -1
  12. package/dist/types/utils/colspan.d.ts +1 -1
  13. package/dist/types/utils/copy-paste.d.ts +1 -1
  14. package/dist/types/utils/create-table.d.ts +2 -2
  15. package/dist/types/utils/draw-cell-selection.d.ts +1 -1
  16. package/dist/types/utils/empty-cells.d.ts +3 -3
  17. package/dist/types/utils/find.d.ts +4 -4
  18. package/dist/types/utils/fix-tables.d.ts +2 -2
  19. package/dist/types/utils/for-each-cell.d.ts +2 -2
  20. package/dist/types/utils/get-cell-selection-ranges.d.ts +1 -1
  21. package/dist/types/utils/get-cells-in-column.d.ts +2 -2
  22. package/dist/types/utils/get-cells-in-row.d.ts +2 -2
  23. package/dist/types/utils/get-cells-in-table.d.ts +2 -2
  24. package/dist/types/utils/get-selection-rect.d.ts +2 -2
  25. package/dist/types/utils/go-to-next-cell.d.ts +1 -1
  26. package/dist/types/utils/handle-paste.d.ts +2 -2
  27. package/dist/types/utils/is-selected.d.ts +2 -2
  28. package/dist/types/utils/is-selection-type.d.ts +2 -2
  29. package/dist/types/utils/normalize-selection.d.ts +1 -1
  30. package/dist/types/utils/remove-column.d.ts +2 -2
  31. package/dist/types/utils/remove-row.d.ts +2 -2
  32. package/dist/types/utils/remove-table.d.ts +1 -1
  33. package/dist/types/utils/reorder-utils.d.ts +2 -2
  34. package/dist/types/utils/replace-table.d.ts +1 -1
  35. package/dist/types/utils/selection-cell.d.ts +2 -2
  36. package/dist/types/utils/selection-rect.d.ts +2 -2
  37. package/dist/types/utils/set-cell-attrs.d.ts +3 -3
  38. package/dist/types/utils/split-cell-with-type.d.ts +2 -2
  39. package/dist/types/utils/split-cell.d.ts +1 -1
  40. package/dist/types/utils/table-node-types.d.ts +1 -1
  41. package/dist/types/utils/tables.d.ts +2 -2
  42. package/dist/types/utils/test-utils.d.ts +1 -1
  43. package/dist/types/utils/toggle-header.d.ts +3 -3
  44. package/dist/types/utils.d.ts +2 -2
  45. package/dist/types-ts4.5/cell-bookmark.d.ts +3 -3
  46. package/dist/types-ts4.5/cell-selection.d.ts +4 -4
  47. package/dist/types-ts4.5/utils/analytics-helpers.d.ts +3 -2
  48. package/dist/types-ts4.5/utils/cells.d.ts +2 -2
  49. package/dist/types-ts4.5/utils/clone-tr.d.ts +1 -1
  50. package/dist/types-ts4.5/utils/colspan.d.ts +1 -1
  51. package/dist/types-ts4.5/utils/copy-paste.d.ts +1 -1
  52. package/dist/types-ts4.5/utils/create-table.d.ts +2 -2
  53. package/dist/types-ts4.5/utils/draw-cell-selection.d.ts +1 -1
  54. package/dist/types-ts4.5/utils/empty-cells.d.ts +3 -3
  55. package/dist/types-ts4.5/utils/find.d.ts +4 -4
  56. package/dist/types-ts4.5/utils/fix-tables.d.ts +2 -2
  57. package/dist/types-ts4.5/utils/for-each-cell.d.ts +2 -2
  58. package/dist/types-ts4.5/utils/get-cell-selection-ranges.d.ts +1 -1
  59. package/dist/types-ts4.5/utils/get-cells-in-column.d.ts +2 -2
  60. package/dist/types-ts4.5/utils/get-cells-in-row.d.ts +2 -2
  61. package/dist/types-ts4.5/utils/get-cells-in-table.d.ts +2 -2
  62. package/dist/types-ts4.5/utils/get-selection-rect.d.ts +2 -2
  63. package/dist/types-ts4.5/utils/go-to-next-cell.d.ts +1 -1
  64. package/dist/types-ts4.5/utils/handle-paste.d.ts +2 -2
  65. package/dist/types-ts4.5/utils/is-selected.d.ts +2 -2
  66. package/dist/types-ts4.5/utils/is-selection-type.d.ts +2 -2
  67. package/dist/types-ts4.5/utils/normalize-selection.d.ts +1 -1
  68. package/dist/types-ts4.5/utils/remove-column.d.ts +2 -2
  69. package/dist/types-ts4.5/utils/remove-row.d.ts +2 -2
  70. package/dist/types-ts4.5/utils/remove-table.d.ts +1 -1
  71. package/dist/types-ts4.5/utils/reorder-utils.d.ts +2 -2
  72. package/dist/types-ts4.5/utils/replace-table.d.ts +1 -1
  73. package/dist/types-ts4.5/utils/selection-cell.d.ts +2 -2
  74. package/dist/types-ts4.5/utils/selection-rect.d.ts +2 -2
  75. package/dist/types-ts4.5/utils/set-cell-attrs.d.ts +3 -3
  76. package/dist/types-ts4.5/utils/split-cell-with-type.d.ts +2 -2
  77. package/dist/types-ts4.5/utils/split-cell.d.ts +1 -1
  78. package/dist/types-ts4.5/utils/table-node-types.d.ts +1 -1
  79. package/dist/types-ts4.5/utils/tables.d.ts +2 -2
  80. package/dist/types-ts4.5/utils/test-utils.d.ts +1 -1
  81. package/dist/types-ts4.5/utils/toggle-header.d.ts +3 -3
  82. package/dist/types-ts4.5/utils.d.ts +2 -2
  83. package/package.json +59 -64
  84. package/report.api.md +118 -134
@@ -0,0 +1,20 @@
1
+ {
2
+ "extends": "../../../../tsconfig.entry-points.jira.json",
3
+ "compilerOptions": {
4
+ "declaration": true,
5
+ "target": "es5",
6
+ "outDir": "../../../../../tsDist/@atlaskit__editor-tables/app",
7
+ "composite": true,
8
+ "rootDir": "../"
9
+ },
10
+ "include": [
11
+ "../src/**/*.ts",
12
+ "../src/**/*.tsx"
13
+ ],
14
+ "exclude": [
15
+ "../src/**/__tests__/*",
16
+ "../src/**/*.test.*",
17
+ "../src/**/test.*"
18
+ ],
19
+ "references": []
20
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "extends": "../../../../tsconfig.entry-points.post-office.json",
3
+ "compilerOptions": {
4
+ "declaration": true,
5
+ "target": "es5",
6
+ "outDir": "../../../../../tsDist/@atlaskit__editor-tables/app",
7
+ "composite": true,
8
+ "rootDir": "../"
9
+ },
10
+ "include": [
11
+ "../src/**/*.ts",
12
+ "../src/**/*.tsx"
13
+ ],
14
+ "exclude": [
15
+ "../src/**/__tests__/*",
16
+ "../src/**/*.test.*",
17
+ "../src/**/test.*"
18
+ ],
19
+ "references": []
20
+ }
@@ -52,9 +52,10 @@ var createTable = exports.createTable = function createTable(_ref) {
52
52
  for (var _i = 0; _i < rowsCount; _i++) {
53
53
  rows.push(tableRow.createChecked(null, withHeaderRow && _i === 0 ? headerCells : cells));
54
54
  }
55
+ var width = tableWidth === 'inherit' ? undefined : tableWidth === undefined ? 760 : tableWidth;
55
56
  return table.createChecked({
56
57
  localId: _uuid.uuid.generate(),
57
- width: tableWidth !== null && tableWidth !== void 0 ? tableWidth : 760,
58
+ width: width,
58
59
  layout: layout
59
60
  }, rows);
60
61
  };
@@ -45,9 +45,10 @@ export const createTable = ({
45
45
  for (let i = 0; i < rowsCount; i++) {
46
46
  rows.push(tableRow.createChecked(null, withHeaderRow && i === 0 ? headerCells : cells));
47
47
  }
48
+ const width = tableWidth === 'inherit' ? undefined : tableWidth === undefined ? 760 : tableWidth;
48
49
  return table.createChecked({
49
50
  localId: uuid.generate(),
50
- width: tableWidth !== null && tableWidth !== void 0 ? tableWidth : 760,
51
+ width,
51
52
  layout
52
53
  }, rows);
53
54
  };
@@ -46,9 +46,10 @@ export var createTable = function createTable(_ref) {
46
46
  for (var _i = 0; _i < rowsCount; _i++) {
47
47
  rows.push(tableRow.createChecked(null, withHeaderRow && _i === 0 ? headerCells : cells));
48
48
  }
49
+ var width = tableWidth === 'inherit' ? undefined : tableWidth === undefined ? 760 : tableWidth;
49
50
  return table.createChecked({
50
51
  localId: uuid.generate(),
51
- width: tableWidth !== null && tableWidth !== void 0 ? tableWidth : 760,
52
+ width: width,
52
53
  layout: layout
53
54
  }, rows);
54
55
  };
@@ -1,6 +1,6 @@
1
- import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
- import { Selection, SelectionBookmark } from '@atlaskit/editor-prosemirror/state';
3
- import { Mappable } from '@atlaskit/editor-prosemirror/transform';
1
+ import { type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
+ import { Selection, type SelectionBookmark } from '@atlaskit/editor-prosemirror/state';
3
+ import { type Mappable } from '@atlaskit/editor-prosemirror/transform';
4
4
  export declare class CellBookmark implements SelectionBookmark {
5
5
  readonly anchor: number;
6
6
  readonly head: number;
@@ -1,8 +1,8 @@
1
- import { Node as PMNode, ResolvedPos, Slice } from '@atlaskit/editor-prosemirror/model';
2
- import { Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
3
- import { Mapping } from '@atlaskit/editor-prosemirror/transform';
1
+ import { type Node as PMNode, type ResolvedPos, Slice } from '@atlaskit/editor-prosemirror/model';
2
+ import { Selection, type Transaction } from '@atlaskit/editor-prosemirror/state';
3
+ import { type Mapping } from '@atlaskit/editor-prosemirror/transform';
4
4
  import { CellBookmark } from './cell-bookmark';
5
- import { SerializedCellSelection } from './types';
5
+ import { type SerializedCellSelection } from './types';
6
6
  export declare class CellSelection extends Selection {
7
7
  readonly $anchorCell: ResolvedPos;
8
8
  readonly $headCell: ResolvedPos;
@@ -1,7 +1,8 @@
1
- import { Selection } from '@atlaskit/editor-prosemirror/state';
1
+ import { type Selection } from '@atlaskit/editor-prosemirror/state';
2
2
  import { TableMap } from '../table-map';
3
+ import { findTable } from './find';
3
4
  export declare function getSelectedTableInfo(selection: Selection): {
4
- table: import("prosemirror-utils").ContentNodeWithPos | undefined;
5
+ table: ReturnType<typeof findTable> | undefined;
5
6
  map: TableMap | undefined;
6
7
  totalRowCount: number;
7
8
  totalColumnCount: number;
@@ -1,5 +1,5 @@
1
- import { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
2
- import { Axis } from '../types';
1
+ import { type ResolvedPos } from '@atlaskit/editor-prosemirror/model';
2
+ import { type Axis } from '../types';
3
3
  export declare function pointsAtCell($pos: ResolvedPos): false | import("prosemirror-model").Node | null;
4
4
  export declare function cellNear($pos: ResolvedPos): ResolvedPos | null;
5
5
  export declare function cellAround($pos: ResolvedPos): ResolvedPos | null;
@@ -1,2 +1,2 @@
1
- import { Transaction } from '@atlaskit/editor-prosemirror/state';
1
+ import { type Transaction } from '@atlaskit/editor-prosemirror/state';
2
2
  export declare const cloneTr: (tr: Transaction) => Transaction;
@@ -1,4 +1,4 @@
1
- import { CellAttributes, CellAttributesWithColSpan } from '../types';
1
+ import { type CellAttributes, type 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;
@@ -5,5 +5,5 @@ import type { Rect } from '../table-map';
5
5
  import type { CellSelectionRect, Dispatch } from '../types';
6
6
  export declare function pastedCells(slice: Slice): CellSelectionRect | null;
7
7
  export declare function fitSlice(nodeType: NodeType, slice: Slice): PMNode;
8
- export declare function clipCells({ width: currentWidth, height: currentHeight, rows: currentRows, }: CellSelectionRect, newWidth: number, newHeight: number): CellSelectionRect;
8
+ export declare function clipCells({ width: currentWidth, height: currentHeight, rows: currentRows }: CellSelectionRect, newWidth: number, newHeight: number): CellSelectionRect;
9
9
  export declare function insertCells(state: EditorState, dispatch: Dispatch, tableStart: number, rect: Rect, cells: CellSelectionRect): void;
@@ -5,8 +5,8 @@ type CreateTableProps = {
5
5
  colsCount?: number;
6
6
  withHeaderRow?: boolean;
7
7
  cellContent?: PMNode;
8
- tableWidth?: number;
8
+ tableWidth?: number | 'inherit';
9
9
  layout?: string;
10
10
  };
11
- export declare const createTable: ({ schema, rowsCount, colsCount, withHeaderRow, cellContent, tableWidth, layout }: CreateTableProps) => PMNode;
11
+ export declare const createTable: ({ schema, rowsCount, colsCount, withHeaderRow, cellContent, tableWidth, layout, }: CreateTableProps) => PMNode;
12
12
  export {};
@@ -1,3 +1,3 @@
1
- import { EditorState } from '@atlaskit/editor-prosemirror/state';
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 { Schema } from '@atlaskit/editor-prosemirror/model';
2
- import { Transaction } from '@atlaskit/editor-prosemirror/state';
3
- import { NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
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 { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
2
- import { Selection } from '@atlaskit/editor-prosemirror/state';
3
- import { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
4
- import { Rect } from '../table-map';
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 { Node } from '@atlaskit/editor-prosemirror/model';
2
- import { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
1
+ import { type Node } from '@atlaskit/editor-prosemirror/model';
2
+ import { type EditorState, type Transaction } from '@atlaskit/editor-prosemirror/state';
3
3
  export type ReportFixedTable = ({ state, tr, reason, }: {
4
4
  state: EditorState;
5
5
  tr: Transaction;
@@ -1,4 +1,4 @@
1
- import { Transaction } from '@atlaskit/editor-prosemirror/state';
2
- import { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
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 { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
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 { Selection } from '@atlaskit/editor-prosemirror/state';
2
- import { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
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 { Selection } from '@atlaskit/editor-prosemirror/state';
2
- import { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
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 { Selection } from '@atlaskit/editor-prosemirror/state';
2
- import { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
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 { Selection } from '@atlaskit/editor-prosemirror/state';
2
- import { Rect } from '../table-map';
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 { Command, Direction } from '../types';
1
+ import { type Command, type Direction } from '../types';
2
2
  export declare function goToNextCell(direction: Direction): Command;
@@ -1,3 +1,3 @@
1
- import { Slice } from '@atlaskit/editor-prosemirror/model';
2
- import { EditorView } from '@atlaskit/editor-prosemirror/view';
1
+ import { type Slice } from '@atlaskit/editor-prosemirror/model';
2
+ import { type EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  export declare function handlePaste(view: EditorView, event: Event | null, slice: Slice): boolean;
@@ -1,5 +1,5 @@
1
- import { Selection } from '@atlaskit/editor-prosemirror/state';
2
- import { Rect } from '../table-map';
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 { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
2
- import { NodeSelection, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
1
+ import { type ResolvedPos } from '@atlaskit/editor-prosemirror/model';
2
+ import { type NodeSelection, type Selection, type 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 { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
1
+ import { type EditorState, type 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 { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
2
- import { Transaction } from '@atlaskit/editor-prosemirror/state';
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 { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
2
- import { Transaction } from '@atlaskit/editor-prosemirror/state';
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 { Transaction } from '@atlaskit/editor-prosemirror/state';
1
+ import { type Transaction } from '@atlaskit/editor-prosemirror/state';
2
2
  export declare const removeTable: (tr: Transaction) => Transaction;
@@ -1,5 +1,5 @@
1
- import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
- import { NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
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 { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
2
+ import { type EditorState, type Transaction } from '@atlaskit/editor-prosemirror/state';
3
3
  export declare const replaceSelectedTable: (state: EditorState, content: string | Slice) => Transaction;
@@ -1,3 +1,3 @@
1
- import { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
2
- import { Selection } from '@atlaskit/editor-prosemirror/state';
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 { EditorState } from '@atlaskit/editor-prosemirror/state';
2
- import { Rect, TableContext } from '../table-map';
1
+ import { type EditorState } from '@atlaskit/editor-prosemirror/state';
2
+ import { type Rect, type 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 { Transaction } from '@atlaskit/editor-prosemirror/state';
2
- import { NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
3
- import { CellAttributes } from '../types';
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,5 @@
1
- import { NodeType, Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
2
- import { Command } from '../types';
1
+ import { type NodeType, type Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
2
+ import { type Command } from '../types';
3
3
  export declare function cellWrapping($pos: ResolvedPos): PMNode | null;
4
4
  export type GetCellTypeArgs = {
5
5
  row: number;
@@ -1,2 +1,2 @@
1
- import { Command } from '../types';
1
+ import { type Command } from '../types';
2
2
  export declare const splitCell: Command;
@@ -1,4 +1,4 @@
1
- import { NodeType, Schema } from '@atlaskit/editor-prosemirror/model';
1
+ import { type NodeType, type Schema } from '@atlaskit/editor-prosemirror/model';
2
2
  export type TableNodeCache = {
3
3
  [key: string]: NodeType;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
2
- import { EditorState } from '@atlaskit/editor-prosemirror/state';
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,4 +1,4 @@
1
- import { Command } from '../types';
1
+ import { type Command } from '../types';
2
2
  export declare const addRowBefore: Command;
3
3
  export declare const addRowAfter: Command;
4
4
  export declare const addColumnBefore: Command;
@@ -1,6 +1,6 @@
1
- import { Command } from '../types';
2
- import { SelectionRect } from './selection-rect';
3
- import { TableNodeCache } from './table-node-types';
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;
@@ -27,7 +27,7 @@ export { cloneColumn } from './utils/clone-column';
27
27
  export { cloneRow } from './utils/clone-row';
28
28
  export { normalizeSelection } from './utils/normalize-selection';
29
29
  export { removeColumnAt, removeSelectedColumns, removeColumnClosestToPos, } from './utils/remove-column';
30
- export { removeRowAt, removeSelectedRows, removeRowClosestToPos, } from './utils/remove-row';
30
+ export { removeRowAt, removeSelectedRows, removeRowClosestToPos } from './utils/remove-row';
31
31
  export { removeTable } from './utils/remove-table';
32
32
  export { selectColumn, selectColumns, selectRow, selectRows, selectTable, selectTableClosestToPos, } from './utils/select-nodes';
33
33
  export { selectionCell } from './utils/selection-cell';
@@ -42,4 +42,4 @@ export { toggleHeader } from './utils/toggle-header';
42
42
  export { convertArrayOfRowsToTableNode, convertTableNodeToArrayOfRows, } from './utils/reorder-utils';
43
43
  export { handlePaste } from './utils/handle-paste';
44
44
  export { replaceSelectedTable } from './utils/replace-table';
45
- export { getSelectedTableInfo, getSelectedCellInfo, } from './utils/analytics-helpers';
45
+ export { getSelectedTableInfo, getSelectedCellInfo } from './utils/analytics-helpers';
@@ -1,6 +1,6 @@
1
- import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
- import { Selection, SelectionBookmark } from '@atlaskit/editor-prosemirror/state';
3
- import { Mappable } from '@atlaskit/editor-prosemirror/transform';
1
+ import { type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
+ import { Selection, type SelectionBookmark } from '@atlaskit/editor-prosemirror/state';
3
+ import { type Mappable } from '@atlaskit/editor-prosemirror/transform';
4
4
  export declare class CellBookmark implements SelectionBookmark {
5
5
  readonly anchor: number;
6
6
  readonly head: number;
@@ -1,8 +1,8 @@
1
- import { Node as PMNode, ResolvedPos, Slice } from '@atlaskit/editor-prosemirror/model';
2
- import { Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
3
- import { Mapping } from '@atlaskit/editor-prosemirror/transform';
1
+ import { type Node as PMNode, type ResolvedPos, Slice } from '@atlaskit/editor-prosemirror/model';
2
+ import { Selection, type Transaction } from '@atlaskit/editor-prosemirror/state';
3
+ import { type Mapping } from '@atlaskit/editor-prosemirror/transform';
4
4
  import { CellBookmark } from './cell-bookmark';
5
- import { SerializedCellSelection } from './types';
5
+ import { type SerializedCellSelection } from './types';
6
6
  export declare class CellSelection extends Selection {
7
7
  readonly $anchorCell: ResolvedPos;
8
8
  readonly $headCell: ResolvedPos;
@@ -1,7 +1,8 @@
1
- import { Selection } from '@atlaskit/editor-prosemirror/state';
1
+ import { type Selection } from '@atlaskit/editor-prosemirror/state';
2
2
  import { TableMap } from '../table-map';
3
+ import { findTable } from './find';
3
4
  export declare function getSelectedTableInfo(selection: Selection): {
4
- table: import("prosemirror-utils").ContentNodeWithPos | undefined;
5
+ table: ReturnType<typeof findTable> | undefined;
5
6
  map: TableMap | undefined;
6
7
  totalRowCount: number;
7
8
  totalColumnCount: number;
@@ -1,5 +1,5 @@
1
- import { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
2
- import { Axis } from '../types';
1
+ import { type ResolvedPos } from '@atlaskit/editor-prosemirror/model';
2
+ import { type Axis } from '../types';
3
3
  export declare function pointsAtCell($pos: ResolvedPos): false | import("prosemirror-model").Node | null;
4
4
  export declare function cellNear($pos: ResolvedPos): ResolvedPos | null;
5
5
  export declare function cellAround($pos: ResolvedPos): ResolvedPos | null;
@@ -1,2 +1,2 @@
1
- import { Transaction } from '@atlaskit/editor-prosemirror/state';
1
+ import { type Transaction } from '@atlaskit/editor-prosemirror/state';
2
2
  export declare const cloneTr: (tr: Transaction) => Transaction;
@@ -1,4 +1,4 @@
1
- import { CellAttributes, CellAttributesWithColSpan } from '../types';
1
+ import { type CellAttributes, type 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;
@@ -5,5 +5,5 @@ import type { Rect } from '../table-map';
5
5
  import type { CellSelectionRect, Dispatch } from '../types';
6
6
  export declare function pastedCells(slice: Slice): CellSelectionRect | null;
7
7
  export declare function fitSlice(nodeType: NodeType, slice: Slice): PMNode;
8
- export declare function clipCells({ width: currentWidth, height: currentHeight, rows: currentRows, }: CellSelectionRect, newWidth: number, newHeight: number): CellSelectionRect;
8
+ export declare function clipCells({ width: currentWidth, height: currentHeight, rows: currentRows }: CellSelectionRect, newWidth: number, newHeight: number): CellSelectionRect;
9
9
  export declare function insertCells(state: EditorState, dispatch: Dispatch, tableStart: number, rect: Rect, cells: CellSelectionRect): void;
@@ -5,8 +5,8 @@ type CreateTableProps = {
5
5
  colsCount?: number;
6
6
  withHeaderRow?: boolean;
7
7
  cellContent?: PMNode;
8
- tableWidth?: number;
8
+ tableWidth?: number | 'inherit';
9
9
  layout?: string;
10
10
  };
11
- export declare const createTable: ({ schema, rowsCount, colsCount, withHeaderRow, cellContent, tableWidth, layout }: CreateTableProps) => PMNode;
11
+ export declare const createTable: ({ schema, rowsCount, colsCount, withHeaderRow, cellContent, tableWidth, layout, }: CreateTableProps) => PMNode;
12
12
  export {};
@@ -1,3 +1,3 @@
1
- import { EditorState } from '@atlaskit/editor-prosemirror/state';
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 { Schema } from '@atlaskit/editor-prosemirror/model';
2
- import { Transaction } from '@atlaskit/editor-prosemirror/state';
3
- import { NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
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 { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
2
- import { Selection } from '@atlaskit/editor-prosemirror/state';
3
- import { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
4
- import { Rect } from '../table-map';
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 { Node } from '@atlaskit/editor-prosemirror/model';
2
- import { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
1
+ import { type Node } from '@atlaskit/editor-prosemirror/model';
2
+ import { type EditorState, type Transaction } from '@atlaskit/editor-prosemirror/state';
3
3
  export type ReportFixedTable = ({ state, tr, reason, }: {
4
4
  state: EditorState;
5
5
  tr: Transaction;
@@ -1,4 +1,4 @@
1
- import { Transaction } from '@atlaskit/editor-prosemirror/state';
2
- import { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
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 { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
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 { Selection } from '@atlaskit/editor-prosemirror/state';
2
- import { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
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 { Selection } from '@atlaskit/editor-prosemirror/state';
2
- import { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
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 { Selection } from '@atlaskit/editor-prosemirror/state';
2
- import { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
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 { Selection } from '@atlaskit/editor-prosemirror/state';
2
- import { Rect } from '../table-map';
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 { Command, Direction } from '../types';
1
+ import { type Command, type Direction } from '../types';
2
2
  export declare function goToNextCell(direction: Direction): Command;
@@ -1,3 +1,3 @@
1
- import { Slice } from '@atlaskit/editor-prosemirror/model';
2
- import { EditorView } from '@atlaskit/editor-prosemirror/view';
1
+ import { type Slice } from '@atlaskit/editor-prosemirror/model';
2
+ import { type EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  export declare function handlePaste(view: EditorView, event: Event | null, slice: Slice): boolean;