@lvce-editor/editor-worker 19.41.2 → 19.43.0

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.
@@ -12707,11 +12707,11 @@ const getKeyBindings = () => {
12707
12707
  when: FocusEditorText
12708
12708
  }, {
12709
12709
  command: 'Editor.moveLineDown',
12710
- key: CtrlCmd | Shift | DownArrow,
12710
+ key: Alt$1 | DownArrow,
12711
12711
  when: FocusEditorText
12712
12712
  }, {
12713
12713
  command: 'Editor.moveLineUp',
12714
- key: CtrlCmd | Shift | UpArrow,
12714
+ key: Alt$1 | UpArrow,
12715
12715
  when: FocusEditorText
12716
12716
  }, {
12717
12717
  command: 'Editor.openCompletion',
@@ -14293,9 +14293,19 @@ const getEditorLayersVirtualDom = (selectionInfos, textInfos, differences, lineN
14293
14293
  const getEditorScrollBarDiagnosticsVirtualDom = scrollBarDiagnostics => {
14294
14294
  return [{
14295
14295
  childCount: scrollBarDiagnostics.length,
14296
- className: 'EditorScrollBarDiagnostics',
14296
+ className: 'ScrollBarDiagnostics',
14297
14297
  type: Div
14298
- }, ...getDiagnosticsVirtualDom([...scrollBarDiagnostics])];
14298
+ }, ...scrollBarDiagnostics.map(({
14299
+ height,
14300
+ top,
14301
+ type
14302
+ }) => ({
14303
+ childCount: 0,
14304
+ className: type === 'warning' ? 'ScrollBarDiagnostic ScrollBarDiagnosticWarning' : 'ScrollBarDiagnostic ScrollBarDiagnosticError',
14305
+ height,
14306
+ top,
14307
+ type: Div
14308
+ }))];
14299
14309
  };
14300
14310
 
14301
14311
  const verticalScrollBarNode = {
@@ -14505,6 +14515,18 @@ const getEditorVirtualDom = ({
14505
14515
  }), ...minimapDom];
14506
14516
  };
14507
14517
 
14518
+ const getScrollBarDiagnostics = (editor, diagnostics) => {
14519
+ const height = editor.height || 0;
14520
+ const lineCount = Math.max(editor.lines?.length || 0, 1);
14521
+ const markerHeight = 3;
14522
+ const scrollBarDecorations = Array.from(diagnostics, diagnostic => ({
14523
+ height: markerHeight,
14524
+ top: Math.min(Math.round(diagnostic.rowIndex / lineCount * height), Math.max(height - markerHeight, 0)),
14525
+ type: diagnostic.type
14526
+ }));
14527
+ return scrollBarDecorations;
14528
+ };
14529
+
14508
14530
  const renderedDoms = new Map();
14509
14531
  const get = uid => {
14510
14532
  return renderedDoms.get(uid);
@@ -14515,6 +14537,7 @@ const set = (uid, dom) => {
14515
14537
 
14516
14538
  const getDom = state => {
14517
14539
  const {
14540
+ diagnostics = [],
14518
14541
  initial,
14519
14542
  textInfos,
14520
14543
  visualDecorations = []
@@ -14524,7 +14547,8 @@ const getDom = state => {
14524
14547
  }
14525
14548
  return getEditorVirtualDom({
14526
14549
  ...state,
14527
- diagnostics: visualDecorations
14550
+ diagnostics: visualDecorations,
14551
+ scrollBarDiagnostics: getScrollBarDiagnostics(state, diagnostics)
14528
14552
  });
14529
14553
  };
14530
14554
  const renderIncremental = (oldState, newState) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/editor-worker",
3
- "version": "19.41.2",
3
+ "version": "19.43.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git@github.com:lvce-editor/editor-worker.git"