@lvce-editor/editor-worker 19.61.1 → 19.61.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.
@@ -4913,11 +4913,11 @@ const getVisibleDiagnostics = async (editor, diagnostics) => {
4913
4913
  endColumnIndex,
4914
4914
  rowIndex
4915
4915
  } = diagnostic;
4916
- const columnDelta = Math.max(1, endColumnIndex - columnIndex);
4917
- const diagnosticWidth = columnDelta * charWidth;
4918
4916
  const endLineDifference = 0;
4919
4917
  const halfCursorWidth = 0;
4920
4918
  const x = await getX(lines[rowIndex], columnIndex, fontWeight, fontSize, fontFamily, isMonospaceFont, letterSpacing, tabSize, halfCursorWidth, width, charWidth, endLineDifference);
4919
+ const endX = await getX(lines[rowIndex], endColumnIndex, fontWeight, fontSize, fontFamily, isMonospaceFont, letterSpacing, tabSize, halfCursorWidth, width, charWidth, endLineDifference);
4920
+ const diagnosticWidth = Math.max(charWidth, endX - x);
4921
4921
  const visualRow = viewLineIndices ? getVisualRowForDocumentRow$1(rowIndex, viewLineIndices) : rowIndex;
4922
4922
  const y = (visualRow - startVisualRow) * rowHeight;
4923
4923
  visibleDiagnostics.push({
@@ -15294,10 +15294,10 @@ const getCursorsVirtualDom = cursors => {
15294
15294
  return dom;
15295
15295
  };
15296
15296
 
15297
- const getEditorCursorsVirtualDom = cursorInfos => {
15298
- const cursorsDom = getCursorsVirtualDom([...cursorInfos]);
15297
+ const getEditorCursorsVirtualDom = (cursorInfos, focused = true) => {
15298
+ const cursorsDom = focused ? getCursorsVirtualDom([...cursorInfos]) : [];
15299
15299
  return [{
15300
- childCount: cursorInfos.length,
15300
+ childCount: focused ? cursorInfos.length : 0,
15301
15301
  className: 'LayerCursor',
15302
15302
  type: Div
15303
15303
  }, ...cursorsDom];
@@ -15553,7 +15553,7 @@ const editorLayersNode = {
15553
15553
  type: Div
15554
15554
  };
15555
15555
  const getEditorLayersVirtualDom = (selectionInfos, textInfos, differences, lineNumbers = true, highlightedLine = -1, cursorInfos = [], diagnostics = [], visibleLineIndices = [], endOfLineDecorations = [], bracketMatchInfos = [], focused = true, visibleViewLineIndices = [], problemsHighlightedRow = -1, roundedSelection = false) => {
15556
- return [editorLayersNode, ...getEditorSelectionsVirtualDom(selectionInfos, focused, roundedSelection), ...getEditorRowsVirtualDom(textInfos, differences, lineNumbers, highlightedLine, visibleLineIndices, endOfLineDecorations, visibleViewLineIndices, problemsHighlightedRow), ...getEditorCursorsVirtualDom(cursorInfos), ...getEditorDiagnosticsVirtualDom(diagnostics, bracketMatchInfos)];
15556
+ return [editorLayersNode, ...getEditorSelectionsVirtualDom(selectionInfos, focused, roundedSelection), ...getEditorRowsVirtualDom(textInfos, differences, lineNumbers, highlightedLine, visibleLineIndices, endOfLineDecorations, visibleViewLineIndices, problemsHighlightedRow), ...getEditorCursorsVirtualDom(cursorInfos, focused), ...getEditorDiagnosticsVirtualDom(diagnostics, bracketMatchInfos)];
15557
15557
  };
15558
15558
 
15559
15559
  const getEditorScrollBarDiagnosticsVirtualDom = scrollBarDiagnostics => {
@@ -16061,7 +16061,7 @@ const renderSelections = {
16061
16061
  cursorInfos = [],
16062
16062
  selectionInfos = []
16063
16063
  } = newState;
16064
- const cursorsDom = getCursorsVirtualDom(cursorInfos);
16064
+ const cursorsDom = newState.focused ? getCursorsVirtualDom(cursorInfos) : [];
16065
16065
  const selectionsDom = getSelectionsVirtualDom(selectionInfos, newState.focused, newState.roundedSelection);
16066
16066
  return [/* method */'setSelections', cursorsDom, selectionsDom];
16067
16067
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/editor-worker",
3
- "version": "19.61.1",
3
+ "version": "19.61.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git@github.com:lvce-editor/editor-worker.git"