@tiptap/extension-table 2.0.0-beta.35 → 2.0.0-beta.39
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/dist/tiptap-extension-table.cjs.js +15 -13
- package/dist/tiptap-extension-table.cjs.js.map +1 -1
- package/dist/tiptap-extension-table.esm.js +15 -13
- package/dist/tiptap-extension-table.esm.js.map +1 -1
- package/dist/tiptap-extension-table.umd.js +15 -13
- package/dist/tiptap-extension-table.umd.js.map +1 -1
- package/package.json +3 -3
- package/src/table.ts +12 -10
|
@@ -99,7 +99,7 @@ Fragment.prototype.descendants = function descendants (f) {
|
|
|
99
99
|
this.nodesBetween(0, this.size, f);
|
|
100
100
|
};
|
|
101
101
|
|
|
102
|
-
// :: (number, number, ?string, ?string) → string
|
|
102
|
+
// :: (number, number, ?string, ?string | ?(leafNode: Node) -> string) → string
|
|
103
103
|
// Extract the text between `from` and `to`. See the same method on
|
|
104
104
|
// [`Node`](#model.Node.textBetween).
|
|
105
105
|
Fragment.prototype.textBetween = function textBetween (from, to, blockSeparator, leafText) {
|
|
@@ -109,7 +109,7 @@ Fragment.prototype.textBetween = function textBetween (from, to, blockSeparator,
|
|
|
109
109
|
text += node.text.slice(Math.max(from, pos) - pos, to - pos);
|
|
110
110
|
separated = !blockSeparator;
|
|
111
111
|
} else if (node.isLeaf && leafText) {
|
|
112
|
-
text += leafText;
|
|
112
|
+
text += typeof leafText === 'function' ? leafText(node): leafText;
|
|
113
113
|
separated = !blockSeparator;
|
|
114
114
|
} else if (!separated && node.isBlock) {
|
|
115
115
|
text += blockSeparator;
|
|
@@ -1088,7 +1088,7 @@ Node.prototype.descendants = function descendants (f) {
|
|
|
1088
1088
|
// children.
|
|
1089
1089
|
prototypeAccessors$3$1.textContent.get = function () { return this.textBetween(0, this.content.size, "") };
|
|
1090
1090
|
|
|
1091
|
-
// :: (number, number, ?string, ?string) → string
|
|
1091
|
+
// :: (number, number, ?string, ?string | ?(leafNode: Node) -> string) → string
|
|
1092
1092
|
// Get all text between positions `from` and `to`. When
|
|
1093
1093
|
// `blockSeparator` is given, it will be inserted whenever a new
|
|
1094
1094
|
// block node is started. When `leafText` is given, it'll be
|
|
@@ -5297,16 +5297,18 @@ class TableView {
|
|
|
5297
5297
|
|
|
5298
5298
|
const Table = core.Node.create({
|
|
5299
5299
|
name: 'table',
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5300
|
+
// @ts-ignore
|
|
5301
|
+
addOptions() {
|
|
5302
|
+
return {
|
|
5303
|
+
HTMLAttributes: {},
|
|
5304
|
+
resizable: false,
|
|
5305
|
+
handleWidth: 5,
|
|
5306
|
+
cellMinWidth: 25,
|
|
5307
|
+
// TODO: fix
|
|
5308
|
+
View: TableView,
|
|
5309
|
+
lastColumnResizable: true,
|
|
5310
|
+
allowTableNodeSelection: false,
|
|
5311
|
+
};
|
|
5310
5312
|
},
|
|
5311
5313
|
content: 'tableRow+',
|
|
5312
5314
|
tableRole: 'table',
|