@lvce-editor/status-bar-worker 3.30.0 → 3.30.1

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.
@@ -1899,7 +1899,7 @@ const applyUpdate = update => {
1899
1899
  ...editorStatus,
1900
1900
  ...update
1901
1901
  };
1902
- if (typeof next.column !== 'number' || typeof next.encoding !== 'string' || typeof next.endOfLine !== 'string' || typeof next.insertSpaces !== 'boolean' || typeof next.languageId !== 'string' || typeof next.line !== 'number' || typeof next.tabSize !== 'number') {
1902
+ if (typeof next.column !== 'number' || typeof next.encoding !== 'string' || typeof next.endOfLine !== 'string' || typeof next.insertSpaces !== 'boolean' || typeof next.languageId !== 'string' || typeof next.line !== 'number' || next.selectedChars !== undefined && typeof next.selectedChars !== 'number' || typeof next.tabSize !== 'number') {
1903
1903
  throw new TypeError('The first editor status update must contain a complete status');
1904
1904
  }
1905
1905
  editorStatus = next;
@@ -1927,12 +1927,15 @@ const getEditorStatusBarItems = status => {
1927
1927
  insertSpaces = true,
1928
1928
  languageId,
1929
1929
  line,
1930
+ selectedChars = 0,
1930
1931
  tabSize
1931
1932
  } = status;
1932
1933
  const encodingLabel = encoding === 'utf8' ? ['UTF', '8'].join('-') : encoding;
1933
1934
  const indentationLabel = insertSpaces ? `Spaces: ${tabSize}` : `Tab Size: ${tabSize}`;
1934
1935
  const endOfLineLabel = endOfLine.toUpperCase();
1935
- return [textItem(EditorPosition, `Ln ${line}, Col ${column}`, `Line ${line}, Column ${column}`, 'Go to Line/Column'), textItem(EditorIndentation, indentationLabel, indentationLabel, 'Select Indentation'), textItem(EditorEncoding, encodingLabel, `Encoding: ${encodingLabel}`, 'Select Encoding'), textItem(EditorEndOfLine, endOfLineLabel, `End of Line: ${endOfLineLabel}`, 'Select End of Line Sequence'), textItem(EditorLanguage, languageId, `Language: ${languageId}`, 'Select Language Mode')];
1936
+ const positionLabel = selectedChars > 0 ? `Ln ${line}, Col ${column} (${selectedChars} selected)` : `Ln ${line}, Col ${column}`;
1937
+ const positionAriaLabel = selectedChars > 0 ? `Line ${line}, Column ${column}, ${selectedChars} selected` : `Line ${line}, Column ${column}`;
1938
+ return [textItem(EditorPosition, positionLabel, positionAriaLabel, 'Go to Line/Column'), textItem(EditorIndentation, indentationLabel, indentationLabel, 'Select Indentation'), textItem(EditorEncoding, encodingLabel, `Encoding: ${encodingLabel}`, 'Select Encoding'), textItem(EditorEndOfLine, endOfLineLabel, `End of Line: ${endOfLineLabel}`, 'Select End of Line Sequence'), textItem(EditorLanguage, languageId, `Language: ${languageId}`, 'Select Language Mode')];
1936
1939
  };
1937
1940
 
1938
1941
  const dependencies = {
@@ -1940,7 +1943,7 @@ const dependencies = {
1940
1943
  [EditorEndOfLine]: ['endOfLine'],
1941
1944
  [EditorIndentation]: ['insertSpaces', 'tabSize'],
1942
1945
  [EditorLanguage]: ['languageId'],
1943
- [EditorPosition]: ['line', 'column']
1946
+ [EditorPosition]: ['line', 'column', 'selectedChars']
1944
1947
  };
1945
1948
  const handleEditorStatusChanged = (state, editorStatus, previous = state) => {
1946
1949
  const {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/status-bar-worker",
3
- "version": "3.30.0",
3
+ "version": "3.30.1",
4
4
  "description": "Status Bar Worker",
5
5
  "repository": {
6
6
  "type": "git",