@lvce-editor/explorer-view 7.30.1 → 7.30.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.
@@ -4302,14 +4302,16 @@ const expandRecursively = async state => {
4302
4302
 
4303
4303
  const focus = state => {
4304
4304
  const {
4305
- focus
4305
+ focus,
4306
+ focused
4306
4307
  } = state;
4307
- if (focus) {
4308
+ if (focus && focused) {
4308
4309
  return state;
4309
4310
  }
4310
4311
  return {
4311
4312
  ...state,
4312
- focus: List
4313
+ focus: focus || List,
4314
+ focused: true
4313
4315
  };
4314
4316
  };
4315
4317
 
@@ -8020,12 +8022,17 @@ const getExplorerVirtualDom = (visibleItems, focusedIndex, root, isWide, focused
8020
8022
  return dom;
8021
8023
  };
8022
8024
 
8025
+ const RE_SENTENCE_END = /[.!?]$/;
8023
8026
  const getMissingFolderMessage = root => {
8024
8027
  if (root) {
8025
8028
  return `Could not open "${root}" because the folder does not exist. It may have been moved or deleted.`;
8026
8029
  }
8027
8030
  return 'Could not open folder because the folder does not exist. It may have been moved or deleted.';
8028
8031
  };
8032
+ const toSentence = message => {
8033
+ const normalized = `${message[0].toUpperCase()}${message.slice(1)}`;
8034
+ return RE_SENTENCE_END.test(normalized) ? normalized : `${normalized}.`;
8035
+ };
8029
8036
  const getLoadErrorMessage = state => {
8030
8037
  const {
8031
8038
  errorCode,
@@ -8037,9 +8044,9 @@ const getLoadErrorMessage = state => {
8037
8044
  if (errorCode === 'ENOENT') {
8038
8045
  return getMissingFolderMessage(root);
8039
8046
  }
8040
- const code = errorCode ? ` (error code: ${errorCode})` : '';
8041
8047
  const reason = errorMessage || 'an unexpected error occurred';
8042
- return `Could not open folder due to ${reason}${code}.`;
8048
+ const code = errorCode ? ` Error code: ${errorCode}.` : '';
8049
+ return `Could not open folder. ${toSentence(reason)}${code}`;
8043
8050
  }
8044
8051
  return '';
8045
8052
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/explorer-view",
3
- "version": "7.30.1",
3
+ "version": "7.30.3",
4
4
  "description": "Explorer Worker",
5
5
  "repository": {
6
6
  "type": "git",