@veltra/desktop 1.6.2 → 1.6.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.
Files changed (30) hide show
  1. package/dist/components/collapse/collapse-item.js +3 -3
  2. package/dist/components/collapse/collapse-item.js.map +1 -1
  3. package/dist/components/collapse/collapse.js +7 -5
  4. package/dist/components/collapse/collapse.js.map +1 -1
  5. package/dist/components/date-panel/use-date-select.js +10 -9
  6. package/dist/components/date-panel/use-date-select.js.map +1 -1
  7. package/dist/components/multi-select/multi-select.js.map +1 -1
  8. package/dist/components/rich-text-editor/toolbar.js +8 -4
  9. package/dist/components/rich-text-editor/toolbar.js.map +1 -1
  10. package/dist/node_modules/.bun/@codemirror_autocomplete@6.20.3/node_modules/@codemirror/autocomplete/dist/index.js +20 -14
  11. package/dist/node_modules/.bun/@codemirror_autocomplete@6.20.3/node_modules/@codemirror/autocomplete/dist/index.js.map +1 -1
  12. package/dist/node_modules/.bun/@codemirror_lang-html@6.4.11/node_modules/@codemirror/lang-html/dist/index.js +4 -2
  13. package/dist/node_modules/.bun/@codemirror_lang-html@6.4.11/node_modules/@codemirror/lang-html/dist/index.js.map +1 -1
  14. package/dist/node_modules/.bun/@codemirror_language@6.12.4/node_modules/@codemirror/language/dist/index.js +26 -21
  15. package/dist/node_modules/.bun/@codemirror_language@6.12.4/node_modules/@codemirror/language/dist/index.js.map +1 -1
  16. package/dist/node_modules/.bun/@codemirror_search@6.7.1/node_modules/@codemirror/search/dist/index.js +22 -18
  17. package/dist/node_modules/.bun/@codemirror_search@6.7.1/node_modules/@codemirror/search/dist/index.js.map +1 -1
  18. package/dist/node_modules/.bun/@codemirror_state@6.7.1/node_modules/@codemirror/state/dist/index.js +7 -6
  19. package/dist/node_modules/.bun/@codemirror_state@6.7.1/node_modules/@codemirror/state/dist/index.js.map +1 -1
  20. package/dist/node_modules/.bun/@codemirror_view@6.43.8/node_modules/@codemirror/view/dist/index.js +142 -117
  21. package/dist/node_modules/.bun/@codemirror_view@6.43.8/node_modules/@codemirror/view/dist/index.js.map +1 -1
  22. package/dist/node_modules/.bun/@lezer_common@1.5.2/node_modules/@lezer/common/dist/index.js +16 -11
  23. package/dist/node_modules/.bun/@lezer_common@1.5.2/node_modules/@lezer/common/dist/index.js.map +1 -1
  24. package/dist/node_modules/.bun/@lezer_lr@1.4.10/node_modules/@lezer/lr/dist/index.js +25 -15
  25. package/dist/node_modules/.bun/@lezer_lr@1.4.10/node_modules/@lezer/lr/dist/index.js.map +1 -1
  26. package/dist/types/collapse.d.ts +1 -1
  27. package/package.json +5 -5
  28. package/src/components/collapse/__test__/collapse.test.ts +30 -0
  29. package/src/components/collapse/collapse-item.vue +7 -7
  30. package/src/types/collapse.ts +1 -1
@@ -517,27 +517,29 @@ function scrollRectIntoView(dom, rect, side, x, y, xMargin, yMargin, ltr) {
517
517
  if (side < 0 && rect.left < bounding.left + moveX) moveX = rect.left - (bounding.left + xMargin);
518
518
  }
519
519
  } else moveX = (x == "center" ? rect.left + (rect.right - rect.left) / 2 - (bounding.right - bounding.left) / 2 : x == "start" == ltr ? rect.left - xMargin : rect.right - (bounding.right - bounding.left) + xMargin) - bounding.left;
520
- if (moveX || moveY) if (top) win.scrollBy(moveX, moveY);
521
- else {
522
- let movedX = 0, movedY = 0;
523
- if (moveY) {
524
- let start = cur.scrollTop;
525
- cur.scrollTop += moveY / scaleY;
526
- movedY = (cur.scrollTop - start) * scaleY;
527
- }
528
- if (moveX) {
529
- let start = cur.scrollLeft;
530
- cur.scrollLeft += moveX / scaleX;
531
- movedX = (cur.scrollLeft - start) * scaleX;
532
- }
533
- rect = {
534
- left: rect.left - movedX,
535
- top: rect.top - movedY,
536
- right: rect.right - movedX,
537
- bottom: rect.bottom - movedY
538
- };
539
- if (movedX && Math.abs(movedX - moveX) < 1) x = "nearest";
540
- if (movedY && Math.abs(movedY - moveY) < 1) y = "nearest";
520
+ if (moveX || moveY) {
521
+ if (top) win.scrollBy(moveX, moveY);
522
+ else {
523
+ let movedX = 0, movedY = 0;
524
+ if (moveY) {
525
+ let start = cur.scrollTop;
526
+ cur.scrollTop += moveY / scaleY;
527
+ movedY = (cur.scrollTop - start) * scaleY;
528
+ }
529
+ if (moveX) {
530
+ let start = cur.scrollLeft;
531
+ cur.scrollLeft += moveX / scaleX;
532
+ movedX = (cur.scrollLeft - start) * scaleX;
533
+ }
534
+ rect = {
535
+ left: rect.left - movedX,
536
+ top: rect.top - movedY,
537
+ right: rect.right - movedX,
538
+ bottom: rect.bottom - movedY
539
+ };
540
+ if (movedX && Math.abs(movedX - moveX) < 1) x = "nearest";
541
+ if (movedY && Math.abs(movedY - moveY) < 1) y = "nearest";
542
+ }
541
543
  }
542
544
  if (top) break;
543
545
  if (rect.top < bounding.top || rect.bottom > bounding.bottom || rect.left < bounding.left || rect.right > bounding.right) rect = {
@@ -817,9 +819,10 @@ function computeCharTypes(line, rFrom, rTo, isolates, outerType) {
817
819
  }
818
820
  for (let i = from, prev = prevType, prevStrong = prevType; i < to; i++) {
819
821
  let type = types[i];
820
- if (type == 128) if (i < to - 1 && prev == types[i + 1] && prev & 24) type = types[i] = prev;
821
- else types[i] = 256;
822
- else if (type == 64) {
822
+ if (type == 128) {
823
+ if (i < to - 1 && prev == types[i + 1] && prev & 24) type = types[i] = prev;
824
+ else types[i] = 256;
825
+ } else if (type == 64) {
823
826
  let end = i + 1;
824
827
  while (end < to && types[end] == 64) end++;
825
828
  let replace = i && prev == 8 || end < rTo && types[end] == 8 ? prevStrong == 1 ? 1 : 8 : 256;
@@ -835,21 +838,22 @@ function processBracketPairs(line, rFrom, rTo, isolates, outerType) {
835
838
  let oppositeType = outerType == 1 ? 2 : 1;
836
839
  for (let iI = 0, sI = 0, context = 0; iI <= isolates.length; iI++) {
837
840
  let from = iI ? isolates[iI - 1].to : rFrom, to = iI < isolates.length ? isolates[iI].from : rTo;
838
- for (let i = from, ch, br, type; i < to; i++) if (br = Brackets[ch = line.charCodeAt(i)]) if (br < 0) {
839
- for (let sJ = sI - 3; sJ >= 0; sJ -= 3) if (BracketStack[sJ + 1] == -br) {
840
- let flags = BracketStack[sJ + 2];
841
- let type = flags & 2 ? outerType : !(flags & 4) ? 0 : flags & 1 ? oppositeType : outerType;
842
- if (type) types[i] = types[BracketStack[sJ]] = type;
843
- sI = sJ;
844
- break;
841
+ for (let i = from, ch, br, type; i < to; i++) if (br = Brackets[ch = line.charCodeAt(i)]) {
842
+ if (br < 0) {
843
+ for (let sJ = sI - 3; sJ >= 0; sJ -= 3) if (BracketStack[sJ + 1] == -br) {
844
+ let flags = BracketStack[sJ + 2];
845
+ let type = flags & 2 ? outerType : !(flags & 4) ? 0 : flags & 1 ? oppositeType : outerType;
846
+ if (type) types[i] = types[BracketStack[sJ]] = type;
847
+ sI = sJ;
848
+ break;
849
+ }
850
+ } else if (BracketStack.length == 189) break;
851
+ else {
852
+ BracketStack[sI++] = i;
853
+ BracketStack[sI++] = ch;
854
+ BracketStack[sI++] = context;
845
855
  }
846
- } else if (BracketStack.length == 189) break;
847
- else {
848
- BracketStack[sI++] = i;
849
- BracketStack[sI++] = ch;
850
- BracketStack[sI++] = context;
851
- }
852
- else if ((type = types[i]) == 2 || type == 1) {
856
+ } else if ((type = types[i]) == 2 || type == 1) {
853
857
  let embed = type == outerType;
854
858
  context = embed ? 0 : 1;
855
859
  for (let sJ = sI - 3; sJ >= 0; sJ -= 3) {
@@ -2190,19 +2194,20 @@ var TileUpdate = class {
2190
2194
  let activeMarks = getMarks(this.old), openMarks = this.openMarks;
2191
2195
  this.old.advance(length, incEnd ? 1 : -1, {
2192
2196
  skip: (tile, from, to) => {
2193
- if (tile.isWidget()) if (this.openWidget) this.builder.continueWidget(to - from);
2194
- else {
2195
- let widget = to > 0 || from < tile.length ? WidgetTile.of(tile.widget, this.view, to - from, tile.flags & 496, this.cache.maybeReuse(tile)) : this.cache.reuse(tile);
2196
- if (widget.flags & 256) {
2197
- widget.flags &= -2;
2198
- this.builder.addBlockWidget(widget);
2199
- } else {
2200
- this.builder.ensureLine(null);
2201
- this.builder.addInlineWidget(widget, activeMarks, openMarks);
2202
- openMarks = activeMarks.length;
2197
+ if (tile.isWidget()) {
2198
+ if (this.openWidget) this.builder.continueWidget(to - from);
2199
+ else {
2200
+ let widget = to > 0 || from < tile.length ? WidgetTile.of(tile.widget, this.view, to - from, tile.flags & 496, this.cache.maybeReuse(tile)) : this.cache.reuse(tile);
2201
+ if (widget.flags & 256) {
2202
+ widget.flags &= -2;
2203
+ this.builder.addBlockWidget(widget);
2204
+ } else {
2205
+ this.builder.ensureLine(null);
2206
+ this.builder.addInlineWidget(widget, activeMarks, openMarks);
2207
+ openMarks = activeMarks.length;
2208
+ }
2203
2209
  }
2204
- }
2205
- else if (tile.isText()) {
2210
+ } else if (tile.isText()) {
2206
2211
  this.builder.ensureLine(null);
2207
2212
  if (!from && to == tile.length && !this.cache.reused.has(tile)) this.builder.addText(tile.text, activeMarks, openMarks, this.cache.reuse(tile));
2208
2213
  else {
@@ -2412,10 +2417,12 @@ var DocView = class {
2412
2417
  update(update) {
2413
2418
  var _a;
2414
2419
  let changedRanges = update.changedRanges;
2415
- if (this.minWidth > 0 && changedRanges.length) if (!changedRanges.every(({ fromA, toA }) => toA < this.minWidthFrom || fromA > this.minWidthTo)) this.minWidth = this.minWidthFrom = this.minWidthTo = 0;
2416
- else {
2417
- this.minWidthFrom = update.changes.mapPos(this.minWidthFrom, 1);
2418
- this.minWidthTo = update.changes.mapPos(this.minWidthTo, 1);
2420
+ if (this.minWidth > 0 && changedRanges.length) {
2421
+ if (!changedRanges.every(({ fromA, toA }) => toA < this.minWidthFrom || fromA > this.minWidthTo)) this.minWidth = this.minWidthFrom = this.minWidthTo = 0;
2422
+ else {
2423
+ this.minWidthFrom = update.changes.mapPos(this.minWidthFrom, 1);
2424
+ this.minWidthTo = update.changes.mapPos(this.minWidthTo, 1);
2425
+ }
2419
2426
  }
2420
2427
  this.updateEditContextFormatting(update);
2421
2428
  let readCompositionAt = -1;
@@ -2575,8 +2582,10 @@ var DocView = class {
2575
2582
  for (;;) {
2576
2583
  let parent = node.parentNode;
2577
2584
  if (parent == tile.dom) break;
2578
- if (bias == 0 && parent.firstChild != parent.lastChild) if (node == parent.firstChild) bias = -1;
2579
- else bias = 1;
2585
+ if (bias == 0 && parent.firstChild != parent.lastChild) {
2586
+ if (node == parent.firstChild) bias = -1;
2587
+ else bias = 1;
2588
+ }
2580
2589
  node = parent;
2581
2590
  }
2582
2591
  if (bias < 0) after = node;
@@ -3096,8 +3105,10 @@ function skipAtomsForSelection(atoms, sel) {
3096
3105
  } else {
3097
3106
  let from = skipAtomicRanges(atoms, range.from, -1);
3098
3107
  let to = skipAtomicRanges(atoms, range.to, 1);
3099
- if (from != range.from || to != range.to) if (range.undirectional) updated = EditorSelection.undirectionalRange(range.from, range.to);
3100
- else updated = EditorSelection.range(range.from == range.anchor ? from : to, range.from == range.head ? from : to);
3108
+ if (from != range.from || to != range.to) {
3109
+ if (range.undirectional) updated = EditorSelection.undirectionalRange(range.from, range.to);
3110
+ else updated = EditorSelection.range(range.from == range.anchor ? from : to, range.from == range.head ? from : to);
3111
+ }
3101
3112
  }
3102
3113
  if (updated) {
3103
3114
  if (!ranges) ranges = sel.ranges.slice();
@@ -4564,20 +4575,21 @@ var HeightMap = class HeightMap {
4564
4575
  static of(nodes) {
4565
4576
  if (nodes.length == 1) return nodes[0];
4566
4577
  let i = 0, j = nodes.length, before = 0, after = 0;
4567
- for (;;) if (i == j) if (before > after * 2) {
4568
- let split = nodes[i - 1];
4569
- if (split.break) nodes.splice(--i, 1, split.left, null, split.right);
4570
- else nodes.splice(--i, 1, split.left, split.right);
4571
- j += 1 + split.break;
4572
- before -= split.size;
4573
- } else if (after > before * 2) {
4574
- let split = nodes[j];
4575
- if (split.break) nodes.splice(j, 1, split.left, null, split.right);
4576
- else nodes.splice(j, 1, split.left, split.right);
4577
- j += 2 + split.break;
4578
- after -= split.size;
4579
- } else break;
4580
- else if (before < after) {
4578
+ for (;;) if (i == j) {
4579
+ if (before > after * 2) {
4580
+ let split = nodes[i - 1];
4581
+ if (split.break) nodes.splice(--i, 1, split.left, null, split.right);
4582
+ else nodes.splice(--i, 1, split.left, split.right);
4583
+ j += 1 + split.break;
4584
+ before -= split.size;
4585
+ } else if (after > before * 2) {
4586
+ let split = nodes[j];
4587
+ if (split.break) nodes.splice(j, 1, split.left, null, split.right);
4588
+ else nodes.splice(j, 1, split.left, split.right);
4589
+ j += 2 + split.break;
4590
+ after -= split.size;
4591
+ } else break;
4592
+ } else if (before < after) {
4581
4593
  let next = nodes[i++];
4582
4594
  if (next) before += next.size;
4583
4595
  } else {
@@ -5287,7 +5299,7 @@ var ViewState = class {
5287
5299
  if (scrollTarget.y == "center") topPos = (block.top + block.bottom) / 2 - viewHeight / 2;
5288
5300
  else if (scrollTarget.y == "start" || scrollTarget.y == "nearest" && head < viewport.from) topPos = block.top;
5289
5301
  else topPos = block.bottom - viewHeight;
5290
- viewport = new Viewport(map.lineAt(topPos - 1e3 / 2, QueryType.ByHeight, oracle, 0, 0).from, map.lineAt(topPos + viewHeight + 1e3 / 2, QueryType.ByHeight, oracle, 0, 0).to);
5302
+ viewport = new Viewport(map.lineAt(topPos - 500, QueryType.ByHeight, oracle, 0, 0).from, map.lineAt(topPos + viewHeight + 500, QueryType.ByHeight, oracle, 0, 0).to);
5291
5303
  }
5292
5304
  }
5293
5305
  return viewport;
@@ -6118,18 +6130,20 @@ var DOMObserver = class {
6118
6130
  }
6119
6131
  addWindowListeners(win) {
6120
6132
  win.addEventListener("resize", this.onResize);
6121
- if (this.printQuery) if (this.printQuery.addEventListener) this.printQuery.addEventListener("change", this.onPrint);
6122
- else this.printQuery.addListener(this.onPrint);
6123
- else win.addEventListener("beforeprint", this.onPrint);
6133
+ if (this.printQuery) {
6134
+ if (this.printQuery.addEventListener) this.printQuery.addEventListener("change", this.onPrint);
6135
+ else this.printQuery.addListener(this.onPrint);
6136
+ } else win.addEventListener("beforeprint", this.onPrint);
6124
6137
  win.addEventListener("scroll", this.onScroll);
6125
6138
  win.document.addEventListener("selectionchange", this.onSelectionChange);
6126
6139
  }
6127
6140
  removeWindowListeners(win) {
6128
6141
  win.removeEventListener("scroll", this.onScroll);
6129
6142
  win.removeEventListener("resize", this.onResize);
6130
- if (this.printQuery) if (this.printQuery.removeEventListener) this.printQuery.removeEventListener("change", this.onPrint);
6131
- else this.printQuery.removeListener(this.onPrint);
6132
- else win.removeEventListener("beforeprint", this.onPrint);
6143
+ if (this.printQuery) {
6144
+ if (this.printQuery.removeEventListener) this.printQuery.removeEventListener("change", this.onPrint);
6145
+ else this.printQuery.removeListener(this.onPrint);
6146
+ } else win.removeEventListener("beforeprint", this.onPrint);
6133
6147
  win.document.removeEventListener("selectionchange", this.onSelectionChange);
6134
6148
  }
6135
6149
  update(update) {
@@ -6301,14 +6315,16 @@ var EditContextManager = class {
6301
6315
  update.changes.iterChanges((fromA, toA, _fromB, _toB, insert) => {
6302
6316
  if (abort) return;
6303
6317
  let dLen = insert.length - (toA - fromA);
6304
- if (pending && toA >= pending.to) if (pending.from == fromA && pending.to == toA && pending.insert.eq(insert)) {
6305
- pending = this.pendingContextChange = null;
6306
- off += dLen;
6307
- this.to += dLen;
6308
- return;
6309
- } else {
6310
- pending = null;
6311
- this.revertPending(update.state);
6318
+ if (pending && toA >= pending.to) {
6319
+ if (pending.from == fromA && pending.to == toA && pending.insert.eq(insert)) {
6320
+ pending = this.pendingContextChange = null;
6321
+ off += dLen;
6322
+ this.to += dLen;
6323
+ return;
6324
+ } else {
6325
+ pending = null;
6326
+ this.revertPending(update.state);
6327
+ }
6312
6328
  }
6313
6329
  fromA += off;
6314
6330
  toA += off;
@@ -6671,13 +6687,15 @@ var EditorView = class EditorView {
6671
6687
  this.viewState.scrollAnchorHeight = -1;
6672
6688
  try {
6673
6689
  for (let i = 0;; i++) {
6674
- if (scrollAnchorHeight < 0) if (isScrolledToBottom(scroll || this.win)) {
6675
- scrollAnchorPos = -1;
6676
- scrollAnchorHeight = this.viewState.heightMap.height;
6677
- } else {
6678
- let block = this.viewState.scrollAnchorAt(scrollOffset);
6679
- scrollAnchorPos = block.from;
6680
- scrollAnchorHeight = block.top;
6690
+ if (scrollAnchorHeight < 0) {
6691
+ if (isScrolledToBottom(scroll || this.win)) {
6692
+ scrollAnchorPos = -1;
6693
+ scrollAnchorHeight = this.viewState.heightMap.height;
6694
+ } else {
6695
+ let block = this.viewState.scrollAnchorAt(scrollOffset);
6696
+ scrollAnchorPos = block.from;
6697
+ scrollAnchorHeight = block.top;
6698
+ }
6681
6699
  }
6682
6700
  this.updateState = 1;
6683
6701
  let changed = this.viewState.measure();
@@ -6716,19 +6734,21 @@ var EditorView = class EditorView {
6716
6734
  }
6717
6735
  if (redrawn) this.docView.updateSelection(true);
6718
6736
  if (!update.viewportChanged && this.measureRequests.length == 0) {
6719
- if (this.viewState.editorHeight) if (this.viewState.scrollTarget) {
6720
- this.docView.scrollIntoView(this.viewState.scrollTarget);
6721
- this.viewState.scrollTarget = null;
6722
- scrollAnchorHeight = -1;
6723
- continue;
6724
- } else {
6725
- let diff = ((scrollAnchorPos < 0 ? this.viewState.heightMap.height : this.viewState.lineBlockAt(scrollAnchorPos).top) - scrollAnchorHeight) / this.scaleY;
6726
- if ((diff > 1 || diff < -1) && !(browser.ios && this.inputState.lastIOSMomentumScroll > Date.now() - 100) && (scroll == this.scrollDOM || this.hasFocus || Math.max(this.inputState.lastWheelEvent, this.inputState.lastTouchTime) > Date.now() - 100)) {
6727
- scrollOffset = scrollOffset + diff;
6728
- if (scroll) scroll.scrollTop += diff;
6729
- else this.win.scrollBy(0, diff);
6737
+ if (this.viewState.editorHeight) {
6738
+ if (this.viewState.scrollTarget) {
6739
+ this.docView.scrollIntoView(this.viewState.scrollTarget);
6740
+ this.viewState.scrollTarget = null;
6730
6741
  scrollAnchorHeight = -1;
6731
6742
  continue;
6743
+ } else {
6744
+ let diff = ((scrollAnchorPos < 0 ? this.viewState.heightMap.height : this.viewState.lineBlockAt(scrollAnchorPos).top) - scrollAnchorHeight) / this.scaleY;
6745
+ if ((diff > 1 || diff < -1) && !(browser.ios && this.inputState.lastIOSMomentumScroll > Date.now() - 100) && (scroll == this.scrollDOM || this.hasFocus || Math.max(this.inputState.lastWheelEvent, this.inputState.lastTouchTime) > Date.now() - 100)) {
6746
+ scrollOffset = scrollOffset + diff;
6747
+ if (scroll) scroll.scrollTop += diff;
6748
+ else this.win.scrollBy(0, diff);
6749
+ scrollAnchorHeight = -1;
6750
+ continue;
6751
+ }
6732
6752
  }
6733
6753
  }
6734
6754
  break;
@@ -7484,9 +7504,10 @@ function normalizeKeyName(name, platform) {
7484
7504
  else if (/^a(lt)?$/i.test(mod)) alt = true;
7485
7505
  else if (/^(c|ctrl|control)$/i.test(mod)) ctrl = true;
7486
7506
  else if (/^s(hift)?$/i.test(mod)) shift = true;
7487
- else if (/^mod$/i.test(mod)) if (platform == "mac") meta = true;
7488
- else ctrl = true;
7489
- else throw new Error("Unrecognized modifier name: " + mod);
7507
+ else if (/^mod$/i.test(mod)) {
7508
+ if (platform == "mac") meta = true;
7509
+ else ctrl = true;
7510
+ } else throw new Error("Unrecognized modifier name: " + mod);
7490
7511
  }
7491
7512
  if (alt) result = "Alt-" + result;
7492
7513
  if (ctrl) result = "Ctrl-" + result;
@@ -8619,13 +8640,15 @@ const tooltipPlugin = /*@__PURE__*/ ViewPlugin.fromClass(class {
8619
8640
  makeAbsolute = Math.abs(rect.top + 1e4) > 1 || Math.abs(rect.left) > 1;
8620
8641
  } else makeAbsolute = !!dom.offsetParent && dom.offsetParent != this.container.ownerDocument.body;
8621
8642
  }
8622
- if (makeAbsolute || this.position == "absolute") if (this.parent) {
8623
- let rect = this.parent.getBoundingClientRect();
8624
- if (rect.width && rect.height) {
8625
- scaleX = rect.width / this.parent.offsetWidth;
8626
- scaleY = rect.height / this.parent.offsetHeight;
8627
- }
8628
- } else ({scaleX, scaleY} = this.view.viewState);
8643
+ if (makeAbsolute || this.position == "absolute") {
8644
+ if (this.parent) {
8645
+ let rect = this.parent.getBoundingClientRect();
8646
+ if (rect.width && rect.height) {
8647
+ scaleX = rect.width / this.parent.offsetWidth;
8648
+ scaleY = rect.height / this.parent.offsetHeight;
8649
+ }
8650
+ } else ({scaleX, scaleY} = this.view.viewState);
8651
+ }
8629
8652
  let visible = this.view.scrollDOM.getBoundingClientRect(), margins = getScrollMargins(this.view);
8630
8653
  return {
8631
8654
  visible: {
@@ -9672,8 +9695,10 @@ var GutterElement = class {
9672
9695
  }
9673
9696
  }
9674
9697
  if (!marker) break;
9675
- if (marker.toDOM) if (matched) domPos = domPos.nextSibling;
9676
- else this.dom.insertBefore(marker.toDOM(view), domPos);
9698
+ if (marker.toDOM) {
9699
+ if (matched) domPos = domPos.nextSibling;
9700
+ else this.dom.insertBefore(marker.toDOM(view), domPos);
9701
+ }
9677
9702
  if (matched) iOld++;
9678
9703
  }
9679
9704
  this.dom.className = cls;