@lvce-editor/editor-worker 19.23.0 → 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
  });
@@ -12634,33 +12639,41 @@ const diffTree = (oldNodes, newNodes) => {
12634
12639
  return removeTrailingNavigationPatches(patches);
12635
12640
  };
12636
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
+ };
12637
12675
  const getEditorInputVirtualDom = () => {
12638
- return [{
12639
- childCount: 1,
12640
- className: 'EditorInput',
12641
- type: Div
12642
- }, {
12643
- ariaAutoComplete: 'list',
12644
- ariaMultiLine: 'true',
12645
- ariaRoleDescription: 'editor',
12646
- autocapitalize: 'off',
12647
- autocomplete: 'off',
12648
- autocorrect: 'off',
12649
- childCount: 0,
12650
- name: 'editor',
12651
- onBeforeInput: HandleBeforeInput,
12652
- onBlur: HandleBlur,
12653
- onCompositionEnd: HandleCompositionEnd,
12654
- onCompositionStart: HandleCompositionStart,
12655
- onCompositionUpdate: HandleCompositionUpdate,
12656
- onCut: HandleCut,
12657
- onFocus: HandleFocus,
12658
- onPaste: HandlePaste,
12659
- role: 'textbox',
12660
- spellcheck: false,
12661
- type: TextArea,
12662
- wrap: 'off'
12663
- }];
12676
+ return [editorInputNode, editorTextAreaNode];
12664
12677
  };
12665
12678
 
12666
12679
  const getCursorsVirtualDom = cursors => {
@@ -12697,10 +12710,6 @@ const getDiagnosticClassName = type => {
12697
12710
  }
12698
12711
  };
12699
12712
 
12700
- const mergeClassNames = (...classNames) => {
12701
- return classNames.filter(Boolean).join(' ');
12702
- };
12703
-
12704
12713
  const getDiagnosticVirtualDom = diagnostic => {
12705
12714
  const {
12706
12715
  height,
@@ -12742,7 +12751,7 @@ const getEditorRowsVirtualDom$1 = (textInfos, differences, lineNumbers = true, h
12742
12751
  const difference = differences[i];
12743
12752
  let className = EditorRow;
12744
12753
  if (i === highlightedLine) {
12745
- className += ' ' + EditorRowHighlighted;
12754
+ className = mergeClassNames(className, EditorRowHighlighted);
12746
12755
  }
12747
12756
  dom.push({
12748
12757
  childCount: textInfo.length / 2,
@@ -12803,12 +12812,13 @@ const getEditorSelectionsVirtualDom = selectionInfos => {
12803
12812
  }, ...selectionsDom];
12804
12813
  };
12805
12814
 
12815
+ const editorLayersNode = {
12816
+ childCount: 4,
12817
+ className: 'EditorLayers',
12818
+ type: Div
12819
+ };
12806
12820
  const getEditorLayersVirtualDom = (selectionInfos, textInfos, differences, lineNumbers = true, highlightedLine = -1, cursorInfos = [], diagnostics = []) => {
12807
- return [{
12808
- childCount: 4,
12809
- className: 'EditorLayers',
12810
- type: Div
12811
- }, ...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)];
12812
12822
  };
12813
12823
 
12814
12824
  const getEditorScrollBarDiagnosticsVirtualDom = scrollBarDiagnostics => {
@@ -12822,26 +12832,34 @@ const getEditorScrollBarDiagnosticsVirtualDom = scrollBarDiagnostics => {
12822
12832
  const getScrollBarVirtualDom = () => {
12823
12833
  return [{
12824
12834
  childCount: 1,
12825
- className: 'ScrollBar ScrollBarVertical',
12835
+ className: mergeClassNames('ScrollBar', 'ScrollBarVertical'),
12826
12836
  onContextMenu: HandleContextMenu,
12827
12837
  onPointerDown: HandleScrollBarVerticalPointerDown,
12828
12838
  type: Div
12829
12839
  }, {
12830
12840
  childCount: 0,
12831
- className: 'ScrollBarThumb ScrollBarThumbVertical',
12841
+ className: mergeClassNames('ScrollBarThumb', 'ScrollBarThumbVertical'),
12832
12842
  type: Div
12833
12843
  }, {
12834
12844
  childCount: 1,
12835
- className: 'ScrollBar ScrollBarHorizontal',
12845
+ className: mergeClassNames('ScrollBar', 'ScrollBarHorizontal'),
12836
12846
  onPointerDown: HandleScrollBarHorizontalPointerDown,
12837
12847
  type: Div
12838
12848
  }, {
12839
12849
  childCount: 0,
12840
- className: 'ScrollBarThumb ScrollBarThumbHorizontal',
12850
+ className: mergeClassNames('ScrollBarThumb', 'ScrollBarThumbHorizontal'),
12841
12851
  type: Div
12842
12852
  }];
12843
12853
  };
12844
12854
 
12855
+ const editorContentNode = {
12856
+ childCount: 5,
12857
+ className: 'EditorContent',
12858
+ onKeyUp: HandleKeyUp,
12859
+ onMouseMove: HandleMouseMove,
12860
+ onWheel: HandleWheel,
12861
+ type: Div
12862
+ };
12845
12863
  const getEditorContentVirtualDom = ({
12846
12864
  cursorInfos = [],
12847
12865
  diagnostics = [],
@@ -12852,14 +12870,7 @@ const getEditorContentVirtualDom = ({
12852
12870
  selectionInfos = [],
12853
12871
  textInfos
12854
12872
  }) => {
12855
- return [{
12856
- childCount: 5,
12857
- className: 'EditorContent',
12858
- onKeyUp: HandleKeyUp,
12859
- onMouseMove: HandleMouseMove,
12860
- onWheel: HandleWheel,
12861
- type: Div
12862
- }, ...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()];
12863
12874
  };
12864
12875
 
12865
12876
  const getGutterInfoVirtualDom = gutterInfo => {
@@ -12906,6 +12917,11 @@ const getGutterInfos = (minLineY, maxLineY, breakPoints, showLineNumbers = true,
12906
12917
  return gutterInfos;
12907
12918
  };
12908
12919
 
12920
+ const textEditorErrorMessageNode = {
12921
+ childCount: 1,
12922
+ className: 'TextEditorErrorMessage',
12923
+ type: Div
12924
+ };
12909
12925
  const getEditorVirtualDom = ({
12910
12926
  breakPoints = [],
12911
12927
  cursorInfos = [],
@@ -12926,29 +12942,25 @@ const getEditorVirtualDom = ({
12926
12942
  if (loadError) {
12927
12943
  return [{
12928
12944
  childCount: 2,
12929
- className: 'Viewlet TextEditorError',
12945
+ className: mergeClassNames('Viewlet', 'TextEditorError'),
12930
12946
  'data-uid': uid,
12931
- role: 'code',
12947
+ role: Code,
12932
12948
  type: Div
12933
12949
  }, {
12934
12950
  childCount: 0,
12935
- className: 'EditorTextIcon EditorTextIconError MaskIcon MaskIconError',
12951
+ className: mergeClassNames('EditorTextIcon', 'EditorTextIconError', 'MaskIcon', 'MaskIconError'),
12936
12952
  type: Div
12937
- }, {
12938
- childCount: 1,
12939
- className: 'TextEditorErrorMessage',
12940
- type: Div
12941
- }, text(loadError)];
12953
+ }, textEditorErrorMessageNode, text(loadError)];
12942
12954
  }
12943
12955
  const visibleGutterInfos = breakPoints.length > 0 || visibleLineIndices ? getGutterInfos(minLineY, maxLineY, breakPoints, lineNumbers, visibleLineIndices) : gutterInfos;
12944
12956
  const showGutter = lineNumbers || breakPoints.length > 0;
12945
12957
  const gutterDom = showGutter ? getEditorGutterVirtualDom(visibleGutterInfos) : [];
12946
12958
  return [{
12947
12959
  childCount: showGutter ? 2 : 1,
12948
- className: 'Viewlet Editor',
12960
+ className: mergeClassNames('Viewlet', 'Editor'),
12949
12961
  'data-uid': uid,
12950
12962
  onContextMenu: HandleContextMenu,
12951
- role: 'code',
12963
+ role: Code,
12952
12964
  type: Div
12953
12965
  }, ...gutterDom, ...getEditorContentVirtualDom({
12954
12966
  cursorInfos,
@@ -13201,7 +13213,7 @@ const renderEventListeners = () => {
13201
13213
  passive: true
13202
13214
  }, {
13203
13215
  name: HandleContextMenu,
13204
- params: ['handleContextMenu', Button, ClientX, ClientY],
13216
+ params: ['handleContextMenu', Button$1, ClientX, ClientY],
13205
13217
  preventDefault: true
13206
13218
  }, {
13207
13219
  name: HandleScrollBarVerticalPointerDown,
@@ -13686,6 +13698,11 @@ const listen = async () => {
13686
13698
 
13687
13699
  const CodeGeneratorInput = 'CodeGeneratorInput';
13688
13700
 
13701
+ const codeGeneratorMessageNode = {
13702
+ childCount: 1,
13703
+ className: CodeGeneratorMessage,
13704
+ type: Div
13705
+ };
13689
13706
  const getCodeGeneratorVirtualDom = state => {
13690
13707
  const escapeToClose$1 = escapeToClose();
13691
13708
  const enterCode$1 = enterCode();
@@ -13699,11 +13716,7 @@ const getCodeGeneratorVirtualDom = state => {
13699
13716
  name: CodeGeneratorInput,
13700
13717
  placeholder: enterCode$1,
13701
13718
  type: Input
13702
- }, {
13703
- childCount: 1,
13704
- className: CodeGeneratorMessage,
13705
- type: Div
13706
- }, text(escapeToClose$1)];
13719
+ }, codeGeneratorMessageNode, text(escapeToClose$1)];
13707
13720
  };
13708
13721
 
13709
13722
  const renderContent$1 = {
@@ -13805,23 +13818,29 @@ const EditorColorPickerWidget = {
13805
13818
  render: render$4
13806
13819
  };
13807
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
+ };
13808
13836
  const getCompletionDetailVirtualDom = content => {
13809
13837
  const dom = [{
13810
13838
  childCount: 2,
13811
- className: 'Viewlet EditorCompletionDetails',
13839
+ className: mergeClassNames('Viewlet', 'EditorCompletionDetails'),
13812
13840
  type: Div
13813
- }, {
13814
- childCount: 1,
13815
- className: CompletionDetailContent,
13816
- type: Div
13817
- }, text(content), {
13818
- childCount: 1,
13819
- className: CompletionDetailCloseButton,
13820
- onClick: HandleClose,
13821
- type: Div
13822
- }, {
13841
+ }, completionDetailContentNode, text(content), completionDetailCloseButtonNode, {
13823
13842
  childCount: 0,
13824
- className: `${MaskIcon} ${IconClose}`,
13843
+ className: mergeClassNames(MaskIcon, IconClose),
13825
13844
  type: Div
13826
13845
  }];
13827
13846
  return dom;
@@ -13969,7 +13988,7 @@ const render = widget => {
13969
13988
  } = widget.newState;
13970
13989
  const dom = [{
13971
13990
  childCount: 1,
13972
- className: 'Viewlet EditorMessage EditorMessageText EditorOverlayMessage',
13991
+ className: mergeClassNames('Viewlet', 'EditorMessage', 'EditorMessageText', 'EditorOverlayMessage'),
13973
13992
  style: `left:${x}px;top:${y}px;`,
13974
13993
  type: Div
13975
13994
  }, text(message)];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/editor-worker",
3
- "version": "19.23.0",
3
+ "version": "19.24.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git@github.com:lvce-editor/editor-worker.git"