prosemirror-transform 1.10.2 → 1.10.3
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 +6 -0
- package/dist/index.cjs +24 -20
- package/dist/index.d.cts +9 -11
- package/dist/index.d.ts +9 -11
- package/dist/index.js +25 -25
- package/package.json +1 -1
- package/src/map.ts +28 -19
- package/src/transform.ts +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -167,41 +167,45 @@ var StepMap = function () {
|
|
|
167
167
|
}();
|
|
168
168
|
StepMap.empty = new StepMap([]);
|
|
169
169
|
var Mapping = function () {
|
|
170
|
-
function Mapping() {
|
|
171
|
-
var maps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
172
|
-
var mirror = arguments.length > 1 ? arguments[1] : undefined;
|
|
170
|
+
function Mapping(maps, mirror) {
|
|
173
171
|
var from = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
174
|
-
var to = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : maps.length;
|
|
172
|
+
var to = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : maps ? maps.length : 0;
|
|
175
173
|
_classCallCheck(this, Mapping);
|
|
176
|
-
this.maps = maps;
|
|
177
174
|
this.mirror = mirror;
|
|
178
175
|
this.from = from;
|
|
179
176
|
this.to = to;
|
|
177
|
+
this._maps = maps || [];
|
|
178
|
+
this.ownData = !(maps || mirror);
|
|
180
179
|
}
|
|
181
180
|
_createClass(Mapping, [{
|
|
181
|
+
key: "maps",
|
|
182
|
+
get: function get() {
|
|
183
|
+
return this._maps;
|
|
184
|
+
}
|
|
185
|
+
}, {
|
|
182
186
|
key: "slice",
|
|
183
187
|
value: function slice() {
|
|
184
188
|
var from = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
185
189
|
var to = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.maps.length;
|
|
186
|
-
return new Mapping(this.
|
|
187
|
-
}
|
|
188
|
-
}, {
|
|
189
|
-
key: "copy",
|
|
190
|
-
value: function copy() {
|
|
191
|
-
return new Mapping(this.maps.slice(), this.mirror && this.mirror.slice(), this.from, this.to);
|
|
190
|
+
return new Mapping(this._maps, this.mirror, from, to);
|
|
192
191
|
}
|
|
193
192
|
}, {
|
|
194
193
|
key: "appendMap",
|
|
195
194
|
value: function appendMap(map, mirrors) {
|
|
196
|
-
|
|
197
|
-
|
|
195
|
+
if (!this.ownData) {
|
|
196
|
+
this._maps = this._maps.slice();
|
|
197
|
+
this.mirror = this.mirror && this.mirror.slice();
|
|
198
|
+
this.ownData = true;
|
|
199
|
+
}
|
|
200
|
+
this.to = this._maps.push(map);
|
|
201
|
+
if (mirrors != null) this.setMirror(this._maps.length - 1, mirrors);
|
|
198
202
|
}
|
|
199
203
|
}, {
|
|
200
204
|
key: "appendMapping",
|
|
201
205
|
value: function appendMapping(mapping) {
|
|
202
|
-
for (var i = 0, startSize = this.
|
|
206
|
+
for (var i = 0, startSize = this._maps.length; i < mapping._maps.length; i++) {
|
|
203
207
|
var mirr = mapping.getMirror(i);
|
|
204
|
-
this.appendMap(mapping.
|
|
208
|
+
this.appendMap(mapping._maps[i], mirr != null && mirr < i ? startSize + mirr : undefined);
|
|
205
209
|
}
|
|
206
210
|
}
|
|
207
211
|
}, {
|
|
@@ -218,9 +222,9 @@ var Mapping = function () {
|
|
|
218
222
|
}, {
|
|
219
223
|
key: "appendMappingInverted",
|
|
220
224
|
value: function appendMappingInverted(mapping) {
|
|
221
|
-
for (var i = mapping.maps.length - 1, totalSize = this.
|
|
225
|
+
for (var i = mapping.maps.length - 1, totalSize = this._maps.length + mapping._maps.length; i >= 0; i--) {
|
|
222
226
|
var mirr = mapping.getMirror(i);
|
|
223
|
-
this.appendMap(mapping.
|
|
227
|
+
this.appendMap(mapping._maps[i].invert(), mirr != null && mirr > i ? totalSize - mirr - 1 : undefined);
|
|
224
228
|
}
|
|
225
229
|
}
|
|
226
230
|
}, {
|
|
@@ -235,7 +239,7 @@ var Mapping = function () {
|
|
|
235
239
|
value: function map(pos) {
|
|
236
240
|
var assoc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
237
241
|
if (this.mirror) return this._map(pos, assoc, true);
|
|
238
|
-
for (var i = this.from; i < this.to; i++) pos = this.
|
|
242
|
+
for (var i = this.from; i < this.to; i++) pos = this._maps[i].map(pos, assoc);
|
|
239
243
|
return pos;
|
|
240
244
|
}
|
|
241
245
|
}, {
|
|
@@ -249,13 +253,13 @@ var Mapping = function () {
|
|
|
249
253
|
value: function _map(pos, assoc, simple) {
|
|
250
254
|
var delInfo = 0;
|
|
251
255
|
for (var i = this.from; i < this.to; i++) {
|
|
252
|
-
var map = this.
|
|
256
|
+
var map = this._maps[i],
|
|
253
257
|
result = map.mapResult(pos, assoc);
|
|
254
258
|
if (result.recover != null) {
|
|
255
259
|
var corr = this.getMirror(i);
|
|
256
260
|
if (corr != null && corr > i && corr < this.to) {
|
|
257
261
|
i = corr;
|
|
258
|
-
pos = this.
|
|
262
|
+
pos = this._maps[corr].recover(result.recover);
|
|
259
263
|
continue;
|
|
260
264
|
}
|
|
261
265
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -101,14 +101,10 @@ A mapping represents a pipeline of zero or more [step
|
|
|
101
101
|
maps](https://prosemirror.net/docs/ref/#transform.StepMap). It has special provisions for losslessly
|
|
102
102
|
handling mapping positions through a series of steps in which some
|
|
103
103
|
steps are inverted versions of earlier steps. (This comes up when
|
|
104
|
-
‘[rebasing](/docs/guide/#transform.rebasing)’ steps for
|
|
104
|
+
‘[rebasing](https://prosemirror.net/docs/guide/#transform.rebasing)’ steps for
|
|
105
105
|
collaboration or history management.)
|
|
106
106
|
*/
|
|
107
107
|
declare class Mapping implements Mappable {
|
|
108
|
-
/**
|
|
109
|
-
The step maps in this mapping.
|
|
110
|
-
*/
|
|
111
|
-
readonly maps: StepMap[];
|
|
112
108
|
/**
|
|
113
109
|
The starting position in the `maps` array, used when `map` or
|
|
114
110
|
`mapResult` is called.
|
|
@@ -121,11 +117,7 @@ declare class Mapping implements Mappable {
|
|
|
121
117
|
/**
|
|
122
118
|
Create a new mapping with the given position maps.
|
|
123
119
|
*/
|
|
124
|
-
constructor(
|
|
125
|
-
/**
|
|
126
|
-
The step maps in this mapping.
|
|
127
|
-
*/
|
|
128
|
-
maps?: StepMap[],
|
|
120
|
+
constructor(maps?: readonly StepMap[],
|
|
129
121
|
/**
|
|
130
122
|
@internal
|
|
131
123
|
*/
|
|
@@ -140,6 +132,12 @@ declare class Mapping implements Mappable {
|
|
|
140
132
|
*/
|
|
141
133
|
to?: number);
|
|
142
134
|
/**
|
|
135
|
+
The step maps in this mapping.
|
|
136
|
+
*/
|
|
137
|
+
get maps(): readonly StepMap[];
|
|
138
|
+
private _maps;
|
|
139
|
+
private ownData;
|
|
140
|
+
/**
|
|
143
141
|
Create a mapping that maps only through a part of this one.
|
|
144
142
|
*/
|
|
145
143
|
slice(from?: number, to?: number): Mapping;
|
|
@@ -436,7 +434,7 @@ declare class Transform {
|
|
|
436
434
|
greater than one, any number of nodes above that. By default, the
|
|
437
435
|
parts split off will inherit the node type of the original node.
|
|
438
436
|
This can be changed by passing an array of types and attributes to
|
|
439
|
-
use after the split.
|
|
437
|
+
use after the split (with the outermost nodes coming first).
|
|
440
438
|
*/
|
|
441
439
|
split(pos: number, depth?: number, typesAfter?: (null | {
|
|
442
440
|
type: NodeType;
|
package/dist/index.d.ts
CHANGED
|
@@ -101,14 +101,10 @@ A mapping represents a pipeline of zero or more [step
|
|
|
101
101
|
maps](https://prosemirror.net/docs/ref/#transform.StepMap). It has special provisions for losslessly
|
|
102
102
|
handling mapping positions through a series of steps in which some
|
|
103
103
|
steps are inverted versions of earlier steps. (This comes up when
|
|
104
|
-
‘[rebasing](/docs/guide/#transform.rebasing)’ steps for
|
|
104
|
+
‘[rebasing](https://prosemirror.net/docs/guide/#transform.rebasing)’ steps for
|
|
105
105
|
collaboration or history management.)
|
|
106
106
|
*/
|
|
107
107
|
declare class Mapping implements Mappable {
|
|
108
|
-
/**
|
|
109
|
-
The step maps in this mapping.
|
|
110
|
-
*/
|
|
111
|
-
readonly maps: StepMap[];
|
|
112
108
|
/**
|
|
113
109
|
The starting position in the `maps` array, used when `map` or
|
|
114
110
|
`mapResult` is called.
|
|
@@ -121,11 +117,7 @@ declare class Mapping implements Mappable {
|
|
|
121
117
|
/**
|
|
122
118
|
Create a new mapping with the given position maps.
|
|
123
119
|
*/
|
|
124
|
-
constructor(
|
|
125
|
-
/**
|
|
126
|
-
The step maps in this mapping.
|
|
127
|
-
*/
|
|
128
|
-
maps?: StepMap[],
|
|
120
|
+
constructor(maps?: readonly StepMap[],
|
|
129
121
|
/**
|
|
130
122
|
@internal
|
|
131
123
|
*/
|
|
@@ -140,6 +132,12 @@ declare class Mapping implements Mappable {
|
|
|
140
132
|
*/
|
|
141
133
|
to?: number);
|
|
142
134
|
/**
|
|
135
|
+
The step maps in this mapping.
|
|
136
|
+
*/
|
|
137
|
+
get maps(): readonly StepMap[];
|
|
138
|
+
private _maps;
|
|
139
|
+
private ownData;
|
|
140
|
+
/**
|
|
143
141
|
Create a mapping that maps only through a part of this one.
|
|
144
142
|
*/
|
|
145
143
|
slice(from?: number, to?: number): Mapping;
|
|
@@ -436,7 +434,7 @@ declare class Transform {
|
|
|
436
434
|
greater than one, any number of nodes above that. By default, the
|
|
437
435
|
parts split off will inherit the node type of the original node.
|
|
438
436
|
This can be changed by passing an array of types and attributes to
|
|
439
|
-
use after the split.
|
|
437
|
+
use after the split (with the outermost nodes coming first).
|
|
440
438
|
*/
|
|
441
439
|
split(pos: number, depth?: number, typesAfter?: (null | {
|
|
442
440
|
type: NodeType;
|
package/dist/index.js
CHANGED
|
@@ -185,18 +185,14 @@ A mapping represents a pipeline of zero or more [step
|
|
|
185
185
|
maps](https://prosemirror.net/docs/ref/#transform.StepMap). It has special provisions for losslessly
|
|
186
186
|
handling mapping positions through a series of steps in which some
|
|
187
187
|
steps are inverted versions of earlier steps. (This comes up when
|
|
188
|
-
‘[rebasing](/docs/guide/#transform.rebasing)’ steps for
|
|
188
|
+
‘[rebasing](https://prosemirror.net/docs/guide/#transform.rebasing)’ steps for
|
|
189
189
|
collaboration or history management.)
|
|
190
190
|
*/
|
|
191
191
|
class Mapping {
|
|
192
192
|
/**
|
|
193
193
|
Create a new mapping with the given position maps.
|
|
194
194
|
*/
|
|
195
|
-
constructor(
|
|
196
|
-
/**
|
|
197
|
-
The step maps in this mapping.
|
|
198
|
-
*/
|
|
199
|
-
maps = [],
|
|
195
|
+
constructor(maps,
|
|
200
196
|
/**
|
|
201
197
|
@internal
|
|
202
198
|
*/
|
|
@@ -209,23 +205,22 @@ class Mapping {
|
|
|
209
205
|
/**
|
|
210
206
|
The end position in the `maps` array.
|
|
211
207
|
*/
|
|
212
|
-
to = maps.length) {
|
|
213
|
-
this.maps = maps;
|
|
208
|
+
to = maps ? maps.length : 0) {
|
|
214
209
|
this.mirror = mirror;
|
|
215
210
|
this.from = from;
|
|
216
211
|
this.to = to;
|
|
212
|
+
this._maps = maps || [];
|
|
213
|
+
this.ownData = !(maps || mirror);
|
|
217
214
|
}
|
|
218
215
|
/**
|
|
219
|
-
|
|
216
|
+
The step maps in this mapping.
|
|
220
217
|
*/
|
|
221
|
-
|
|
222
|
-
return new Mapping(this.maps, this.mirror, from, to);
|
|
223
|
-
}
|
|
218
|
+
get maps() { return this._maps; }
|
|
224
219
|
/**
|
|
225
|
-
|
|
220
|
+
Create a mapping that maps only through a part of this one.
|
|
226
221
|
*/
|
|
227
|
-
|
|
228
|
-
return new Mapping(this.
|
|
222
|
+
slice(from = 0, to = this.maps.length) {
|
|
223
|
+
return new Mapping(this._maps, this.mirror, from, to);
|
|
229
224
|
}
|
|
230
225
|
/**
|
|
231
226
|
Add a step map to the end of this mapping. If `mirrors` is
|
|
@@ -233,18 +228,23 @@ class Mapping {
|
|
|
233
228
|
image of this one.
|
|
234
229
|
*/
|
|
235
230
|
appendMap(map, mirrors) {
|
|
236
|
-
|
|
231
|
+
if (!this.ownData) {
|
|
232
|
+
this._maps = this._maps.slice();
|
|
233
|
+
this.mirror = this.mirror && this.mirror.slice();
|
|
234
|
+
this.ownData = true;
|
|
235
|
+
}
|
|
236
|
+
this.to = this._maps.push(map);
|
|
237
237
|
if (mirrors != null)
|
|
238
|
-
this.setMirror(this.
|
|
238
|
+
this.setMirror(this._maps.length - 1, mirrors);
|
|
239
239
|
}
|
|
240
240
|
/**
|
|
241
241
|
Add all the step maps in a given mapping to this one (preserving
|
|
242
242
|
mirroring information).
|
|
243
243
|
*/
|
|
244
244
|
appendMapping(mapping) {
|
|
245
|
-
for (let i = 0, startSize = this.
|
|
245
|
+
for (let i = 0, startSize = this._maps.length; i < mapping._maps.length; i++) {
|
|
246
246
|
let mirr = mapping.getMirror(i);
|
|
247
|
-
this.appendMap(mapping.
|
|
247
|
+
this.appendMap(mapping._maps[i], mirr != null && mirr < i ? startSize + mirr : undefined);
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
250
|
/**
|
|
@@ -270,9 +270,9 @@ class Mapping {
|
|
|
270
270
|
Append the inverse of the given mapping to this one.
|
|
271
271
|
*/
|
|
272
272
|
appendMappingInverted(mapping) {
|
|
273
|
-
for (let i = mapping.maps.length - 1, totalSize = this.
|
|
273
|
+
for (let i = mapping.maps.length - 1, totalSize = this._maps.length + mapping._maps.length; i >= 0; i--) {
|
|
274
274
|
let mirr = mapping.getMirror(i);
|
|
275
|
-
this.appendMap(mapping.
|
|
275
|
+
this.appendMap(mapping._maps[i].invert(), mirr != null && mirr > i ? totalSize - mirr - 1 : undefined);
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
/**
|
|
@@ -290,7 +290,7 @@ class Mapping {
|
|
|
290
290
|
if (this.mirror)
|
|
291
291
|
return this._map(pos, assoc, true);
|
|
292
292
|
for (let i = this.from; i < this.to; i++)
|
|
293
|
-
pos = this.
|
|
293
|
+
pos = this._maps[i].map(pos, assoc);
|
|
294
294
|
return pos;
|
|
295
295
|
}
|
|
296
296
|
/**
|
|
@@ -304,12 +304,12 @@ class Mapping {
|
|
|
304
304
|
_map(pos, assoc, simple) {
|
|
305
305
|
let delInfo = 0;
|
|
306
306
|
for (let i = this.from; i < this.to; i++) {
|
|
307
|
-
let map = this.
|
|
307
|
+
let map = this._maps[i], result = map.mapResult(pos, assoc);
|
|
308
308
|
if (result.recover != null) {
|
|
309
309
|
let corr = this.getMirror(i);
|
|
310
310
|
if (corr != null && corr > i && corr < this.to) {
|
|
311
311
|
i = corr;
|
|
312
|
-
pos = this.
|
|
312
|
+
pos = this._maps[corr].recover(result.recover);
|
|
313
313
|
continue;
|
|
314
314
|
}
|
|
315
315
|
}
|
|
@@ -2111,7 +2111,7 @@ class Transform {
|
|
|
2111
2111
|
greater than one, any number of nodes above that. By default, the
|
|
2112
2112
|
parts split off will inherit the node type of the original node.
|
|
2113
2113
|
This can be changed by passing an array of types and attributes to
|
|
2114
|
-
use after the split.
|
|
2114
|
+
use after the split (with the outermost nodes coming first).
|
|
2115
2115
|
*/
|
|
2116
2116
|
split(pos, depth = 1, typesAfter) {
|
|
2117
2117
|
split(this, pos, depth, typesAfter);
|
package/package.json
CHANGED
package/src/map.ts
CHANGED
|
@@ -172,41 +172,50 @@ export class StepMap implements Mappable {
|
|
|
172
172
|
export class Mapping implements Mappable {
|
|
173
173
|
/// Create a new mapping with the given position maps.
|
|
174
174
|
constructor(
|
|
175
|
-
|
|
176
|
-
readonly maps: StepMap[] = [],
|
|
175
|
+
maps?: readonly StepMap[],
|
|
177
176
|
/// @internal
|
|
178
177
|
public mirror?: number[],
|
|
179
178
|
/// The starting position in the `maps` array, used when `map` or
|
|
180
179
|
/// `mapResult` is called.
|
|
181
180
|
public from = 0,
|
|
182
181
|
/// The end position in the `maps` array.
|
|
183
|
-
public to = maps.length
|
|
184
|
-
) {
|
|
182
|
+
public to = maps ? maps.length : 0
|
|
183
|
+
) {
|
|
184
|
+
this._maps = (maps as StepMap[]) || []
|
|
185
|
+
this.ownData = !(maps || mirror)
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/// The step maps in this mapping.
|
|
189
|
+
get maps(): readonly StepMap[] { return this._maps }
|
|
190
|
+
|
|
191
|
+
private _maps: StepMap[]
|
|
192
|
+
// False if maps/mirror are shared arrays that we shouldn't mutate
|
|
193
|
+
private ownData: boolean
|
|
185
194
|
|
|
186
195
|
/// Create a mapping that maps only through a part of this one.
|
|
187
196
|
slice(from = 0, to = this.maps.length) {
|
|
188
|
-
return new Mapping(this.
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/// @internal
|
|
192
|
-
copy() {
|
|
193
|
-
return new Mapping(this.maps.slice(), this.mirror && this.mirror.slice(), this.from, this.to)
|
|
197
|
+
return new Mapping(this._maps, this.mirror, from, to)
|
|
194
198
|
}
|
|
195
199
|
|
|
196
200
|
/// Add a step map to the end of this mapping. If `mirrors` is
|
|
197
201
|
/// given, it should be the index of the step map that is the mirror
|
|
198
202
|
/// image of this one.
|
|
199
203
|
appendMap(map: StepMap, mirrors?: number) {
|
|
200
|
-
|
|
201
|
-
|
|
204
|
+
if (!this.ownData) {
|
|
205
|
+
this._maps = this._maps.slice()
|
|
206
|
+
this.mirror = this.mirror && this.mirror.slice()
|
|
207
|
+
this.ownData = true
|
|
208
|
+
}
|
|
209
|
+
this.to = this._maps.push(map)
|
|
210
|
+
if (mirrors != null) this.setMirror(this._maps.length - 1, mirrors)
|
|
202
211
|
}
|
|
203
212
|
|
|
204
213
|
/// Add all the step maps in a given mapping to this one (preserving
|
|
205
214
|
/// mirroring information).
|
|
206
215
|
appendMapping(mapping: Mapping) {
|
|
207
|
-
for (let i = 0, startSize = this.
|
|
216
|
+
for (let i = 0, startSize = this._maps.length; i < mapping._maps.length; i++) {
|
|
208
217
|
let mirr = mapping.getMirror(i)
|
|
209
|
-
this.appendMap(mapping.
|
|
218
|
+
this.appendMap(mapping._maps[i], mirr != null && mirr < i ? startSize + mirr : undefined)
|
|
210
219
|
}
|
|
211
220
|
}
|
|
212
221
|
|
|
@@ -226,9 +235,9 @@ export class Mapping implements Mappable {
|
|
|
226
235
|
|
|
227
236
|
/// Append the inverse of the given mapping to this one.
|
|
228
237
|
appendMappingInverted(mapping: Mapping) {
|
|
229
|
-
for (let i = mapping.maps.length - 1, totalSize = this.
|
|
238
|
+
for (let i = mapping.maps.length - 1, totalSize = this._maps.length + mapping._maps.length; i >= 0; i--) {
|
|
230
239
|
let mirr = mapping.getMirror(i)
|
|
231
|
-
this.appendMap(mapping.
|
|
240
|
+
this.appendMap(mapping._maps[i].invert(), mirr != null && mirr > i ? totalSize - mirr - 1 : undefined)
|
|
232
241
|
}
|
|
233
242
|
}
|
|
234
243
|
|
|
@@ -243,7 +252,7 @@ export class Mapping implements Mappable {
|
|
|
243
252
|
map(pos: number, assoc = 1) {
|
|
244
253
|
if (this.mirror) return this._map(pos, assoc, true) as number
|
|
245
254
|
for (let i = this.from; i < this.to; i++)
|
|
246
|
-
pos = this.
|
|
255
|
+
pos = this._maps[i].map(pos, assoc)
|
|
247
256
|
return pos
|
|
248
257
|
}
|
|
249
258
|
|
|
@@ -256,12 +265,12 @@ export class Mapping implements Mappable {
|
|
|
256
265
|
let delInfo = 0
|
|
257
266
|
|
|
258
267
|
for (let i = this.from; i < this.to; i++) {
|
|
259
|
-
let map = this.
|
|
268
|
+
let map = this._maps[i], result = map.mapResult(pos, assoc)
|
|
260
269
|
if (result.recover != null) {
|
|
261
270
|
let corr = this.getMirror(i)
|
|
262
271
|
if (corr != null && corr > i && corr < this.to) {
|
|
263
272
|
i = corr
|
|
264
|
-
pos = this.
|
|
273
|
+
pos = this._maps[corr].recover(result.recover)
|
|
265
274
|
continue
|
|
266
275
|
}
|
|
267
276
|
}
|
package/src/transform.ts
CHANGED
|
@@ -215,7 +215,7 @@ export class Transform {
|
|
|
215
215
|
/// greater than one, any number of nodes above that. By default, the
|
|
216
216
|
/// parts split off will inherit the node type of the original node.
|
|
217
217
|
/// This can be changed by passing an array of types and attributes to
|
|
218
|
-
/// use after the split.
|
|
218
|
+
/// use after the split (with the outermost nodes coming first).
|
|
219
219
|
split(pos: number, depth = 1, typesAfter?: (null | {type: NodeType, attrs?: Attrs | null})[]) {
|
|
220
220
|
split(this, pos, depth, typesAfter)
|
|
221
221
|
return this
|