prosemirror-transform 1.12.1 → 1.12.2
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 +5 -2
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +6 -3
- package/package.json +1 -1
- package/src/attr_step.ts +1 -1
- package/src/map.ts +5 -2
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -107,8 +107,11 @@ var StepMap = function () {
|
|
|
107
107
|
var result = start + diff + (side < 0 ? 0 : newSize);
|
|
108
108
|
if (simple) return result;
|
|
109
109
|
var recover = pos == (assoc < 0 ? start : end) ? null : makeRecover(i / 3, pos - start);
|
|
110
|
-
var del =
|
|
111
|
-
if (
|
|
110
|
+
var del = 0;
|
|
111
|
+
if (oldSize) {
|
|
112
|
+
del |= pos == start ? DEL_AFTER : pos == end ? DEL_BEFORE : DEL_ACROSS;
|
|
113
|
+
if (assoc < 0 ? pos != start : pos != end) del |= DEL_SIDE;
|
|
114
|
+
}
|
|
112
115
|
return new MapResult(result, del, recover);
|
|
113
116
|
}
|
|
114
117
|
diff += newSize - oldSize;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node,
|
|
1
|
+
import { Node, Slice, Schema, Fragment, NodeRange, NodeType, Attrs, Mark, MarkType, ContentMatch } from 'prosemirror-model';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
There are several things that positions can be mapped through.
|
|
@@ -853,4 +853,5 @@ would be a no-op (an empty slice over an empty range).
|
|
|
853
853
|
*/
|
|
854
854
|
declare function replaceStep(doc: Node, from: number, to?: number, slice?: Slice): Step | null;
|
|
855
855
|
|
|
856
|
-
export { AddMarkStep, AddNodeMarkStep, AttrStep, DocAttrStep, MapResult,
|
|
856
|
+
export { AddMarkStep, AddNodeMarkStep, AttrStep, DocAttrStep, MapResult, Mapping, RemoveMarkStep, RemoveNodeMarkStep, ReplaceAroundStep, ReplaceStep, Step, StepMap, StepResult, Transform, canJoin, canSplit, dropPoint, findWrapping, insertPoint, joinPoint, liftTarget, replaceStep };
|
|
857
|
+
export type { Mappable };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node,
|
|
1
|
+
import { Node, Slice, Schema, Fragment, NodeRange, NodeType, Attrs, Mark, MarkType, ContentMatch } from 'prosemirror-model';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
There are several things that positions can be mapped through.
|
|
@@ -853,4 +853,5 @@ would be a no-op (an empty slice over an empty range).
|
|
|
853
853
|
*/
|
|
854
854
|
declare function replaceStep(doc: Node, from: number, to?: number, slice?: Slice): Step | null;
|
|
855
855
|
|
|
856
|
-
export { AddMarkStep, AddNodeMarkStep, AttrStep, DocAttrStep, MapResult,
|
|
856
|
+
export { AddMarkStep, AddNodeMarkStep, AttrStep, DocAttrStep, MapResult, Mapping, RemoveMarkStep, RemoveNodeMarkStep, ReplaceAroundStep, ReplaceStep, Step, StepMap, StepResult, Transform, canJoin, canSplit, dropPoint, findWrapping, insertPoint, joinPoint, liftTarget, replaceStep };
|
|
857
|
+
export type { Mappable };
|
package/dist/index.js
CHANGED
|
@@ -115,9 +115,12 @@ class StepMap {
|
|
|
115
115
|
if (simple)
|
|
116
116
|
return result;
|
|
117
117
|
let recover = pos == (assoc < 0 ? start : end) ? null : makeRecover(i / 3, pos - start);
|
|
118
|
-
let del =
|
|
119
|
-
if (
|
|
120
|
-
del |=
|
|
118
|
+
let del = 0;
|
|
119
|
+
if (oldSize) {
|
|
120
|
+
del |= pos == start ? DEL_AFTER : pos == end ? DEL_BEFORE : DEL_ACROSS;
|
|
121
|
+
if (assoc < 0 ? pos != start : pos != end)
|
|
122
|
+
del |= DEL_SIDE;
|
|
123
|
+
}
|
|
121
124
|
return new MapResult(result, del, recover);
|
|
122
125
|
}
|
|
123
126
|
diff += newSize - oldSize;
|
package/package.json
CHANGED
package/src/attr_step.ts
CHANGED
package/src/map.ts
CHANGED
|
@@ -106,8 +106,11 @@ export class StepMap implements Mappable {
|
|
|
106
106
|
let result = start + diff + (side < 0 ? 0 : newSize)
|
|
107
107
|
if (simple) return result
|
|
108
108
|
let recover = pos == (assoc < 0 ? start : end) ? null : makeRecover(i / 3, pos - start)
|
|
109
|
-
let del =
|
|
110
|
-
if (
|
|
109
|
+
let del = 0
|
|
110
|
+
if (oldSize) {
|
|
111
|
+
del |= pos == start ? DEL_AFTER : pos == end ? DEL_BEFORE : DEL_ACROSS
|
|
112
|
+
if (assoc < 0 ? pos != start : pos != end) del |= DEL_SIDE
|
|
113
|
+
}
|
|
111
114
|
return new MapResult(result, del, recover)
|
|
112
115
|
}
|
|
113
116
|
diff += newSize - oldSize
|