prosemirror-view 1.32.4 → 1.32.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 CHANGED
@@ -1,3 +1,9 @@
1
+ ## 1.32.5 (2023-12-04)
2
+
3
+ ### Bug fixes
4
+
5
+ Fix a bug in `DecorationSet.map` that, in specific cases when mapping through groups of changes, move decorations to the wrong position.
6
+
1
7
  ## 1.32.4 (2023-11-08)
2
8
 
3
9
  ### Bug fixes
package/dist/index.cjs CHANGED
@@ -4678,7 +4678,7 @@ function mapChildren(oldChildren, newLocal, mapping, node, offset, oldOffset, op
4678
4678
 
4679
4679
  if (oldEnd >= start) {
4680
4680
  children[_i12 + 1] = oldStart <= start ? -2 : -1;
4681
- } else if (newStart >= offset && dSize) {
4681
+ } else if (oldStart >= _baseOffset && dSize) {
4682
4682
  children[_i12] += dSize;
4683
4683
  children[_i12 + 1] += dSize;
4684
4684
  }
package/dist/index.js CHANGED
@@ -4181,7 +4181,7 @@ function mapChildren(oldChildren, newLocal, mapping, node, offset, oldOffset, op
4181
4181
  if (oldEnd >= start) {
4182
4182
  children[i + 1] = oldStart <= start ? -2 : -1;
4183
4183
  }
4184
- else if (newStart >= offset && dSize) {
4184
+ else if (oldStart >= baseOffset && dSize) {
4185
4185
  children[i] += dSize;
4186
4186
  children[i + 1] += dSize;
4187
4187
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prosemirror-view",
3
- "version": "1.32.4",
3
+ "version": "1.32.5",
4
4
  "description": "ProseMirror's view component",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
package/src/decoration.ts CHANGED
@@ -568,7 +568,7 @@ function mapChildren(
568
568
  let start = (children[i] as number) + baseOffset - moved
569
569
  if (oldEnd >= start) {
570
570
  children[i + 1] = oldStart <= start ? -2 : -1
571
- } else if (newStart >= offset && dSize) {
571
+ } else if (oldStart >= baseOffset && dSize) {
572
572
  ;(children[i] as number) += dSize
573
573
  ;(children[i + 1] as number) += dSize
574
574
  }