@atlaskit/editor-tables 2.1.6 → 2.2.1
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 +12 -0
- package/cell-bookmark/package.json +8 -1
- package/cell-selection/package.json +8 -1
- package/dist/cjs/pm-plugins/table-editing.js +3 -2
- package/dist/cjs/utils/fix-tables.js +11 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/pm-plugins/table-editing.js +3 -2
- package/dist/es2019/utils/fix-tables.js +14 -5
- package/dist/es2019/version.json +1 -1
- package/dist/esm/pm-plugins/table-editing.js +3 -2
- package/dist/esm/utils/fix-tables.js +14 -5
- package/dist/esm/version.json +1 -1
- package/dist/types/pm-plugins/table-editing.d.ts +4 -2
- package/dist/types/utils/fix-tables.d.ts +7 -2
- package/package.json +7 -4
- package/pm-plugins/package.json +8 -1
- package/report.api.md +108 -45
- package/table-map/package.json +8 -1
- package/types/package.json +8 -1
- package/utils/package.json +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-tables
|
|
2
2
|
|
|
3
|
+
## 2.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`403e0d2d291`](https://bitbucket.org/atlassian/atlassian-frontend/commits/403e0d2d291) - ED-16246 fix prevent @types/prosemirror-commands @types/prosemirror-keymap updating to incompatible version.
|
|
8
|
+
|
|
9
|
+
## 2.2.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`d8acf7254db`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d8acf7254db) - ED-8567 added tracking for fixTables()
|
|
14
|
+
|
|
3
15
|
## 2.1.6
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/cell-bookmark.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/cell-bookmark.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/cell-bookmark.d.ts"
|
|
7
|
+
"types": "../dist/types/cell-bookmark.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/cell-bookmark.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/cell-selection.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/cell-selection.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/cell-selection.d.ts"
|
|
7
|
+
"types": "../dist/types/cell-selection.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/cell-selection.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
|
@@ -22,7 +22,8 @@ var _pluginKey = require("./plugin-key");
|
|
|
22
22
|
function tableEditing() {
|
|
23
23
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
24
24
|
_ref$allowTableNodeSe = _ref.allowTableNodeSelection,
|
|
25
|
-
allowTableNodeSelection = _ref$allowTableNodeSe === void 0 ? false : _ref$allowTableNodeSe
|
|
25
|
+
allowTableNodeSelection = _ref$allowTableNodeSe === void 0 ? false : _ref$allowTableNodeSe,
|
|
26
|
+
reportFixedTable = _ref.reportFixedTable;
|
|
26
27
|
|
|
27
28
|
return new _prosemirrorState.Plugin({
|
|
28
29
|
key: _pluginKey.tableEditingKey,
|
|
@@ -69,7 +70,7 @@ function tableEditing() {
|
|
|
69
70
|
handlePaste: _utils.handlePaste
|
|
70
71
|
},
|
|
71
72
|
appendTransaction: function appendTransaction(_, oldState, state) {
|
|
72
|
-
return (0, _normalizeSelection.normalizeSelection)(state, (0, _fixTables.fixTables)(state, oldState), allowTableNodeSelection);
|
|
73
|
+
return (0, _normalizeSelection.normalizeSelection)(state, (0, _fixTables.fixTables)(state, oldState, reportFixedTable), allowTableNodeSelection);
|
|
73
74
|
}
|
|
74
75
|
});
|
|
75
76
|
}
|
|
@@ -60,12 +60,12 @@ function changedDescendants(old, cur, offsetStart, f) {
|
|
|
60
60
|
// document.
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
function fixTables(state, oldState) {
|
|
63
|
+
function fixTables(state, oldState, reportFixedTable) {
|
|
64
64
|
var tr;
|
|
65
65
|
|
|
66
66
|
var check = function check(node, pos) {
|
|
67
67
|
if (node.type.spec.tableRole === 'table') {
|
|
68
|
-
tr = fixTable(state, node, pos, tr);
|
|
68
|
+
tr = fixTable(state, node, pos, tr, reportFixedTable);
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
71
|
|
|
@@ -81,7 +81,7 @@ function fixTables(state, oldState) {
|
|
|
81
81
|
// it was given, if non-null, or create a new one if necessary.
|
|
82
82
|
|
|
83
83
|
|
|
84
|
-
function fixTable(state, table, tablePos, transaction) {
|
|
84
|
+
function fixTable(state, table, tablePos, transaction, reportFixedTable) {
|
|
85
85
|
var tr = transaction;
|
|
86
86
|
|
|
87
87
|
var map = _tableMap.TableMap.get(table);
|
|
@@ -105,6 +105,14 @@ function fixTable(state, table, tablePos, transaction) {
|
|
|
105
105
|
for (var _i = 0; _i < map.problems.length; _i++) {
|
|
106
106
|
var prob = map.problems[_i];
|
|
107
107
|
|
|
108
|
+
if (reportFixedTable) {
|
|
109
|
+
reportFixedTable({
|
|
110
|
+
state: state,
|
|
111
|
+
tr: tr,
|
|
112
|
+
reason: prob.type || 'unknown'
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
108
116
|
if (prob.type === _tableMap.TableProblemTypes.COLLISION) {
|
|
109
117
|
var collision = prob;
|
|
110
118
|
var cell = table.nodeAt(prob.pos);
|
package/dist/cjs/version.json
CHANGED
|
@@ -18,7 +18,8 @@ import { tableEditingKey } from './plugin-key'; // :: () → Plugin
|
|
|
18
18
|
// perform more specific behavior.
|
|
19
19
|
|
|
20
20
|
export function tableEditing({
|
|
21
|
-
allowTableNodeSelection = false
|
|
21
|
+
allowTableNodeSelection = false,
|
|
22
|
+
reportFixedTable
|
|
22
23
|
} = {}) {
|
|
23
24
|
return new Plugin({
|
|
24
25
|
key: tableEditingKey,
|
|
@@ -70,7 +71,7 @@ export function tableEditing({
|
|
|
70
71
|
},
|
|
71
72
|
|
|
72
73
|
appendTransaction(_, oldState, state) {
|
|
73
|
-
return normalizeSelection(state, fixTables(state, oldState), allowTableNodeSelection);
|
|
74
|
+
return normalizeSelection(state, fixTables(state, oldState, reportFixedTable), allowTableNodeSelection);
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
});
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { fixTablesKey } from '../pm-plugins/plugin-key';
|
|
2
2
|
import { TableMap, TableProblemTypes } from '../table-map';
|
|
3
3
|
import { removeColSpan } from './colspan';
|
|
4
|
-
import { tableNodeTypes } from './table-node-types';
|
|
4
|
+
import { tableNodeTypes } from './table-node-types';
|
|
5
|
+
|
|
6
|
+
// Helper for iterating through the nodes in a document that changed
|
|
5
7
|
// compared to the given previous document. Useful for avoiding
|
|
6
8
|
// duplicate work on each transaction.
|
|
7
|
-
|
|
8
9
|
function changedDescendants(old, cur, offsetStart, f) {
|
|
9
10
|
let offset = offsetStart;
|
|
10
11
|
const oldSize = old.childCount;
|
|
@@ -40,12 +41,12 @@ function changedDescendants(old, cur, offsetStart, f) {
|
|
|
40
41
|
// document.
|
|
41
42
|
|
|
42
43
|
|
|
43
|
-
export function fixTables(state, oldState) {
|
|
44
|
+
export function fixTables(state, oldState, reportFixedTable) {
|
|
44
45
|
let tr;
|
|
45
46
|
|
|
46
47
|
const check = (node, pos) => {
|
|
47
48
|
if (node.type.spec.tableRole === 'table') {
|
|
48
|
-
tr = fixTable(state, node, pos, tr);
|
|
49
|
+
tr = fixTable(state, node, pos, tr, reportFixedTable);
|
|
49
50
|
}
|
|
50
51
|
};
|
|
51
52
|
|
|
@@ -60,7 +61,7 @@ export function fixTables(state, oldState) {
|
|
|
60
61
|
// Fix the given table, if necessary. Will append to the transaction
|
|
61
62
|
// it was given, if non-null, or create a new one if necessary.
|
|
62
63
|
|
|
63
|
-
export function fixTable(state, table, tablePos, transaction) {
|
|
64
|
+
export function fixTable(state, table, tablePos, transaction, reportFixedTable) {
|
|
64
65
|
let tr = transaction;
|
|
65
66
|
const map = TableMap.get(table);
|
|
66
67
|
|
|
@@ -83,6 +84,14 @@ export function fixTable(state, table, tablePos, transaction) {
|
|
|
83
84
|
for (let i = 0; i < map.problems.length; i++) {
|
|
84
85
|
const prob = map.problems[i];
|
|
85
86
|
|
|
87
|
+
if (reportFixedTable) {
|
|
88
|
+
reportFixedTable({
|
|
89
|
+
state,
|
|
90
|
+
tr,
|
|
91
|
+
reason: prob.type || 'unknown'
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
86
95
|
if (prob.type === TableProblemTypes.COLLISION) {
|
|
87
96
|
const collision = prob;
|
|
88
97
|
const cell = table.nodeAt(prob.pos);
|
package/dist/es2019/version.json
CHANGED
|
@@ -20,7 +20,8 @@ import { tableEditingKey } from './plugin-key'; // :: () → Plugin
|
|
|
20
20
|
export function tableEditing() {
|
|
21
21
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
22
22
|
_ref$allowTableNodeSe = _ref.allowTableNodeSelection,
|
|
23
|
-
allowTableNodeSelection = _ref$allowTableNodeSe === void 0 ? false : _ref$allowTableNodeSe
|
|
23
|
+
allowTableNodeSelection = _ref$allowTableNodeSe === void 0 ? false : _ref$allowTableNodeSe,
|
|
24
|
+
reportFixedTable = _ref.reportFixedTable;
|
|
24
25
|
|
|
25
26
|
return new Plugin({
|
|
26
27
|
key: tableEditingKey,
|
|
@@ -67,7 +68,7 @@ export function tableEditing() {
|
|
|
67
68
|
handlePaste: handlePaste
|
|
68
69
|
},
|
|
69
70
|
appendTransaction: function appendTransaction(_, oldState, state) {
|
|
70
|
-
return normalizeSelection(state, fixTables(state, oldState), allowTableNodeSelection);
|
|
71
|
+
return normalizeSelection(state, fixTables(state, oldState, reportFixedTable), allowTableNodeSelection);
|
|
71
72
|
}
|
|
72
73
|
});
|
|
73
74
|
}
|
|
@@ -7,10 +7,11 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
7
7
|
import { fixTablesKey } from '../pm-plugins/plugin-key';
|
|
8
8
|
import { TableMap, TableProblemTypes } from '../table-map';
|
|
9
9
|
import { removeColSpan } from './colspan';
|
|
10
|
-
import { tableNodeTypes } from './table-node-types';
|
|
10
|
+
import { tableNodeTypes } from './table-node-types';
|
|
11
|
+
|
|
12
|
+
// Helper for iterating through the nodes in a document that changed
|
|
11
13
|
// compared to the given previous document. Useful for avoiding
|
|
12
14
|
// duplicate work on each transaction.
|
|
13
|
-
|
|
14
15
|
function changedDescendants(old, cur, offsetStart, f) {
|
|
15
16
|
var offset = offsetStart;
|
|
16
17
|
var oldSize = old.childCount;
|
|
@@ -46,12 +47,12 @@ function changedDescendants(old, cur, offsetStart, f) {
|
|
|
46
47
|
// document.
|
|
47
48
|
|
|
48
49
|
|
|
49
|
-
export function fixTables(state, oldState) {
|
|
50
|
+
export function fixTables(state, oldState, reportFixedTable) {
|
|
50
51
|
var tr;
|
|
51
52
|
|
|
52
53
|
var check = function check(node, pos) {
|
|
53
54
|
if (node.type.spec.tableRole === 'table') {
|
|
54
|
-
tr = fixTable(state, node, pos, tr);
|
|
55
|
+
tr = fixTable(state, node, pos, tr, reportFixedTable);
|
|
55
56
|
}
|
|
56
57
|
};
|
|
57
58
|
|
|
@@ -66,7 +67,7 @@ export function fixTables(state, oldState) {
|
|
|
66
67
|
// Fix the given table, if necessary. Will append to the transaction
|
|
67
68
|
// it was given, if non-null, or create a new one if necessary.
|
|
68
69
|
|
|
69
|
-
export function fixTable(state, table, tablePos, transaction) {
|
|
70
|
+
export function fixTable(state, table, tablePos, transaction, reportFixedTable) {
|
|
70
71
|
var tr = transaction;
|
|
71
72
|
var map = TableMap.get(table);
|
|
72
73
|
|
|
@@ -89,6 +90,14 @@ export function fixTable(state, table, tablePos, transaction) {
|
|
|
89
90
|
for (var _i = 0; _i < map.problems.length; _i++) {
|
|
90
91
|
var prob = map.problems[_i];
|
|
91
92
|
|
|
93
|
+
if (reportFixedTable) {
|
|
94
|
+
reportFixedTable({
|
|
95
|
+
state: state,
|
|
96
|
+
tr: tr,
|
|
97
|
+
reason: prob.type || 'unknown'
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
92
101
|
if (prob.type === TableProblemTypes.COLLISION) {
|
|
93
102
|
var collision = prob;
|
|
94
103
|
var cell = table.nodeAt(prob.pos);
|
package/dist/esm/version.json
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Plugin } from 'prosemirror-state';
|
|
2
|
+
import { ReportFixedTable } from '../utils/fix-tables';
|
|
2
3
|
declare type PluginState = number | null;
|
|
3
|
-
export declare function tableEditing({ allowTableNodeSelection }?: {
|
|
4
|
-
allowTableNodeSelection?: boolean
|
|
4
|
+
export declare function tableEditing({ allowTableNodeSelection, reportFixedTable, }?: {
|
|
5
|
+
allowTableNodeSelection?: boolean;
|
|
6
|
+
reportFixedTable?: ReportFixedTable;
|
|
5
7
|
}): Plugin<PluginState>;
|
|
6
8
|
export {};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { Node } from 'prosemirror-model';
|
|
2
2
|
import { EditorState, Transaction } from 'prosemirror-state';
|
|
3
|
-
export declare
|
|
4
|
-
|
|
3
|
+
export declare type ReportFixedTable = ({ state, tr, reason, }: {
|
|
4
|
+
state: EditorState;
|
|
5
|
+
tr: Transaction;
|
|
6
|
+
reason: string;
|
|
7
|
+
}) => void;
|
|
8
|
+
export declare function fixTables(state: EditorState, oldState?: EditorState, reportFixedTable?: ReportFixedTable): Transaction | undefined;
|
|
9
|
+
export declare function fixTable(state: EditorState, table: Node, tablePos: number, transaction?: Transaction, reportFixedTable?: ReportFixedTable): Transaction | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-tables",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1",
|
|
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/"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@atlaskit/adf-schema": "^24.0.0",
|
|
33
|
-
"@atlaskit/editor-test-helpers": "^17.
|
|
33
|
+
"@atlaskit/editor-test-helpers": "^17.2.0",
|
|
34
34
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1"
|
|
35
35
|
},
|
|
36
36
|
"techstack": {
|
|
@@ -42,8 +42,11 @@
|
|
|
42
42
|
},
|
|
43
43
|
"@repo/internal": {
|
|
44
44
|
"deprecation": "no-deprecated-imports",
|
|
45
|
-
"theming": "tokens"
|
|
45
|
+
"theming": "tokens",
|
|
46
|
+
"styling": [
|
|
47
|
+
"emotion"
|
|
48
|
+
]
|
|
46
49
|
}
|
|
47
50
|
},
|
|
48
51
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
49
|
-
}
|
|
52
|
+
}
|
package/pm-plugins/package.json
CHANGED
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/pm-plugins.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/pm-plugins.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/pm-plugins.d.ts"
|
|
7
|
+
"types": "../dist/types/pm-plugins.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/pm-plugins.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
package/report.api.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
4
|
|
|
5
|
+
<!--
|
|
6
|
+
Generated API Report version: 2.0
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
[Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
10
|
+
|
|
5
11
|
```ts
|
|
6
12
|
import { ContentNodeWithPos } from 'prosemirror-utils';
|
|
7
13
|
import { Mapping } from 'prosemirror-transform';
|
|
@@ -11,127 +17,184 @@ import { Selection as Selection_2 } from 'prosemirror-state';
|
|
|
11
17
|
import { Slice } from 'prosemirror-model';
|
|
12
18
|
import { Transaction } from 'prosemirror-state';
|
|
13
19
|
|
|
14
|
-
|
|
20
|
+
// @public (undocumented)
|
|
21
|
+
type Axis = 'horiz' | 'vert';
|
|
15
22
|
|
|
16
|
-
|
|
23
|
+
// @public (undocumented)
|
|
24
|
+
class CellBookmark {
|
|
25
|
+
constructor(anchor: number, head: number);
|
|
26
|
+
// (undocumented)
|
|
17
27
|
readonly anchor: number;
|
|
28
|
+
// (undocumented)
|
|
18
29
|
readonly head: number;
|
|
19
|
-
|
|
30
|
+
// (undocumented)
|
|
20
31
|
map(mapping: Mapping): CellBookmark;
|
|
32
|
+
// (undocumented)
|
|
21
33
|
resolve(doc: Node_2): Selection_2;
|
|
22
34
|
}
|
|
23
35
|
|
|
24
|
-
|
|
36
|
+
// @public (undocumented)
|
|
37
|
+
export class CellSelection extends Selection_2 {
|
|
38
|
+
// (undocumented)
|
|
25
39
|
readonly $anchorCell: ResolvedPos;
|
|
40
|
+
// (undocumented)
|
|
26
41
|
readonly $headCell: ResolvedPos;
|
|
27
|
-
readonly visible: boolean;
|
|
28
42
|
constructor($anchorCell: ResolvedPos, $headCell?: ResolvedPos);
|
|
29
|
-
|
|
30
|
-
content(): Slice;
|
|
31
|
-
replace(tr: Transaction, content?: Slice<any>): void;
|
|
32
|
-
replaceWith(tr: Transaction, node: Node_2): void;
|
|
33
|
-
forEachCell(f: (node: Node_2, pos: number) => void): void;
|
|
34
|
-
isColSelection(): boolean;
|
|
43
|
+
// (undocumented)
|
|
35
44
|
static colSelection(
|
|
36
45
|
$anchorCell: ResolvedPos,
|
|
37
46
|
$headCell?: ResolvedPos,
|
|
38
47
|
): CellSelection;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
$anchorCell: ResolvedPos,
|
|
43
|
-
$headCell?: ResolvedPos,
|
|
44
|
-
): CellSelection;
|
|
45
|
-
toJSON(): SerializedCellSelection;
|
|
46
|
-
static fromJSON(doc: Node_2, json: SerializedCellSelection): CellSelection;
|
|
48
|
+
// (undocumented)
|
|
49
|
+
content(): Slice;
|
|
50
|
+
// (undocumented)
|
|
47
51
|
static create(
|
|
48
52
|
doc: Node_2,
|
|
49
53
|
anchorCell: number,
|
|
50
54
|
headCell?: number,
|
|
51
55
|
): CellSelection;
|
|
56
|
+
// (undocumented)
|
|
57
|
+
eq(other: CellSelection): boolean;
|
|
58
|
+
// (undocumented)
|
|
59
|
+
forEachCell(f: (node: Node_2, pos: number) => void): void;
|
|
60
|
+
// (undocumented)
|
|
61
|
+
static fromJSON(doc: Node_2, json: SerializedCellSelection): CellSelection;
|
|
62
|
+
// (undocumented)
|
|
52
63
|
getBookmark(): CellBookmark;
|
|
64
|
+
// (undocumented)
|
|
65
|
+
isColSelection(): boolean;
|
|
66
|
+
// (undocumented)
|
|
67
|
+
isRowSelection(): boolean;
|
|
68
|
+
// (undocumented)
|
|
69
|
+
map(doc: Node_2, mapping: Mapping): Selection_2;
|
|
70
|
+
// (undocumented)
|
|
71
|
+
replace(tr: Transaction, content?: Slice<any>): void;
|
|
72
|
+
// (undocumented)
|
|
73
|
+
replaceWith(tr: Transaction, node: Node_2): void;
|
|
74
|
+
// (undocumented)
|
|
75
|
+
static rowSelection(
|
|
76
|
+
$anchorCell: ResolvedPos,
|
|
77
|
+
$headCell?: ResolvedPos,
|
|
78
|
+
): CellSelection;
|
|
79
|
+
// (undocumented)
|
|
80
|
+
toJSON(): SerializedCellSelection;
|
|
81
|
+
// (undocumented)
|
|
82
|
+
readonly visible: boolean;
|
|
53
83
|
}
|
|
54
84
|
|
|
55
|
-
|
|
85
|
+
// @public (undocumented)
|
|
86
|
+
export const findTable: (
|
|
56
87
|
selection: Selection_2,
|
|
57
88
|
) => ContentNodeWithPos | undefined;
|
|
58
89
|
|
|
59
|
-
|
|
90
|
+
// @public (undocumented)
|
|
91
|
+
export class Rect {
|
|
92
|
+
constructor(left: number, top: number, right: number, bottom: number);
|
|
93
|
+
// (undocumented)
|
|
94
|
+
bottom: number;
|
|
95
|
+
// (undocumented)
|
|
60
96
|
left: number;
|
|
61
|
-
|
|
97
|
+
// (undocumented)
|
|
62
98
|
right: number;
|
|
63
|
-
|
|
64
|
-
|
|
99
|
+
// (undocumented)
|
|
100
|
+
top: number;
|
|
65
101
|
}
|
|
66
102
|
|
|
67
|
-
|
|
68
|
-
|
|
103
|
+
// @public (undocumented)
|
|
104
|
+
interface SerializedCellSelection {
|
|
105
|
+
// (undocumented)
|
|
69
106
|
anchor: number;
|
|
107
|
+
// (undocumented)
|
|
70
108
|
head: number;
|
|
109
|
+
// (undocumented)
|
|
110
|
+
type: 'cell';
|
|
71
111
|
}
|
|
72
112
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
height: number;
|
|
76
|
-
map: number[];
|
|
77
|
-
problems?: TableProblem[] | null;
|
|
113
|
+
// @public (undocumented)
|
|
114
|
+
export class TableMap {
|
|
78
115
|
constructor(
|
|
79
116
|
width: number,
|
|
80
117
|
height: number,
|
|
81
118
|
map: number[],
|
|
82
119
|
problems?: TableProblem[] | null,
|
|
83
120
|
);
|
|
84
|
-
|
|
121
|
+
// (undocumented)
|
|
122
|
+
cellsInRect(rect: Rect): number[];
|
|
123
|
+
// (undocumented)
|
|
85
124
|
colCount(pos: number): number;
|
|
125
|
+
// (undocumented)
|
|
126
|
+
findCell(pos: number): Rect;
|
|
127
|
+
// (undocumented)
|
|
128
|
+
static get(table: Node_2): TableMap;
|
|
129
|
+
// (undocumented)
|
|
130
|
+
height: number;
|
|
131
|
+
// (undocumented)
|
|
132
|
+
map: number[];
|
|
133
|
+
// (undocumented)
|
|
86
134
|
nextCell(pos: number, axis: Axis, dir: number): number | null;
|
|
87
|
-
|
|
88
|
-
cellsInRect(rect: Rect): number[];
|
|
135
|
+
// (undocumented)
|
|
89
136
|
positionAt(row: number, col: number, table: Node_2): number;
|
|
90
|
-
|
|
137
|
+
// (undocumented)
|
|
138
|
+
problems?: TableProblem[] | null;
|
|
139
|
+
// (undocumented)
|
|
140
|
+
rectBetween(a: number, b: number): Rect;
|
|
141
|
+
// (undocumented)
|
|
142
|
+
width: number;
|
|
91
143
|
}
|
|
92
144
|
|
|
93
|
-
|
|
145
|
+
// @public (undocumented)
|
|
146
|
+
type TableProblem =
|
|
94
147
|
| TableProblemCollision
|
|
95
148
|
| TableProblemLongRowspan
|
|
96
149
|
| TableProblemMissing
|
|
97
150
|
| TableProblemColWidthMismatch;
|
|
98
151
|
|
|
99
|
-
|
|
152
|
+
// @public (undocumented)
|
|
153
|
+
type TableProblemCollision = {
|
|
100
154
|
type: TableProblemTypes.COLLISION;
|
|
101
155
|
row: number;
|
|
102
156
|
pos: number;
|
|
103
157
|
n: number;
|
|
104
158
|
};
|
|
105
159
|
|
|
106
|
-
|
|
160
|
+
// @public (undocumented)
|
|
161
|
+
type TableProblemColWidthMismatch = {
|
|
107
162
|
type: TableProblemTypes;
|
|
108
163
|
pos: number;
|
|
109
164
|
colwidth: number;
|
|
110
165
|
};
|
|
111
166
|
|
|
112
|
-
|
|
167
|
+
// @public (undocumented)
|
|
168
|
+
type TableProblemLongRowspan = {
|
|
113
169
|
type: TableProblemTypes.OVERLONG_ROWSPAN;
|
|
114
170
|
pos: number;
|
|
115
171
|
n: number;
|
|
116
172
|
};
|
|
117
173
|
|
|
118
|
-
|
|
174
|
+
// @public (undocumented)
|
|
175
|
+
type TableProblemMissing = {
|
|
119
176
|
type: TableProblemTypes.MISSING;
|
|
120
177
|
row: number;
|
|
121
178
|
n: number;
|
|
122
179
|
};
|
|
123
180
|
|
|
124
|
-
|
|
181
|
+
// @public (undocumented)
|
|
182
|
+
enum TableProblemTypes {
|
|
183
|
+
// (undocumented)
|
|
125
184
|
COLLISION = 'collision',
|
|
126
|
-
|
|
127
|
-
MISSING = 'missing',
|
|
185
|
+
// (undocumented)
|
|
128
186
|
COLWIDTH_MISMATCH = 'colwidth mismatch',
|
|
187
|
+
// (undocumented)
|
|
188
|
+
MISSING = 'missing',
|
|
189
|
+
// (undocumented)
|
|
190
|
+
OVERLONG_ROWSPAN = 'overlong_rowspan',
|
|
129
191
|
}
|
|
130
192
|
|
|
131
|
-
|
|
193
|
+
// @public (undocumented)
|
|
194
|
+
export const uuid: {
|
|
132
195
|
setStatic(value: string | false): void;
|
|
133
196
|
generate(): string;
|
|
134
197
|
};
|
|
135
198
|
|
|
136
|
-
|
|
199
|
+
// (No @packageDocumentation comment for this package)
|
|
137
200
|
```
|
package/table-map/package.json
CHANGED
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/table-map.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/table-map.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/table-map.d.ts"
|
|
7
|
+
"types": "../dist/types/table-map.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/table-map.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
package/types/package.json
CHANGED
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/types.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/types.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/types.d.ts"
|
|
7
|
+
"types": "../dist/types/types.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/types.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
package/utils/package.json
CHANGED
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/utils.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/utils.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/utils.d.ts"
|
|
7
|
+
"types": "../dist/types/utils.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/utils.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|