@tutti-os/workspace-file-manager 0.0.11 → 0.0.13

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.
@@ -1738,14 +1738,12 @@ function createWorkspaceFileManagerService() {
1738
1738
 
1739
1739
  // src/services/workspaceFileEntryIconPolicy.ts
1740
1740
  var defaultApplicationIconExtensions = /* @__PURE__ */ new Set([
1741
- "7z",
1742
1741
  "ai",
1743
1742
  "dmg",
1744
1743
  "doc",
1745
1744
  "docx",
1746
1745
  "eps",
1747
1746
  "fig",
1748
- "gz",
1749
1747
  "indd",
1750
1748
  "key",
1751
1749
  "numbers",
@@ -1753,31 +1751,41 @@ var defaultApplicationIconExtensions = /* @__PURE__ */ new Set([
1753
1751
  "ods",
1754
1752
  "odt",
1755
1753
  "pages",
1756
- "pdf",
1757
1754
  "pkg",
1758
1755
  "ppt",
1759
1756
  "pptx",
1760
1757
  "psd",
1761
- "rar",
1762
1758
  "rtf",
1763
1759
  "sketch",
1764
- "tar",
1765
- "tgz",
1766
1760
  "xd",
1767
1761
  "xls",
1768
- "xlsx",
1762
+ "xlsx"
1763
+ ]);
1764
+ var archiveIconExtensions = /* @__PURE__ */ new Set([
1765
+ "7z",
1766
+ "gz",
1767
+ "rar",
1768
+ "tar",
1769
+ "tgz",
1769
1770
  "xz",
1770
1771
  "zip"
1771
1772
  ]);
1772
- function shouldResolveWorkspaceFileEntryIcon(entry) {
1773
- return isWorkspaceApplicationBundle(entry) || resolveWorkspaceFileDefaultApplicationIconExtension(entry) !== null;
1773
+ var extensionDocumentIconExtensions = /* @__PURE__ */ new Set(["pdf"]);
1774
+ function shouldResolveWorkspaceFileEntryIcon(entry, options = {}) {
1775
+ return options.includeImageThumbnails && shouldResolveWorkspaceFileImageThumbnail(entry) || isWorkspaceApplicationBundle(entry) || resolveWorkspaceFileDefaultApplicationIconExtension(entry) !== null;
1774
1776
  }
1775
1777
  function shouldUseWorkspaceFileExtensionDocumentIcon(entry) {
1776
1778
  if (entry.kind !== "file") {
1777
1779
  return false;
1778
1780
  }
1779
1781
  const visualKind = resolveWorkspaceFileVisualKind(entry);
1780
- return visualKind === "code" || visualKind === "markdown" || classifyWorkspaceFilePreviewKind(entry) === "text";
1782
+ const extension = resolveWorkspaceFileExtension(entry.name).toLowerCase();
1783
+ return visualKind === "code" || visualKind === "markdown" || extensionDocumentIconExtensions.has(extension) || classifyWorkspaceFilePreviewKind(entry) === "text";
1784
+ }
1785
+ function shouldUseWorkspaceFileArchiveIcon(entry) {
1786
+ return entry.kind === "file" && archiveIconExtensions.has(
1787
+ resolveWorkspaceFileExtension(entry.name).toLowerCase()
1788
+ );
1781
1789
  }
1782
1790
  function isWorkspaceApplicationBundle(entry) {
1783
1791
  return entry.kind !== "file" && entry.name.trim().toLowerCase().endsWith(".app");
@@ -1790,6 +1798,9 @@ function resolveWorkspaceFileDefaultApplicationIconExtension(entry) {
1790
1798
  return defaultApplicationIconExtensions.has(extension) ? extension : null;
1791
1799
  }
1792
1800
  function resolveWorkspaceFileEntryIconCacheKey(entry) {
1801
+ if (shouldResolveWorkspaceFileImageThumbnail(entry)) {
1802
+ return `image-thumbnail:${entry.path}:${entry.mtimeMs ?? 0}`;
1803
+ }
1793
1804
  if (isWorkspaceApplicationBundle(entry)) {
1794
1805
  return `application:${entry.path}:${entry.mtimeMs ?? 0}`;
1795
1806
  }
@@ -1799,6 +1810,9 @@ function resolveWorkspaceFileEntryIconCacheKey(entry) {
1799
1810
  }
1800
1811
  return `default:${entry.path}:${entry.mtimeMs ?? 0}`;
1801
1812
  }
1813
+ function shouldResolveWorkspaceFileImageThumbnail(entry) {
1814
+ return entry.kind === "file" && resolveWorkspaceFileVisualKind(entry) === "image";
1815
+ }
1802
1816
 
1803
1817
  export {
1804
1818
  classifyWorkspaceFilePreviewKind,
@@ -1821,8 +1835,9 @@ export {
1821
1835
  createWorkspaceFileManagerService,
1822
1836
  shouldResolveWorkspaceFileEntryIcon,
1823
1837
  shouldUseWorkspaceFileExtensionDocumentIcon,
1838
+ shouldUseWorkspaceFileArchiveIcon,
1824
1839
  isWorkspaceApplicationBundle,
1825
1840
  resolveWorkspaceFileDefaultApplicationIconExtension,
1826
1841
  resolveWorkspaceFileEntryIconCacheKey
1827
1842
  };
1828
- //# sourceMappingURL=chunk-DXLDUMVG.js.map
1843
+ //# sourceMappingURL=chunk-G2T6CZ2T.js.map