@lvce-editor/editor-worker 19.22.1 → 19.24.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.
@@ -1445,7 +1445,7 @@ const create$9 = rpcId => {
1445
1445
  };
1446
1446
 
1447
1447
  const Audio = 0;
1448
- const Button$1 = 1;
1448
+ const Button$2 = 1;
1449
1449
  const Col = 2;
1450
1450
  const ColGroup = 3;
1451
1451
  const Div$1 = 4;
@@ -1498,7 +1498,7 @@ const Video = 61;
1498
1498
  const TextArea$1 = 62;
1499
1499
  const Select = 63;
1500
1500
  const Option = 64;
1501
- const Code = 65;
1501
+ const Code$1 = 65;
1502
1502
  const Label = 66;
1503
1503
  const Dt = 67;
1504
1504
  const Iframe = 68;
@@ -1536,11 +1536,11 @@ const VirtualDomElements = {
1536
1536
  Audio,
1537
1537
  BlockQuote,
1538
1538
  Br,
1539
- Button: Button$1,
1539
+ Button: Button$2,
1540
1540
  Canvas,
1541
1541
  Circle,
1542
1542
  Cite,
1543
- Code,
1543
+ Code: Code$1,
1544
1544
  Col,
1545
1545
  ColGroup,
1546
1546
  Data,
@@ -1614,7 +1614,7 @@ const VirtualDomElements = {
1614
1614
  };
1615
1615
 
1616
1616
  const AltKey = 'event.altKey';
1617
- const Button = 'event.button';
1617
+ const Button$1 = 'event.button';
1618
1618
  const ClientX = 'event.clientX';
1619
1619
  const ClientY = 'event.clientY';
1620
1620
  const DeltaMode = 'event.deltaMode';
@@ -10790,6 +10790,10 @@ const getLineInfosVirtualDom = lineInfos => {
10790
10790
  return dom;
10791
10791
  };
10792
10792
 
10793
+ const mergeClassNames = (...classNames) => {
10794
+ return classNames.filter(Boolean).join(' ');
10795
+ };
10796
+
10793
10797
  const hoverProblemMessage = {
10794
10798
  childCount: 1,
10795
10799
  className: HoverProblemMessage,
@@ -10800,6 +10804,11 @@ const hoverProblemDetail = {
10800
10804
  className: HoverProblemDetail,
10801
10805
  type: Span
10802
10806
  };
10807
+ const hoverDocumentationNode = {
10808
+ childCount: 1,
10809
+ className: HoverDocumentation,
10810
+ type: Div
10811
+ };
10803
10812
  const getChildCount = (lineInfos, documentation, diagnostics) => {
10804
10813
  const documentationCount = documentation ? 1 : 0;
10805
10814
  const diagnosticsCount = diagnostics && diagnostics.length > 0 ? 1 : 0;
@@ -10809,13 +10818,13 @@ const getHoverVirtualDom = (lineInfos, documentation, diagnostics) => {
10809
10818
  const dom = [];
10810
10819
  dom.push({
10811
10820
  childCount: getChildCount(lineInfos, documentation, diagnostics) + 1,
10812
- className: 'Viewlet EditorHover',
10821
+ className: mergeClassNames('Viewlet', 'EditorHover'),
10813
10822
  type: Div
10814
10823
  });
10815
10824
  if (diagnostics && diagnostics.length > 0) {
10816
10825
  dom.push({
10817
10826
  childCount: diagnostics.length * 2,
10818
- className: `${HoverDisplayString} ${HoverProblem}`,
10827
+ className: mergeClassNames(HoverDisplayString, HoverProblem),
10819
10828
  type: Div
10820
10829
  });
10821
10830
  for (const diagnostic of diagnostics) {
@@ -10831,15 +10840,11 @@ const getHoverVirtualDom = (lineInfos, documentation, diagnostics) => {
10831
10840
  }, ...lineInfosDom);
10832
10841
  }
10833
10842
  if (documentation) {
10834
- dom.push({
10835
- childCount: 1,
10836
- className: HoverDocumentation,
10837
- type: Div
10838
- }, text(documentation));
10843
+ dom.push(hoverDocumentationNode, text(documentation));
10839
10844
  }
10840
10845
  dom.push({
10841
10846
  childCount: 0,
10842
- className: 'Sash SashVertical SashResize',
10847
+ className: mergeClassNames('Sash', 'SashVertical', 'SashResize'),
10843
10848
  onPointerDown: HandleSashPointerDown,
10844
10849
  type: Div
10845
10850
  });
@@ -11033,8 +11038,9 @@ const getEditorSourceActions = async editorId => {
11033
11038
  const {
11034
11039
  newState
11035
11040
  } = get$7(editorId);
11041
+ const offset = getOffsetAtCursor$1(newState);
11036
11042
  return execute({
11037
- args: [],
11043
+ args: [offset],
11038
11044
  editor: newState,
11039
11045
  event: 'onLanguage',
11040
11046
  method: 'ExtensionHostCodeActions.getSourceActions'
@@ -12633,33 +12639,41 @@ const diffTree = (oldNodes, newNodes) => {
12633
12639
  return removeTrailingNavigationPatches(patches);
12634
12640
  };
12635
12641
 
12642
+ const Button = 'button';
12643
+ const Code = 'code';
12644
+ const TextBox = 'textbox';
12645
+
12646
+ const True = 'true';
12647
+
12648
+ const editorInputNode = {
12649
+ childCount: 1,
12650
+ className: 'EditorInput',
12651
+ type: Div
12652
+ };
12653
+ const editorTextAreaNode = {
12654
+ ariaAutoComplete: 'list',
12655
+ ariaMultiLine: True,
12656
+ ariaRoleDescription: 'editor',
12657
+ autocapitalize: 'off',
12658
+ autocomplete: 'off',
12659
+ autocorrect: 'off',
12660
+ childCount: 0,
12661
+ name: 'editor',
12662
+ onBeforeInput: HandleBeforeInput,
12663
+ onBlur: HandleBlur,
12664
+ onCompositionEnd: HandleCompositionEnd,
12665
+ onCompositionStart: HandleCompositionStart,
12666
+ onCompositionUpdate: HandleCompositionUpdate,
12667
+ onCut: HandleCut,
12668
+ onFocus: HandleFocus,
12669
+ onPaste: HandlePaste,
12670
+ role: TextBox,
12671
+ spellcheck: false,
12672
+ type: TextArea,
12673
+ wrap: 'off'
12674
+ };
12636
12675
  const getEditorInputVirtualDom = () => {
12637
- return [{
12638
- childCount: 1,
12639
- className: 'EditorInput',
12640
- type: Div
12641
- }, {
12642
- ariaAutoComplete: 'list',
12643
- ariaMultiLine: 'true',
12644
- ariaRoleDescription: 'editor',
12645
- autocapitalize: 'off',
12646
- autocomplete: 'off',
12647
- autocorrect: 'off',
12648
- childCount: 0,
12649
- name: 'editor',
12650
- onBeforeInput: HandleBeforeInput,
12651
- onBlur: HandleBlur,
12652
- onCompositionEnd: HandleCompositionEnd,
12653
- onCompositionStart: HandleCompositionStart,
12654
- onCompositionUpdate: HandleCompositionUpdate,
12655
- onCut: HandleCut,
12656
- onFocus: HandleFocus,
12657
- onPaste: HandlePaste,
12658
- role: 'textbox',
12659
- spellcheck: false,
12660
- type: TextArea,
12661
- wrap: 'off'
12662
- }];
12676
+ return [editorInputNode, editorTextAreaNode];
12663
12677
  };
12664
12678
 
12665
12679
  const getCursorsVirtualDom = cursors => {
@@ -12696,10 +12710,6 @@ const getDiagnosticClassName = type => {
12696
12710
  }
12697
12711
  };
12698
12712
 
12699
- const mergeClassNames = (...classNames) => {
12700
- return classNames.filter(Boolean).join(' ');
12701
- };
12702
-
12703
12713
  const getDiagnosticVirtualDom = diagnostic => {
12704
12714
  const {
12705
12715
  height,
@@ -12741,7 +12751,7 @@ const getEditorRowsVirtualDom$1 = (textInfos, differences, lineNumbers = true, h
12741
12751
  const difference = differences[i];
12742
12752
  let className = EditorRow;
12743
12753
  if (i === highlightedLine) {
12744
- className += ' ' + EditorRowHighlighted;
12754
+ className = mergeClassNames(className, EditorRowHighlighted);
12745
12755
  }
12746
12756
  dom.push({
12747
12757
  childCount: textInfo.length / 2,
@@ -12802,12 +12812,13 @@ const getEditorSelectionsVirtualDom = selectionInfos => {
12802
12812
  }, ...selectionsDom];
12803
12813
  };
12804
12814
 
12815
+ const editorLayersNode = {
12816
+ childCount: 4,
12817
+ className: 'EditorLayers',
12818
+ type: Div
12819
+ };
12805
12820
  const getEditorLayersVirtualDom = (selectionInfos, textInfos, differences, lineNumbers = true, highlightedLine = -1, cursorInfos = [], diagnostics = []) => {
12806
- return [{
12807
- childCount: 4,
12808
- className: 'EditorLayers',
12809
- type: Div
12810
- }, ...getEditorSelectionsVirtualDom(selectionInfos), ...getEditorRowsVirtualDom(textInfos, differences, lineNumbers, highlightedLine), ...getEditorCursorsVirtualDom(cursorInfos), ...getEditorDiagnosticsVirtualDom(diagnostics)];
12821
+ return [editorLayersNode, ...getEditorSelectionsVirtualDom(selectionInfos), ...getEditorRowsVirtualDom(textInfos, differences, lineNumbers, highlightedLine), ...getEditorCursorsVirtualDom(cursorInfos), ...getEditorDiagnosticsVirtualDom(diagnostics)];
12811
12822
  };
12812
12823
 
12813
12824
  const getEditorScrollBarDiagnosticsVirtualDom = scrollBarDiagnostics => {
@@ -12821,26 +12832,34 @@ const getEditorScrollBarDiagnosticsVirtualDom = scrollBarDiagnostics => {
12821
12832
  const getScrollBarVirtualDom = () => {
12822
12833
  return [{
12823
12834
  childCount: 1,
12824
- className: 'ScrollBar ScrollBarVertical',
12835
+ className: mergeClassNames('ScrollBar', 'ScrollBarVertical'),
12825
12836
  onContextMenu: HandleContextMenu,
12826
12837
  onPointerDown: HandleScrollBarVerticalPointerDown,
12827
12838
  type: Div
12828
12839
  }, {
12829
12840
  childCount: 0,
12830
- className: 'ScrollBarThumb ScrollBarThumbVertical',
12841
+ className: mergeClassNames('ScrollBarThumb', 'ScrollBarThumbVertical'),
12831
12842
  type: Div
12832
12843
  }, {
12833
12844
  childCount: 1,
12834
- className: 'ScrollBar ScrollBarHorizontal',
12845
+ className: mergeClassNames('ScrollBar', 'ScrollBarHorizontal'),
12835
12846
  onPointerDown: HandleScrollBarHorizontalPointerDown,
12836
12847
  type: Div
12837
12848
  }, {
12838
12849
  childCount: 0,
12839
- className: 'ScrollBarThumb ScrollBarThumbHorizontal',
12850
+ className: mergeClassNames('ScrollBarThumb', 'ScrollBarThumbHorizontal'),
12840
12851
  type: Div
12841
12852
  }];
12842
12853
  };
12843
12854
 
12855
+ const editorContentNode = {
12856
+ childCount: 5,
12857
+ className: 'EditorContent',
12858
+ onKeyUp: HandleKeyUp,
12859
+ onMouseMove: HandleMouseMove,
12860
+ onWheel: HandleWheel,
12861
+ type: Div
12862
+ };
12844
12863
  const getEditorContentVirtualDom = ({
12845
12864
  cursorInfos = [],
12846
12865
  diagnostics = [],
@@ -12851,14 +12870,7 @@ const getEditorContentVirtualDom = ({
12851
12870
  selectionInfos = [],
12852
12871
  textInfos
12853
12872
  }) => {
12854
- return [{
12855
- childCount: 5,
12856
- className: 'EditorContent',
12857
- onKeyUp: HandleKeyUp,
12858
- onMouseMove: HandleMouseMove,
12859
- onWheel: HandleWheel,
12860
- type: Div
12861
- }, ...getEditorInputVirtualDom(), ...getEditorLayersVirtualDom(selectionInfos, textInfos, differences, lineNumbers, highlightedLine, cursorInfos, diagnostics), ...getEditorScrollBarDiagnosticsVirtualDom(scrollBarDiagnostics), ...getScrollBarVirtualDom()];
12873
+ return [editorContentNode, ...getEditorInputVirtualDom(), ...getEditorLayersVirtualDom(selectionInfos, textInfos, differences, lineNumbers, highlightedLine, cursorInfos, diagnostics), ...getEditorScrollBarDiagnosticsVirtualDom(scrollBarDiagnostics), ...getScrollBarVirtualDom()];
12862
12874
  };
12863
12875
 
12864
12876
  const getGutterInfoVirtualDom = gutterInfo => {
@@ -12905,6 +12917,11 @@ const getGutterInfos = (minLineY, maxLineY, breakPoints, showLineNumbers = true,
12905
12917
  return gutterInfos;
12906
12918
  };
12907
12919
 
12920
+ const textEditorErrorMessageNode = {
12921
+ childCount: 1,
12922
+ className: 'TextEditorErrorMessage',
12923
+ type: Div
12924
+ };
12908
12925
  const getEditorVirtualDom = ({
12909
12926
  breakPoints = [],
12910
12927
  cursorInfos = [],
@@ -12925,29 +12942,25 @@ const getEditorVirtualDom = ({
12925
12942
  if (loadError) {
12926
12943
  return [{
12927
12944
  childCount: 2,
12928
- className: 'Viewlet TextEditorError',
12945
+ className: mergeClassNames('Viewlet', 'TextEditorError'),
12929
12946
  'data-uid': uid,
12930
- role: 'code',
12947
+ role: Code,
12931
12948
  type: Div
12932
12949
  }, {
12933
12950
  childCount: 0,
12934
- className: 'EditorTextIcon EditorTextIconError MaskIcon MaskIconError',
12951
+ className: mergeClassNames('EditorTextIcon', 'EditorTextIconError', 'MaskIcon', 'MaskIconError'),
12935
12952
  type: Div
12936
- }, {
12937
- childCount: 1,
12938
- className: 'TextEditorErrorMessage',
12939
- type: Div
12940
- }, text(loadError)];
12953
+ }, textEditorErrorMessageNode, text(loadError)];
12941
12954
  }
12942
12955
  const visibleGutterInfos = breakPoints.length > 0 || visibleLineIndices ? getGutterInfos(minLineY, maxLineY, breakPoints, lineNumbers, visibleLineIndices) : gutterInfos;
12943
12956
  const showGutter = lineNumbers || breakPoints.length > 0;
12944
12957
  const gutterDom = showGutter ? getEditorGutterVirtualDom(visibleGutterInfos) : [];
12945
12958
  return [{
12946
12959
  childCount: showGutter ? 2 : 1,
12947
- className: 'Viewlet Editor',
12960
+ className: mergeClassNames('Viewlet', 'Editor'),
12948
12961
  'data-uid': uid,
12949
12962
  onContextMenu: HandleContextMenu,
12950
- role: 'code',
12963
+ role: Code,
12951
12964
  type: Div
12952
12965
  }, ...gutterDom, ...getEditorContentVirtualDom({
12953
12966
  cursorInfos,
@@ -13200,7 +13213,7 @@ const renderEventListeners = () => {
13200
13213
  passive: true
13201
13214
  }, {
13202
13215
  name: HandleContextMenu,
13203
- params: ['handleContextMenu', Button, ClientX, ClientY],
13216
+ params: ['handleContextMenu', Button$1, ClientX, ClientY],
13204
13217
  preventDefault: true
13205
13218
  }, {
13206
13219
  name: HandleScrollBarVerticalPointerDown,
@@ -13685,6 +13698,11 @@ const listen = async () => {
13685
13698
 
13686
13699
  const CodeGeneratorInput = 'CodeGeneratorInput';
13687
13700
 
13701
+ const codeGeneratorMessageNode = {
13702
+ childCount: 1,
13703
+ className: CodeGeneratorMessage,
13704
+ type: Div
13705
+ };
13688
13706
  const getCodeGeneratorVirtualDom = state => {
13689
13707
  const escapeToClose$1 = escapeToClose();
13690
13708
  const enterCode$1 = enterCode();
@@ -13698,11 +13716,7 @@ const getCodeGeneratorVirtualDom = state => {
13698
13716
  name: CodeGeneratorInput,
13699
13717
  placeholder: enterCode$1,
13700
13718
  type: Input
13701
- }, {
13702
- childCount: 1,
13703
- className: CodeGeneratorMessage,
13704
- type: Div
13705
- }, text(escapeToClose$1)];
13719
+ }, codeGeneratorMessageNode, text(escapeToClose$1)];
13706
13720
  };
13707
13721
 
13708
13722
  const renderContent$1 = {
@@ -13804,23 +13818,29 @@ const EditorColorPickerWidget = {
13804
13818
  render: render$4
13805
13819
  };
13806
13820
 
13821
+ const Focusable = 0;
13822
+
13823
+ const completionDetailContentNode = {
13824
+ childCount: 1,
13825
+ className: CompletionDetailContent,
13826
+ type: Div
13827
+ };
13828
+ const completionDetailCloseButtonNode = {
13829
+ childCount: 1,
13830
+ className: CompletionDetailCloseButton,
13831
+ onClick: HandleClose,
13832
+ role: Button,
13833
+ tabIndex: Focusable,
13834
+ type: Div
13835
+ };
13807
13836
  const getCompletionDetailVirtualDom = content => {
13808
13837
  const dom = [{
13809
13838
  childCount: 2,
13810
- className: 'Viewlet EditorCompletionDetails',
13839
+ className: mergeClassNames('Viewlet', 'EditorCompletionDetails'),
13811
13840
  type: Div
13812
- }, {
13813
- childCount: 1,
13814
- className: CompletionDetailContent,
13815
- type: Div
13816
- }, text(content), {
13817
- childCount: 1,
13818
- className: CompletionDetailCloseButton,
13819
- onClick: HandleClose,
13820
- type: Div
13821
- }, {
13841
+ }, completionDetailContentNode, text(content), completionDetailCloseButtonNode, {
13822
13842
  childCount: 0,
13823
- className: `${MaskIcon} ${IconClose}`,
13843
+ className: mergeClassNames(MaskIcon, IconClose),
13824
13844
  type: Div
13825
13845
  }];
13826
13846
  return dom;
@@ -13968,7 +13988,7 @@ const render = widget => {
13968
13988
  } = widget.newState;
13969
13989
  const dom = [{
13970
13990
  childCount: 1,
13971
- className: 'Viewlet EditorMessage EditorMessageText EditorOverlayMessage',
13991
+ className: mergeClassNames('Viewlet', 'EditorMessage', 'EditorMessageText', 'EditorOverlayMessage'),
13972
13992
  style: `left:${x}px;top:${y}px;`,
13973
13993
  type: Div
13974
13994
  }, text(message)];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/editor-worker",
3
- "version": "19.22.1",
3
+ "version": "19.24.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git@github.com:lvce-editor/editor-worker.git"