@atlaskit/editor-tables 2.7.3 → 2.7.5
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 +288 -278
- package/afm-jira/tsconfig.json +20 -0
- package/dist/cjs/utils/create-table.js +6 -2
- package/dist/es2019/utils/create-table.js +6 -2
- package/dist/esm/utils/create-table.js +6 -2
- package/dist/types/cell-bookmark.d.ts +3 -3
- package/dist/types/cell-selection.d.ts +4 -4
- package/dist/types/utils/analytics-helpers.d.ts +1 -1
- package/dist/types/utils/cells.d.ts +2 -2
- package/dist/types/utils/clone-tr.d.ts +1 -1
- package/dist/types/utils/colspan.d.ts +1 -1
- package/dist/types/utils/copy-paste.d.ts +1 -1
- package/dist/types/utils/create-table.d.ts +3 -2
- 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 +2 -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/utils.d.ts +2 -2
- package/dist/types-ts4.5/cell-bookmark.d.ts +3 -3
- package/dist/types-ts4.5/cell-selection.d.ts +4 -4
- package/dist/types-ts4.5/utils/analytics-helpers.d.ts +1 -1
- package/dist/types-ts4.5/utils/cells.d.ts +2 -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/copy-paste.d.ts +1 -1
- package/dist/types-ts4.5/utils/create-table.d.ts +3 -2
- 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 +2 -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/dist/types-ts4.5/utils.d.ts +2 -2
- package/package.json +62 -64
- package/report.api.md +118 -134
|
@@ -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 { 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,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
|
|
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
|
|
45
|
+
export { getSelectedTableInfo, getSelectedCellInfo } from './utils/analytics-helpers';
|
package/package.json
CHANGED
|
@@ -1,65 +1,63 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
}
|
|
2
|
+
"name": "@atlaskit/editor-tables",
|
|
3
|
+
"version": "2.7.5",
|
|
4
|
+
"description": "A package that contains common classes and utility functions for editor tables",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"registry": "https://registry.npmjs.org/"
|
|
7
|
+
},
|
|
8
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
9
|
+
"author": "Atlassian Pty Ltd",
|
|
10
|
+
"license": "Apache-2.0",
|
|
11
|
+
"main": "dist/cjs/index.js",
|
|
12
|
+
"module": "dist/esm/index.js",
|
|
13
|
+
"module:es2019": "dist/es2019/index.js",
|
|
14
|
+
"types": "dist/types/index.d.ts",
|
|
15
|
+
"typesVersions": {
|
|
16
|
+
">=4.5 <4.9": {
|
|
17
|
+
"*": [
|
|
18
|
+
"dist/types-ts4.5/*",
|
|
19
|
+
"dist/types-ts4.5/index.d.ts"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"sideEffects": false,
|
|
24
|
+
"atlaskit:src": "src/index.ts",
|
|
25
|
+
"atlassian": {
|
|
26
|
+
"team": "Editor: Jenga",
|
|
27
|
+
"singleton": true,
|
|
28
|
+
"releaseModel": "continuous"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@atlaskit/editor-prosemirror": "4.0.1",
|
|
32
|
+
"@babel/runtime": "^7.0.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@atlassian/feature-flags-test-utils": "^0.2.0"
|
|
36
|
+
},
|
|
37
|
+
"techstack": {
|
|
38
|
+
"@atlassian/frontend": {
|
|
39
|
+
"circular-dependencies": [
|
|
40
|
+
"file-level"
|
|
41
|
+
],
|
|
42
|
+
"import-structure": "atlassian-conventions"
|
|
43
|
+
},
|
|
44
|
+
"@repo/internal": {
|
|
45
|
+
"deprecation": "no-deprecated-imports",
|
|
46
|
+
"design-tokens": [
|
|
47
|
+
"color"
|
|
48
|
+
],
|
|
49
|
+
"styling": [
|
|
50
|
+
"emotion"
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"af:exports": {
|
|
55
|
+
".": "./src/index.ts",
|
|
56
|
+
"./cell-bookmark": "./src/cell-bookmark.ts",
|
|
57
|
+
"./cell-selection": "./src/cell-selection.ts",
|
|
58
|
+
"./pm-plugins": "./src/pm-plugins.ts",
|
|
59
|
+
"./table-map": "./src/table-map.ts",
|
|
60
|
+
"./types": "./src/types.ts",
|
|
61
|
+
"./utils": "./src/utils.ts"
|
|
62
|
+
}
|
|
63
|
+
}
|
package/report.api.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## API Report File for "@atlaskit/editor-tables"
|
|
4
4
|
|
|
5
|
-
> Do not edit this file. This report is auto-generated using
|
|
5
|
+
> Do not edit this file. This report is auto-generated using
|
|
6
|
+
> [API Extractor](https://api-extractor.com/).
|
|
6
7
|
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
8
|
|
|
8
9
|
### Table of contents
|
|
@@ -30,184 +31,167 @@ type Axis = 'horiz' | 'vert';
|
|
|
30
31
|
|
|
31
32
|
// @public (undocumented)
|
|
32
33
|
class CellBookmark implements SelectionBookmark {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
34
|
+
constructor(anchor: number, head: number);
|
|
35
|
+
// (undocumented)
|
|
36
|
+
readonly anchor: number;
|
|
37
|
+
// (undocumented)
|
|
38
|
+
readonly head: number;
|
|
39
|
+
// (undocumented)
|
|
40
|
+
map(mapping: Mappable): SelectionBookmark;
|
|
41
|
+
// (undocumented)
|
|
42
|
+
resolve(doc: Node_2): Selection_2;
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
// @public (undocumented)
|
|
45
46
|
export class CellSelection extends Selection_2 {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
replaceWith(tr: Transaction, node: Node_2): void;
|
|
82
|
-
// (undocumented)
|
|
83
|
-
static rowSelection(
|
|
84
|
-
$anchorCell: ResolvedPos,
|
|
85
|
-
$headCell?: ResolvedPos,
|
|
86
|
-
): CellSelection;
|
|
87
|
-
// (undocumented)
|
|
88
|
-
toJSON(): SerializedCellSelection;
|
|
89
|
-
// (undocumented)
|
|
90
|
-
readonly visible: boolean;
|
|
47
|
+
// (undocumented)
|
|
48
|
+
readonly $anchorCell: ResolvedPos;
|
|
49
|
+
// (undocumented)
|
|
50
|
+
readonly $headCell: ResolvedPos;
|
|
51
|
+
constructor($anchorCell: ResolvedPos, $headCell?: ResolvedPos);
|
|
52
|
+
// (undocumented)
|
|
53
|
+
static colSelection($anchorCell: ResolvedPos, $headCell?: ResolvedPos): CellSelection;
|
|
54
|
+
// (undocumented)
|
|
55
|
+
content(): Slice;
|
|
56
|
+
// (undocumented)
|
|
57
|
+
static create(doc: Node_2, anchorCell: number, headCell?: number): CellSelection;
|
|
58
|
+
// (undocumented)
|
|
59
|
+
eq(other: CellSelection): boolean;
|
|
60
|
+
// (undocumented)
|
|
61
|
+
forEachCell(f: (node: Node_2, pos: number) => void): void;
|
|
62
|
+
// (undocumented)
|
|
63
|
+
static fromJSON(doc: Node_2, json: SerializedCellSelection): CellSelection;
|
|
64
|
+
// (undocumented)
|
|
65
|
+
getBookmark(): CellBookmark;
|
|
66
|
+
// (undocumented)
|
|
67
|
+
isColSelection(): boolean;
|
|
68
|
+
// (undocumented)
|
|
69
|
+
isRowSelection(): boolean;
|
|
70
|
+
// (undocumented)
|
|
71
|
+
map(doc: Node_2, mapping: Mapping): Selection_2;
|
|
72
|
+
// (undocumented)
|
|
73
|
+
replace(tr: Transaction, content?: Slice): void;
|
|
74
|
+
// (undocumented)
|
|
75
|
+
replaceWith(tr: Transaction, node: Node_2): void;
|
|
76
|
+
// (undocumented)
|
|
77
|
+
static rowSelection($anchorCell: ResolvedPos, $headCell?: ResolvedPos): CellSelection;
|
|
78
|
+
// (undocumented)
|
|
79
|
+
toJSON(): SerializedCellSelection;
|
|
80
|
+
// (undocumented)
|
|
81
|
+
readonly visible: boolean;
|
|
91
82
|
}
|
|
92
83
|
|
|
93
84
|
// @public (undocumented)
|
|
94
|
-
export const findTable: (
|
|
95
|
-
selection: Selection_2,
|
|
96
|
-
) => ContentNodeWithPos | undefined;
|
|
85
|
+
export const findTable: (selection: Selection_2) => ContentNodeWithPos | undefined;
|
|
97
86
|
|
|
98
87
|
// @public (undocumented)
|
|
99
88
|
export class Rect {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
89
|
+
constructor(left: number, top: number, right: number, bottom: number);
|
|
90
|
+
// (undocumented)
|
|
91
|
+
bottom: number;
|
|
92
|
+
// (undocumented)
|
|
93
|
+
left: number;
|
|
94
|
+
// (undocumented)
|
|
95
|
+
right: number;
|
|
96
|
+
// (undocumented)
|
|
97
|
+
top: number;
|
|
109
98
|
}
|
|
110
99
|
|
|
111
100
|
// @public (undocumented)
|
|
112
101
|
interface SerializedCellSelection {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
102
|
+
// (undocumented)
|
|
103
|
+
anchor: number;
|
|
104
|
+
// (undocumented)
|
|
105
|
+
head: number;
|
|
106
|
+
// (undocumented)
|
|
107
|
+
type: 'cell';
|
|
119
108
|
}
|
|
120
109
|
|
|
121
110
|
// @public (undocumented)
|
|
122
111
|
export class TableMap {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
rectBetween(a: number, b: number): Rect;
|
|
153
|
-
// (undocumented)
|
|
154
|
-
rowCount(pos: number): number;
|
|
155
|
-
// (undocumented)
|
|
156
|
-
width: number;
|
|
112
|
+
constructor(width: number, height: number, map: number[], problems?: TableProblem[] | null);
|
|
113
|
+
// (undocumented)
|
|
114
|
+
cellsInRect(rect: Rect): number[];
|
|
115
|
+
// (undocumented)
|
|
116
|
+
colCount(pos: number): number;
|
|
117
|
+
// (undocumented)
|
|
118
|
+
findCell(pos: number): Rect;
|
|
119
|
+
// (undocumented)
|
|
120
|
+
static get(table: Node_2): TableMap;
|
|
121
|
+
// (undocumented)
|
|
122
|
+
getMaxColInRow(pos: ResolvedPos): number | undefined;
|
|
123
|
+
// (undocumented)
|
|
124
|
+
height: number;
|
|
125
|
+
// (undocumented)
|
|
126
|
+
isPosMerged(pos: number): boolean;
|
|
127
|
+
// (undocumented)
|
|
128
|
+
map: number[];
|
|
129
|
+
// (undocumented)
|
|
130
|
+
nextCell(pos: number, axis: Axis, dir: number): null | number;
|
|
131
|
+
// (undocumented)
|
|
132
|
+
positionAt(row: number, col: number, table: Node_2): number;
|
|
133
|
+
// (undocumented)
|
|
134
|
+
problems?: TableProblem[] | null;
|
|
135
|
+
// (undocumented)
|
|
136
|
+
rectBetween(a: number, b: number): Rect;
|
|
137
|
+
// (undocumented)
|
|
138
|
+
rowCount(pos: number): number;
|
|
139
|
+
// (undocumented)
|
|
140
|
+
width: number;
|
|
157
141
|
}
|
|
158
142
|
|
|
159
143
|
// @public (undocumented)
|
|
160
144
|
type TableProblem =
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
145
|
+
| TableProblemColWidthMismatch
|
|
146
|
+
| TableProblemCollision
|
|
147
|
+
| TableProblemLongRowspan
|
|
148
|
+
| TableProblemMissing;
|
|
165
149
|
|
|
166
150
|
// @public (undocumented)
|
|
167
151
|
type TableProblemCollision = {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
152
|
+
type: TableProblemTypes.COLLISION;
|
|
153
|
+
row: number;
|
|
154
|
+
pos: number;
|
|
155
|
+
n: number;
|
|
172
156
|
};
|
|
173
157
|
|
|
174
158
|
// @public (undocumented)
|
|
175
159
|
type TableProblemColWidthMismatch = {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
160
|
+
type: TableProblemTypes;
|
|
161
|
+
pos: number;
|
|
162
|
+
colwidth: number;
|
|
179
163
|
};
|
|
180
164
|
|
|
181
165
|
// @public (undocumented)
|
|
182
166
|
type TableProblemLongRowspan = {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
167
|
+
type: TableProblemTypes.OVERLONG_ROWSPAN;
|
|
168
|
+
pos: number;
|
|
169
|
+
n: number;
|
|
186
170
|
};
|
|
187
171
|
|
|
188
172
|
// @public (undocumented)
|
|
189
173
|
type TableProblemMissing = {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
174
|
+
type: TableProblemTypes.MISSING;
|
|
175
|
+
row: number;
|
|
176
|
+
n: number;
|
|
193
177
|
};
|
|
194
178
|
|
|
195
179
|
// @public (undocumented)
|
|
196
180
|
enum TableProblemTypes {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
181
|
+
// (undocumented)
|
|
182
|
+
COLLISION = 'collision',
|
|
183
|
+
// (undocumented)
|
|
184
|
+
COLWIDTH_MISMATCH = 'colwidth mismatch',
|
|
185
|
+
// (undocumented)
|
|
186
|
+
MISSING = 'missing',
|
|
187
|
+
// (undocumented)
|
|
188
|
+
OVERLONG_ROWSPAN = 'overlong_rowspan',
|
|
205
189
|
}
|
|
206
190
|
|
|
207
191
|
// @public (undocumented)
|
|
208
192
|
export const uuid: {
|
|
209
|
-
|
|
210
|
-
|
|
193
|
+
setStatic(value: false | string): void;
|
|
194
|
+
generate(): string;
|
|
211
195
|
};
|
|
212
196
|
|
|
213
197
|
// (No @packageDocumentation comment for this package)
|