@lvce-editor/explorer-view 4.8.0 → 4.10.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.
@@ -1733,11 +1733,12 @@ const getSiblingFileNames = (items, focusedIndex, root, pathSeparator) => {
1733
1733
  return items.filter(item => item.depth === 0).map(item => item.name);
1734
1734
  }
1735
1735
  const focusedItem = items[focusedIndex];
1736
- const focusedItemParentPath = focusedItem.path.slice(0, -(focusedItem.name.length + 1));
1736
+ const nameLength = focusedItem.name ? focusedItem.name.length + 1 : 0;
1737
+ const focusedItemParentPath = focusedItem.path.slice(0, -nameLength);
1737
1738
 
1738
1739
  // Find all items that are direct children of the same parent as the focused item
1739
1740
  const siblingItems = items.filter(item => {
1740
- const itemParentPath = item.path.slice(0, -(item.name.length + 1));
1741
+ const itemParentPath = item.path.slice(0, -nameLength);
1741
1742
  return itemParentPath === focusedItemParentPath;
1742
1743
  });
1743
1744
  return siblingItems.map(item => item.name);
@@ -1804,7 +1805,7 @@ const CopyRelativePath = 'Copy Relative Path';
1804
1805
  const Cut = 'Cut';
1805
1806
  const Delete = 'Delete';
1806
1807
  const FileNameCannotStartWithSlash = 'A file or folder name cannot start with a slash.';
1807
- const FileOrFolderAlreadyExists = 'A file or folder **{0}** already exists at this location. Please choose a different name.';
1808
+ const FileOrFolderAlreadyExists = 'A file or folder **{PH1}** already exists at this location. Please choose a different name.';
1808
1809
  const FileOrFolderNameMustBeProvider = 'A file or folder name must be provided.';
1809
1810
  const FileCannotStartWithDot = 'A file or folder name cannot start with a dot.';
1810
1811
  const FileCannotStartWithBackSlash = 'A file or folder name cannot start with a backslash.';
@@ -1883,8 +1884,10 @@ const fileCannotStartWithBackSlash = () => {
1883
1884
  const typeAFileName = () => {
1884
1885
  return i18nString(TypeAFileName);
1885
1886
  };
1886
- const fileOrFolderAlreadyExists = () => {
1887
- return i18nString(FileOrFolderAlreadyExists);
1887
+ const fileOrFolderAlreadyExists = name => {
1888
+ return i18nString(FileOrFolderAlreadyExists, {
1889
+ PH1: name
1890
+ });
1888
1891
  };
1889
1892
 
1890
1893
  const validateFileName2 = (name, siblingFileNames = []) => {
@@ -1904,7 +1907,7 @@ const validateFileName2 = (name, siblingFileNames = []) => {
1904
1907
 
1905
1908
  // Check if file already exists
1906
1909
  if (siblingFileNames.includes(name)) {
1907
- return fileOrFolderAlreadyExists();
1910
+ return fileOrFolderAlreadyExists(name);
1908
1911
  }
1909
1912
  return '';
1910
1913
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/explorer-view",
3
- "version": "4.8.0",
3
+ "version": "4.10.0",
4
4
  "description": "Explorer Worker",
5
5
  "repository": {
6
6
  "type": "git",