@tutti-os/workspace-file-manager 0.0.11 → 0.0.12
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.
- package/dist/{chunk-DXLDUMVG.js → chunk-CSFEGRX7.js} +9 -3
- package/dist/{chunk-DXLDUMVG.js.map → chunk-CSFEGRX7.js.map} +1 -1
- package/dist/{chunk-XOFPTWRV.js → chunk-L6SAJEFE.js} +7 -3
- package/dist/chunk-L6SAJEFE.js.map +1 -0
- package/dist/{fileKinds-Djl-phx5.d.ts → fileKinds-CMKjSrBx.d.ts} +1 -1
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/{index-6Z1LmfOL.d.ts → index-CppyxTLd.d.ts} +2 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +104 -62
- package/dist/index.js.map +1 -1
- package/dist/services/index.d.ts +7 -4
- package/dist/services/index.js +2 -2
- package/package.json +4 -4
- package/dist/chunk-XOFPTWRV.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/i18n/workspaceFileManagerI18n.ts"],"sourcesContent":["import {\n createScopedLocaleObjectsI18nModuleManifest,\n createScopedI18nRuntime,\n type I18nDictionary,\n type I18nRuntime\n} from \"@tutti-os/ui-i18n-runtime\";\n\ntype WorkspaceFileManagerI18nLocale = \"en\" | \"zh-CN\";\nexport const workspaceFileManagerI18nNamespace = \"workspaceFileManager\";\nexport const tuttiI18nModule = createScopedLocaleObjectsI18nModuleManifest({\n localeObjectByLocale: {\n en: \"workspaceFileManagerEn\",\n \"zh-CN\": \"workspaceFileManagerZhCN\"\n },\n name: \"workspace-file-manager\",\n namespace: \"workspaceFileManager\",\n sourceRoot: \"packages/workspace/file-manager/src\"\n});\n\nconst workspaceFileManagerEn = {\n backLabel: \"Back\",\n arrangeApplicationLabel: \"Application\",\n arrangeCreatedLabel: \"Created\",\n arrangeDateAddedLabel: \"Date Added\",\n arrangeKindLabel: \"Kind\",\n arrangeLastOpenedLabel: \"Last Opened\",\n arrangeMenuLabel: \"Arrange\",\n arrangeNoneLabel: \"None\",\n arrangeTagsLabel: \"Tags\",\n breadcrumbRootLabel: \"workspace\",\n cancelLabel: \"Cancel\",\n closeLabel: \"Close\",\n copyLabel: \"Copy\",\n copyPathLabel: \"Copy path\",\n copyPathSuccessTitle: \"Path copied\",\n copySuccessTitle: \"Copied to clipboard\",\n createActionLabel: \"Create\",\n createDirectoryLabel: \"New folder\",\n createDirectoryPlaceholder: \"Folder name\",\n createFileLabel: \"New file\",\n createFilePlaceholder: \"File name\",\n createNameInvalid: \"Use a valid name without path separators\",\n createNameRequired: \"Enter a name to continue\",\n deleteConfirmDescription: \"Delete {{name}} from this workspace?\",\n deleteLabel: \"Delete\",\n deletingLabel: \"Deleting...\",\n downloadFailedTitle: \"Download failed\",\n downloadLabel: \"Download\",\n dropToImportLabel: \"Drop files here to import to the current folder\",\n emptyDirectory: \"No visible files in this folder\",\n forwardLabel: \"Forward\",\n loading: \"Loading\",\n modifiedLabel: \"Modified\",\n nameLabel: \"Name\",\n noSearchResults: \"No files matched your search\",\n openFailedTitle: \"Open failed\",\n openLabel: \"Open\",\n openInAppBrowserLabel: \"Tutti built-in browser\",\n openInDefaultBrowserLabel: \"Default Browser\",\n openWithLabel: \"Open With\",\n openWithLoadingLabel: \"Loading apps...\",\n openWithOtherLabel: \"Other...\",\n openWithOtherPickerPrompt: \"Choose an application to open this file:\",\n revealInFileExplorerLabel: \"Reveal in File Explorer\",\n revealInFileManagerLabel: \"Reveal in File Manager\",\n revealInFinderLabel: \"Reveal in Finder\",\n unknownErrorMessage: \"Something went wrong. Please try again.\",\n previewBinary:\n \"This file looks binary, so the preview stays read-only for now.\",\n previewDecodeFailed:\n \"We couldn't decode this file as UTF-8 text for preview.\",\n previewDirectoryLabel: \"Folder\",\n previewEmptyLabel: \"Select a file or folder to view details\",\n previewFileTooLarge:\n \"This file is larger than {{maxSize}}, so inline preview is disabled.\",\n previewLoadingLabel: \"Loading preview...\",\n previewTooLarge:\n \"This text file is larger than {{maxSize}}, so inline preview is disabled.\",\n previewUnavailableDownloadBody:\n \"Download {{name}} to open it in another environment.\",\n previewUnavailableOpenBody: \"Open {{name}} in your local app instead.\",\n previewUnavailableTitle: \"Can't preview this file\",\n previewUnsupported: \"Inline preview isn't available for this file type yet.\",\n revealFailedTitle: \"Could not reveal in file manager\",\n renameActionLabel: \"Rename\",\n renameLabel: \"Rename\",\n renamePlaceholder: \"New name\",\n refreshLabel: \"Refresh\",\n retryLabel: \"Retry\",\n searchPlaceholder: \"Search files\",\n searchResultsLabel: \"Search results\",\n sizeLabel: \"Size\",\n unsupportedImportBody:\n \"Importing local files into the workspace is not wired up in this desktop build yet.\",\n unsupportedImportTitle: \"Import not available yet\",\n unsupportedViewBody:\n \"Opening {{name}} from the file manager is not supported in this desktop build yet.\",\n unsupportedViewTitle: \"Open not available yet\",\n importConflictDescription:\n \"{{count}} file from this import already exists in this folder tree. Replace it?\",\n importConflictReplaceLabel: \"Replace files\",\n importConflictReviewLabel: \"Existing path\",\n importConflictSummaryFiltered: \"Filtered: {{count}}\",\n importConflictSummaryIgnored: \"Ignored: {{count}}\",\n importConflictSummaryReasonIgnored: \"Ignored by rules: {{count}}\",\n importConflictSummaryReasonSymlink: \"Skipped symlinks: {{count}}\",\n importConflictSummaryReasonSystemMetadata:\n \"Skipped system metadata: {{count}}\",\n importConflictSummarySelected: \"Selected: {{count}}\",\n importConflictTitle: \"Replace existing file?\",\n importFailedTitle: \"Import failed\",\n importLabel: \"Import\",\n importTypeConflictDescription:\n \"{{count}} import path conflicts with an existing file or folder using an incompatible type. Resolve it before retrying.\",\n importTypeConflictTitle: \"Import path conflict\",\n layoutIconViewLabel: \"Icon view\",\n layoutIconViewTooltipLabel: \"Icon mode\",\n layoutListViewLabel: \"List view\",\n layoutListViewTooltipLabel: \"List mode\"\n} as const satisfies I18nDictionary;\n\nconst workspaceFileManagerZhCN = {\n backLabel: \"后退\",\n arrangeApplicationLabel: \"应用程序\",\n arrangeCreatedLabel: \"创建日期\",\n arrangeDateAddedLabel: \"添加日期\",\n arrangeKindLabel: \"种类\",\n arrangeLastOpenedLabel: \"上次打开日期\",\n arrangeMenuLabel: \"排列方式\",\n arrangeNoneLabel: \"无\",\n arrangeTagsLabel: \"标签\",\n breadcrumbRootLabel: \"工作区\",\n cancelLabel: \"取消\",\n closeLabel: \"关闭\",\n copyLabel: \"复制\",\n copyPathLabel: \"复制路径\",\n copyPathSuccessTitle: \"复制成功\",\n copySuccessTitle: \"已复制到剪贴板\",\n createActionLabel: \"创建\",\n createDirectoryLabel: \"新建文件夹\",\n createDirectoryPlaceholder: \"文件夹名称\",\n createFileLabel: \"新建文件\",\n createFilePlaceholder: \"文件名称\",\n createNameInvalid: \"请输入有效名称,且不要包含路径分隔符\",\n createNameRequired: \"请输入名称后再继续\",\n deleteConfirmDescription: \"要从这个工作区删除 {{name}} 吗?\",\n deleteLabel: \"删除\",\n deletingLabel: \"删除中...\",\n downloadFailedTitle: \"下载失败\",\n downloadLabel: \"下载\",\n dropToImportLabel: \"将文件拖到这里以导入到当前文件夹\",\n emptyDirectory: \"这个文件夹里没有可见文件\",\n forwardLabel: \"前进\",\n loading: \"加载中\",\n modifiedLabel: \"修改时间\",\n nameLabel: \"名称\",\n noSearchResults: \"没有匹配的文件\",\n openFailedTitle: \"打开失败\",\n openLabel: \"打开\",\n openInAppBrowserLabel: \"Tutti 内置的浏览器\",\n openInDefaultBrowserLabel: \"默认浏览器\",\n openWithLabel: \"打开方式\",\n openWithLoadingLabel: \"正在加载应用...\",\n openWithOtherLabel: \"其他...\",\n openWithOtherPickerPrompt: \"选择用来打开此文件的应用程序:\",\n revealInFileExplorerLabel: \"在文件资源管理器中显示\",\n revealInFileManagerLabel: \"在文件管理器中显示\",\n revealInFinderLabel: \"在 Finder 中显示\",\n unknownErrorMessage: \"出了点问题,请稍后再试。\",\n previewBinary: \"这个文件更像二进制内容,当前先保持只读占位。\",\n previewDecodeFailed: \"暂时无法按 UTF-8 文本解码这个文件。\",\n previewDirectoryLabel: \"文件夹\",\n previewEmptyLabel: \"选择文件或文件夹查看详情\",\n previewFileTooLarge: \"这个文件超过了 {{maxSize}},暂时不做内联预览。\",\n previewLoadingLabel: \"正在加载预览...\",\n previewTooLarge: \"这个文本文件超过了 {{maxSize}},暂时不做内联预览。\",\n previewUnavailableDownloadBody: \"下载 {{name}} 后再在其他环境中打开。\",\n previewUnavailableOpenBody: \"改为在本地应用中打开 {{name}}。\",\n previewUnavailableTitle: \"这个文件暂时无法预览\",\n previewUnsupported: \"这种文件类型暂时还不支持内联预览。\",\n revealFailedTitle: \"无法在文件管理器中显示\",\n renameActionLabel: \"重命名\",\n renameLabel: \"重命名\",\n renamePlaceholder: \"新名称\",\n refreshLabel: \"刷新\",\n retryLabel: \"重试\",\n searchPlaceholder: \"搜索文件\",\n searchResultsLabel: \"搜索结果\",\n sizeLabel: \"大小\",\n unsupportedImportBody:\n \"这个桌面版本暂时还没有把本地文件导入到工作区的链路接通。\",\n unsupportedImportTitle: \"暂不支持导入\",\n unsupportedViewBody:\n \"这个桌面版本暂时还不支持直接从文件管理器打开 {{name}}。\",\n unsupportedViewTitle: \"暂不支持打开\",\n importConflictDescription:\n \"这次导入里有 {{count}} 个文件在当前目录树中已经存在。要替换吗?\",\n importConflictReplaceLabel: \"替换文件\",\n importConflictReviewLabel: \"现有路径\",\n importConflictSummaryFiltered: \"已过滤:{{count}}\",\n importConflictSummaryIgnored: \"已忽略:{{count}}\",\n importConflictSummaryReasonIgnored: \"规则忽略:{{count}}\",\n importConflictSummaryReasonSymlink: \"已跳过符号链接:{{count}}\",\n importConflictSummaryReasonSystemMetadata: \"已跳过系统元数据:{{count}}\",\n importConflictSummarySelected: \"已选择:{{count}}\",\n importConflictTitle: \"替换已有文件?\",\n importFailedTitle: \"导入失败\",\n importLabel: \"导入\",\n importTypeConflictDescription:\n \"这次导入里有 {{count}} 个路径与现有文件或文件夹的类型不兼容。请先处理后再重试。\",\n importTypeConflictTitle: \"导入路径冲突\",\n layoutIconViewLabel: \"图标\",\n layoutIconViewTooltipLabel: \"图标模式\",\n layoutListViewLabel: \"列表\",\n layoutListViewTooltipLabel: \"列表模式\"\n} as const satisfies I18nDictionary;\n\nexport type WorkspaceFileManagerI18nKey = keyof typeof workspaceFileManagerEn;\n\nexport type WorkspaceFileManagerI18nRuntime =\n I18nRuntime<WorkspaceFileManagerI18nKey>;\n\nconst workspaceFileManagerDefaults: Record<\n WorkspaceFileManagerI18nLocale,\n I18nDictionary\n> = {\n en: workspaceFileManagerEn,\n \"zh-CN\": workspaceFileManagerZhCN\n};\n\nexport const workspaceFileManagerI18nResources: Record<\n WorkspaceFileManagerI18nLocale,\n I18nDictionary\n> = {\n en: {\n [workspaceFileManagerI18nNamespace]: workspaceFileManagerDefaults.en\n },\n \"zh-CN\": {\n [workspaceFileManagerI18nNamespace]: workspaceFileManagerDefaults[\"zh-CN\"]\n }\n};\n\nexport function createWorkspaceFileManagerI18nRuntime(\n runtime: I18nRuntime<string>\n): WorkspaceFileManagerI18nRuntime {\n return createScopedI18nRuntime<WorkspaceFileManagerI18nKey>(\n runtime,\n workspaceFileManagerI18nNamespace\n );\n}\n\nexport function resolveRevealInFolderLabel(\n copy: WorkspaceFileManagerI18nRuntime,\n platform: NodeJS.Platform\n): string {\n if (platform === \"darwin\") {\n return copy.t(\"revealInFinderLabel\");\n }\n if (platform === \"win32\") {\n return copy.t(\"revealInFileExplorerLabel\");\n }\n return copy.t(\"revealInFileManagerLabel\");\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AAGA,IAAM,oCAAoC;AAC1C,IAAM,kBAAkB,4CAA4C;AAAA,EACzE,sBAAsB;AAAA,IACpB,IAAI;AAAA,IACJ,SAAS;AAAA,EACX;AAAA,EACA,MAAM;AAAA,EACN,WAAW;AAAA,EACX,YAAY;AACd,CAAC;AAED,IAAM,yBAAyB;AAAA,EAC7B,WAAW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AG,6BAA6B,OAAO;AAAA,EAC3E;AACF;AAEO,SAAS,sCACd,SACiC;AACjC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;AAEO,SAAS,2BACd,MACA,UACQ;AACR,MAAI,aAAa,UAAU;AACzB,WAAO,KAAK,EAAE,qBAAqB;AAAA,EACrC;AACA,MAAI,aAAa,SAAS;AACxB,WAAO,KAAK,EAAE,2BAA2B;AAAA,EAC3C;AACA,SAAO,KAAK,EAAE,0BAA0B;AAC1C;","names":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as WorkspaceFileManagerI18nRuntime } from './index-
|
|
1
|
+
import { a as WorkspaceFileManagerI18nRuntime } from './index-CppyxTLd.js';
|
|
2
2
|
|
|
3
3
|
type WorkspaceFileManagerHostActionMessageStatus = "cancelled" | "completed" | "started";
|
|
4
4
|
interface WorkspaceFileManagerHostActionMessage {
|
package/dist/i18n/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { W as WorkspaceFileManagerI18nKey, a as WorkspaceFileManagerI18nRuntime, c as createWorkspaceFileManagerI18nRuntime, w as workspaceFileManagerI18nNamespace, b as workspaceFileManagerI18nResources } from '../index-
|
|
1
|
+
export { W as WorkspaceFileManagerI18nKey, a as WorkspaceFileManagerI18nRuntime, c as createWorkspaceFileManagerI18nRuntime, w as workspaceFileManagerI18nNamespace, b as workspaceFileManagerI18nResources } from '../index-CppyxTLd.js';
|
|
2
2
|
import '@tutti-os/ui-i18n-runtime';
|
package/dist/i18n/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
createWorkspaceFileManagerI18nRuntime,
|
|
3
3
|
workspaceFileManagerI18nNamespace,
|
|
4
4
|
workspaceFileManagerI18nResources
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-L6SAJEFE.js";
|
|
6
6
|
export {
|
|
7
7
|
createWorkspaceFileManagerI18nRuntime,
|
|
8
8
|
workspaceFileManagerI18nNamespace,
|
|
@@ -89,7 +89,9 @@ declare const workspaceFileManagerEn: {
|
|
|
89
89
|
readonly importTypeConflictDescription: "{{count}} import path conflicts with an existing file or folder using an incompatible type. Resolve it before retrying.";
|
|
90
90
|
readonly importTypeConflictTitle: "Import path conflict";
|
|
91
91
|
readonly layoutIconViewLabel: "Icon view";
|
|
92
|
+
readonly layoutIconViewTooltipLabel: "Icon mode";
|
|
92
93
|
readonly layoutListViewLabel: "List view";
|
|
94
|
+
readonly layoutListViewTooltipLabel: "List mode";
|
|
93
95
|
};
|
|
94
96
|
type WorkspaceFileManagerI18nKey = keyof typeof workspaceFileManagerEn;
|
|
95
97
|
type WorkspaceFileManagerI18nRuntime = I18nRuntime<WorkspaceFileManagerI18nKey>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { y as WorkspaceFileOpenWithApplication, b as WorkspaceFileEntry, w as WorkspaceFileManagerSession } from './fileKinds-
|
|
2
|
-
export { C as CreateWorkspaceFileManagerSessionInput, W as WorkspaceFileActivationTarget, a as WorkspaceFileDirectoryListing, c as WorkspaceFileEntryKind, d as WorkspaceFileImportConflict, e as WorkspaceFileImportSummary, f as WorkspaceFileImportSummaryReason, g as WorkspaceFileImportSummaryReasonCount, h as WorkspaceFileManagerCapabilities, i as WorkspaceFileManagerFileActivationRequest, j as WorkspaceFileManagerHost, k as WorkspaceFileManagerHostActionMessage, l as WorkspaceFileManagerHostActionMessageStatus, m as WorkspaceFileManagerHostActionResult, n as WorkspaceFileManagerHostExportResult, o as WorkspaceFileManagerHostFallbackAction, p as WorkspaceFileManagerHostFallbackActionKind, q as WorkspaceFileManagerHostFileActivationResult, r as WorkspaceFileManagerHostImportConflict, s as WorkspaceFileManagerHostImportResult, t as WorkspaceFileManagerMutationErrorMessage, u as WorkspaceFileManagerPersistedState, v as WorkspaceFileManagerService, x as WorkspaceFileManagerState, z as WorkspaceFilePreviewKind, A as WorkspaceFilePreviewState, B as WorkspaceFileSearchEntry, D as WorkspaceFileSearchResult, E as classifyWorkspaceFilePreviewKind, F as createWorkspaceFileManagerService, G as resolveWorkspaceFileActivationTarget } from './fileKinds-
|
|
3
|
-
import { a as WorkspaceFileManagerI18nRuntime } from './index-
|
|
4
|
-
export { W as WorkspaceFileManagerI18nKey, c as createWorkspaceFileManagerI18nRuntime, w as workspaceFileManagerI18nNamespace, b as workspaceFileManagerI18nResources } from './index-
|
|
1
|
+
import { y as WorkspaceFileOpenWithApplication, b as WorkspaceFileEntry, w as WorkspaceFileManagerSession } from './fileKinds-CMKjSrBx.js';
|
|
2
|
+
export { C as CreateWorkspaceFileManagerSessionInput, W as WorkspaceFileActivationTarget, a as WorkspaceFileDirectoryListing, c as WorkspaceFileEntryKind, d as WorkspaceFileImportConflict, e as WorkspaceFileImportSummary, f as WorkspaceFileImportSummaryReason, g as WorkspaceFileImportSummaryReasonCount, h as WorkspaceFileManagerCapabilities, i as WorkspaceFileManagerFileActivationRequest, j as WorkspaceFileManagerHost, k as WorkspaceFileManagerHostActionMessage, l as WorkspaceFileManagerHostActionMessageStatus, m as WorkspaceFileManagerHostActionResult, n as WorkspaceFileManagerHostExportResult, o as WorkspaceFileManagerHostFallbackAction, p as WorkspaceFileManagerHostFallbackActionKind, q as WorkspaceFileManagerHostFileActivationResult, r as WorkspaceFileManagerHostImportConflict, s as WorkspaceFileManagerHostImportResult, t as WorkspaceFileManagerMutationErrorMessage, u as WorkspaceFileManagerPersistedState, v as WorkspaceFileManagerService, x as WorkspaceFileManagerState, z as WorkspaceFilePreviewKind, A as WorkspaceFilePreviewState, B as WorkspaceFileSearchEntry, D as WorkspaceFileSearchResult, E as classifyWorkspaceFilePreviewKind, F as createWorkspaceFileManagerService, G as resolveWorkspaceFileActivationTarget } from './fileKinds-CMKjSrBx.js';
|
|
3
|
+
import { a as WorkspaceFileManagerI18nRuntime } from './index-CppyxTLd.js';
|
|
4
|
+
export { W as WorkspaceFileManagerI18nKey, c as createWorkspaceFileManagerI18nRuntime, w as workspaceFileManagerI18nNamespace, b as workspaceFileManagerI18nResources } from './index-CppyxTLd.js';
|
|
5
5
|
import { ReactElement } from 'react';
|
|
6
6
|
import { TuttiDateLocale } from '@tutti-os/ui-system/date-format';
|
|
7
7
|
export { decodeWorkspaceTextFile, isWorkspaceTextFileTooLarge, looksLikeBinaryText, resolveWorkspaceFileExtension, resolveWorkspaceImageMimeType, workspaceFilePreviewMaxBytes, workspaceFileTextMaxBytes } from '@tutti-os/workspace-file-preview';
|
package/dist/index.js
CHANGED
|
@@ -20,13 +20,13 @@ import {
|
|
|
20
20
|
splitWorkspaceFileName,
|
|
21
21
|
workspaceFilePreviewMaxBytes,
|
|
22
22
|
workspaceFileTextMaxBytes
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-CSFEGRX7.js";
|
|
24
24
|
import {
|
|
25
25
|
createWorkspaceFileManagerI18nRuntime,
|
|
26
26
|
resolveRevealInFolderLabel,
|
|
27
27
|
workspaceFileManagerI18nNamespace,
|
|
28
28
|
workspaceFileManagerI18nResources
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-L6SAJEFE.js";
|
|
30
30
|
|
|
31
31
|
// src/ui/WorkspaceFileManager.tsx
|
|
32
32
|
import { useEffect as useEffect5, useMemo as useMemo2, useRef as useRef5, useState as useState7 } from "react";
|
|
@@ -981,9 +981,10 @@ function WorkspaceFileEntryIcon({
|
|
|
981
981
|
const viewportRoot = resolveWorkspaceFileEntryIconViewport(element);
|
|
982
982
|
const observer = new IntersectionObserver(
|
|
983
983
|
(records) => {
|
|
984
|
-
|
|
984
|
+
const intersecting = records.some(
|
|
985
985
|
(record) => record.isIntersecting && record.intersectionRatio > 0
|
|
986
|
-
)
|
|
986
|
+
);
|
|
987
|
+
if (intersecting) {
|
|
987
988
|
reportViewportEnter();
|
|
988
989
|
return;
|
|
989
990
|
}
|
|
@@ -992,7 +993,11 @@ function WorkspaceFileEntryIcon({
|
|
|
992
993
|
{ root: viewportRoot, rootMargin: "0px", threshold: 0 }
|
|
993
994
|
);
|
|
994
995
|
observer.observe(element);
|
|
995
|
-
|
|
996
|
+
const initiallyVisible = isWorkspaceFileEntryIconVisible(
|
|
997
|
+
element,
|
|
998
|
+
viewportRoot
|
|
999
|
+
);
|
|
1000
|
+
if (initiallyVisible) {
|
|
996
1001
|
reportViewportEnter();
|
|
997
1002
|
} else {
|
|
998
1003
|
reportViewportLeave();
|
|
@@ -1015,8 +1020,13 @@ function WorkspaceFileEntryIcon({
|
|
|
1015
1020
|
"img",
|
|
1016
1021
|
{
|
|
1017
1022
|
alt: "",
|
|
1018
|
-
className: cn2(
|
|
1023
|
+
className: cn2(
|
|
1024
|
+
iconClassName,
|
|
1025
|
+
visualKind === "image" ? "rounded-[6px] border border-[var(--border-1)] bg-[var(--transparency-block)] object-contain shadow-sm" : "rounded-[4px] object-contain"
|
|
1026
|
+
),
|
|
1027
|
+
decoding: "async",
|
|
1019
1028
|
draggable: false,
|
|
1029
|
+
loading: "lazy",
|
|
1020
1030
|
src: iconUrl
|
|
1021
1031
|
}
|
|
1022
1032
|
) : /* @__PURE__ */ jsx2(
|
|
@@ -1077,7 +1087,7 @@ function ExtensionDocumentIcon({
|
|
|
1077
1087
|
iconClassName
|
|
1078
1088
|
}) {
|
|
1079
1089
|
const extension = resolveWorkspaceFileExtension(entry.name).slice(0, 5).toUpperCase();
|
|
1080
|
-
const showExtension = extension.length > 0 && iconClassName.includes("
|
|
1090
|
+
const showExtension = extension.length > 0 && !iconClassName.includes("size-4");
|
|
1081
1091
|
return /* @__PURE__ */ jsxs2(
|
|
1082
1092
|
"span",
|
|
1083
1093
|
{
|
|
@@ -1099,19 +1109,19 @@ function entryIconColorClassName(visualKind, isAppBundle) {
|
|
|
1099
1109
|
}
|
|
1100
1110
|
|
|
1101
1111
|
// src/ui/workspaceFileManagerIconGridLayout.ts
|
|
1102
|
-
var workspaceFileManagerIconGridIconSizePx =
|
|
1103
|
-
var workspaceFileManagerIconGridTileMinWidthPx =
|
|
1104
|
-
var workspaceFileManagerIconGridTileMaxWidthPx =
|
|
1112
|
+
var workspaceFileManagerIconGridIconSizePx = 84;
|
|
1113
|
+
var workspaceFileManagerIconGridTileMinWidthPx = 136;
|
|
1114
|
+
var workspaceFileManagerIconGridTileMaxWidthPx = 148;
|
|
1105
1115
|
var workspaceFileManagerIconGridLayout = {
|
|
1106
1116
|
iconSizePx: workspaceFileManagerIconGridIconSizePx,
|
|
1107
1117
|
tileMaxWidthPx: workspaceFileManagerIconGridTileMaxWidthPx,
|
|
1108
1118
|
tileMinWidthPx: workspaceFileManagerIconGridTileMinWidthPx
|
|
1109
1119
|
};
|
|
1110
1120
|
function workspaceFileManagerIconGridIconClassName() {
|
|
1111
|
-
return "size-[
|
|
1121
|
+
return "size-[84px]";
|
|
1112
1122
|
}
|
|
1113
1123
|
function workspaceFileManagerIconGridFrameClassName() {
|
|
1114
|
-
return "size-[
|
|
1124
|
+
return "size-[92px]";
|
|
1115
1125
|
}
|
|
1116
1126
|
|
|
1117
1127
|
// src/ui/WorkspaceFileManagerIconGrid.tsx
|
|
@@ -1214,7 +1224,7 @@ function WorkspaceFileManagerIconTile({
|
|
|
1214
1224
|
});
|
|
1215
1225
|
}, [selected]);
|
|
1216
1226
|
const tileClassName = cn3(
|
|
1217
|
-
"flex min-w-0 max-w-[
|
|
1227
|
+
"flex min-w-0 max-w-[148px] flex-col items-center gap-1.5 rounded-md border border-transparent px-2 py-2 text-center transition-colors",
|
|
1218
1228
|
isInlineRenaming ? "cursor-default" : "cursor-pointer hover:bg-transparency-block",
|
|
1219
1229
|
moveDragActive && "cursor-grabbing",
|
|
1220
1230
|
selected || contextMenuActive || isInlineRenaming ? "border-[var(--border-focus)] bg-transparency-block text-[var(--text-primary)]" : "text-[var(--text-secondary)]",
|
|
@@ -2198,8 +2208,8 @@ function MoveDragPreview({
|
|
|
2198
2208
|
WorkspaceFileEntryIcon,
|
|
2199
2209
|
{
|
|
2200
2210
|
entry: preview.entry,
|
|
2201
|
-
frameClassName: "size-
|
|
2202
|
-
iconClassName: "size-
|
|
2211
|
+
frameClassName: "size-7",
|
|
2212
|
+
iconClassName: "size-6",
|
|
2203
2213
|
iconUrlByCacheKey,
|
|
2204
2214
|
onViewportLeave: onEntryIconViewportLeave,
|
|
2205
2215
|
onViewportEnter: onEntryIconViewportEnter
|
|
@@ -2299,8 +2309,8 @@ function EntryNameCell({
|
|
|
2299
2309
|
WorkspaceFileEntryIcon,
|
|
2300
2310
|
{
|
|
2301
2311
|
entry,
|
|
2302
|
-
frameClassName: "size-
|
|
2303
|
-
iconClassName: "size-
|
|
2312
|
+
frameClassName: "size-7",
|
|
2313
|
+
iconClassName: "size-6",
|
|
2304
2314
|
iconUrlByCacheKey,
|
|
2305
2315
|
onViewportLeave: onEntryIconViewportLeave,
|
|
2306
2316
|
onViewportEnter: onEntryIconViewportEnter
|
|
@@ -2363,8 +2373,8 @@ function EntryNameCell({
|
|
|
2363
2373
|
WorkspaceFileEntryIcon,
|
|
2364
2374
|
{
|
|
2365
2375
|
entry,
|
|
2366
|
-
frameClassName: "size-
|
|
2367
|
-
iconClassName: "size-
|
|
2376
|
+
frameClassName: "size-7",
|
|
2377
|
+
iconClassName: "size-6",
|
|
2368
2378
|
iconUrlByCacheKey,
|
|
2369
2379
|
isEnteringDirectory,
|
|
2370
2380
|
onViewportLeave: onEntryIconViewportLeave,
|
|
@@ -2504,6 +2514,10 @@ import {
|
|
|
2504
2514
|
DropdownMenuTrigger,
|
|
2505
2515
|
LoadingIcon as LoadingIcon3,
|
|
2506
2516
|
RefreshIcon,
|
|
2517
|
+
Tooltip,
|
|
2518
|
+
TooltipContent,
|
|
2519
|
+
TooltipProvider,
|
|
2520
|
+
TooltipTrigger,
|
|
2507
2521
|
ViewGridLinedIcon,
|
|
2508
2522
|
ViewListLinedIcon,
|
|
2509
2523
|
cn as cn5
|
|
@@ -2627,7 +2641,7 @@ function LayoutModeToggle({
|
|
|
2627
2641
|
{ label: copy.t("sizeLabel"), mode: "size" },
|
|
2628
2642
|
{ label: copy.t("arrangeTagsLabel"), mode: "tags" }
|
|
2629
2643
|
];
|
|
2630
|
-
return /* @__PURE__ */ jsxs5(
|
|
2644
|
+
return /* @__PURE__ */ jsx5(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsxs5(
|
|
2631
2645
|
"div",
|
|
2632
2646
|
{
|
|
2633
2647
|
className: "flex items-center rounded-md border border-[var(--border-1)] bg-[var(--transparency-block)] p-0.5",
|
|
@@ -2638,6 +2652,7 @@ function LayoutModeToggle({
|
|
|
2638
2652
|
{
|
|
2639
2653
|
active: layoutMode === "icon",
|
|
2640
2654
|
ariaLabel: copy.t("layoutIconViewLabel"),
|
|
2655
|
+
tooltipLabel: copy.t("layoutIconViewTooltipLabel"),
|
|
2641
2656
|
onClick: () => {
|
|
2642
2657
|
onLayoutModeChange("icon");
|
|
2643
2658
|
},
|
|
@@ -2649,6 +2664,7 @@ function LayoutModeToggle({
|
|
|
2649
2664
|
{
|
|
2650
2665
|
active: layoutMode === "list",
|
|
2651
2666
|
ariaLabel: copy.t("layoutListViewLabel"),
|
|
2667
|
+
tooltipLabel: copy.t("layoutListViewTooltipLabel"),
|
|
2652
2668
|
onClick: () => {
|
|
2653
2669
|
onLayoutModeChange("list");
|
|
2654
2670
|
},
|
|
@@ -2663,7 +2679,6 @@ function LayoutModeToggle({
|
|
|
2663
2679
|
"aria-label": copy.t("arrangeMenuLabel"),
|
|
2664
2680
|
className: "size-6 min-w-6 rounded-[4px] p-0 text-[var(--text-secondary)] data-[state=open]:bg-[var(--background-fronted)] data-[state=open]:text-[var(--text-primary)] data-[state=open]:shadow-sm",
|
|
2665
2681
|
size: "icon-sm",
|
|
2666
|
-
title: copy.t("arrangeMenuLabel"),
|
|
2667
2682
|
type: "button",
|
|
2668
2683
|
variant: "ghost",
|
|
2669
2684
|
children: /* @__PURE__ */ jsx5(ChevronDownIcon, { className: "size-3.5" })
|
|
@@ -2680,7 +2695,9 @@ function LayoutModeToggle({
|
|
|
2680
2695
|
{
|
|
2681
2696
|
value: arrangeMode,
|
|
2682
2697
|
onValueChange: (nextMode) => {
|
|
2683
|
-
onArrangeModeChange(
|
|
2698
|
+
onArrangeModeChange(
|
|
2699
|
+
nextMode
|
|
2700
|
+
);
|
|
2684
2701
|
},
|
|
2685
2702
|
children: arrangeOptions.map((option, index) => /* @__PURE__ */ jsxs5("div", { children: [
|
|
2686
2703
|
index === 1 ? /* @__PURE__ */ jsx5(DropdownMenuSeparator, {}) : null,
|
|
@@ -2700,31 +2717,34 @@ function LayoutModeToggle({
|
|
|
2700
2717
|
] })
|
|
2701
2718
|
]
|
|
2702
2719
|
}
|
|
2703
|
-
);
|
|
2720
|
+
) });
|
|
2704
2721
|
}
|
|
2705
2722
|
function LayoutModeButton({
|
|
2706
2723
|
active,
|
|
2707
2724
|
ariaLabel,
|
|
2708
2725
|
children,
|
|
2709
|
-
onClick
|
|
2726
|
+
onClick,
|
|
2727
|
+
tooltipLabel
|
|
2710
2728
|
}) {
|
|
2711
|
-
return /* @__PURE__ */
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2729
|
+
return /* @__PURE__ */ jsxs5(Tooltip, { children: [
|
|
2730
|
+
/* @__PURE__ */ jsx5(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx5(
|
|
2731
|
+
Button2,
|
|
2732
|
+
{
|
|
2733
|
+
"aria-label": ariaLabel,
|
|
2734
|
+
"aria-pressed": active,
|
|
2735
|
+
className: cn5(
|
|
2736
|
+
"size-6 min-w-6 rounded-[4px] p-0 text-text-secondary",
|
|
2737
|
+
active && "!bg-background-fronted text-foreground hover:!bg-background-fronted"
|
|
2738
|
+
),
|
|
2739
|
+
size: "icon-sm",
|
|
2740
|
+
type: "button",
|
|
2741
|
+
variant: "ghost",
|
|
2742
|
+
onClick,
|
|
2743
|
+
children
|
|
2744
|
+
}
|
|
2745
|
+
) }),
|
|
2746
|
+
/* @__PURE__ */ jsx5(TooltipContent, { side: "bottom", children: tooltipLabel })
|
|
2747
|
+
] });
|
|
2728
2748
|
}
|
|
2729
2749
|
function ToolbarIconButton({
|
|
2730
2750
|
ariaLabel,
|
|
@@ -2849,6 +2869,10 @@ import { useCallback as useCallback5, useEffect as useEffect4, useMemo, useState
|
|
|
2849
2869
|
|
|
2850
2870
|
// src/ui/workspaceFileEntryIconUrlQueue.ts
|
|
2851
2871
|
var defaultMaxConcurrentIconRequests = 3;
|
|
2872
|
+
var imageThumbnailCacheKeyPrefix = "image-thumbnail:";
|
|
2873
|
+
function shouldKeepResolvedIconAfterViewportLeave(cacheKey) {
|
|
2874
|
+
return cacheKey.startsWith(imageThumbnailCacheKeyPrefix);
|
|
2875
|
+
}
|
|
2852
2876
|
function createWorkspaceFileEntryIconUrlQueue(options) {
|
|
2853
2877
|
const maxConcurrent = Math.max(
|
|
2854
2878
|
1,
|
|
@@ -2862,6 +2886,9 @@ function createWorkspaceFileEntryIconUrlQueue(options) {
|
|
|
2862
2886
|
let activeCount = 0;
|
|
2863
2887
|
let disposed = false;
|
|
2864
2888
|
let retainedCacheKeys = null;
|
|
2889
|
+
const policyOptions = {
|
|
2890
|
+
includeImageThumbnails: options.includeImageThumbnails
|
|
2891
|
+
};
|
|
2865
2892
|
function publish() {
|
|
2866
2893
|
for (const listener of listeners) {
|
|
2867
2894
|
listener();
|
|
@@ -2873,6 +2900,9 @@ function createWorkspaceFileEntryIconUrlQueue(options) {
|
|
|
2873
2900
|
function isVisible(cacheKey) {
|
|
2874
2901
|
return (visibleReferenceCountByCacheKey.get(cacheKey) ?? 0) > 0;
|
|
2875
2902
|
}
|
|
2903
|
+
function shouldResolveCacheKey(cacheKey) {
|
|
2904
|
+
return isVisible(cacheKey) || shouldKeepResolvedIconAfterViewportLeave(cacheKey);
|
|
2905
|
+
}
|
|
2876
2906
|
function retainVisibleReference(cacheKey) {
|
|
2877
2907
|
visibleReferenceCountByCacheKey.set(
|
|
2878
2908
|
cacheKey,
|
|
@@ -2883,15 +2913,17 @@ function createWorkspaceFileEntryIconUrlQueue(options) {
|
|
|
2883
2913
|
const nextCount = (visibleReferenceCountByCacheKey.get(cacheKey) ?? 0) - 1;
|
|
2884
2914
|
if (nextCount > 0) {
|
|
2885
2915
|
visibleReferenceCountByCacheKey.set(cacheKey, nextCount);
|
|
2886
|
-
return
|
|
2916
|
+
return;
|
|
2887
2917
|
}
|
|
2888
2918
|
visibleReferenceCountByCacheKey.delete(cacheKey);
|
|
2919
|
+
if (shouldKeepResolvedIconAfterViewportLeave(cacheKey)) {
|
|
2920
|
+
return;
|
|
2921
|
+
}
|
|
2889
2922
|
queuedEntries.delete(cacheKey);
|
|
2890
2923
|
const hadCachedIcon = iconUrlByCacheKey.delete(cacheKey);
|
|
2891
2924
|
if (hadCachedIcon) {
|
|
2892
2925
|
publish();
|
|
2893
2926
|
}
|
|
2894
|
-
return true;
|
|
2895
2927
|
}
|
|
2896
2928
|
function drain() {
|
|
2897
2929
|
if (disposed || !options.resolveEntryIconUrl) {
|
|
@@ -2904,18 +2936,20 @@ function createWorkspaceFileEntryIconUrlQueue(options) {
|
|
|
2904
2936
|
}
|
|
2905
2937
|
const [cacheKey, entry] = next;
|
|
2906
2938
|
queuedEntries.delete(cacheKey);
|
|
2907
|
-
if (!
|
|
2939
|
+
if (!shouldResolveCacheKey(cacheKey) || iconUrlByCacheKey.has(cacheKey) || inFlightCacheKeys.has(cacheKey)) {
|
|
2908
2940
|
continue;
|
|
2909
2941
|
}
|
|
2910
2942
|
activeCount += 1;
|
|
2911
2943
|
inFlightCacheKeys.add(cacheKey);
|
|
2912
2944
|
void options.resolveEntryIconUrl(entry).then((iconUrl) => {
|
|
2913
|
-
|
|
2945
|
+
const shouldStore = !disposed && isRetained(cacheKey) && shouldResolveCacheKey(cacheKey);
|
|
2946
|
+
if (shouldStore) {
|
|
2914
2947
|
iconUrlByCacheKey.set(cacheKey, iconUrl?.trim() || null);
|
|
2915
2948
|
publish();
|
|
2916
2949
|
}
|
|
2917
2950
|
}).catch(() => {
|
|
2918
|
-
|
|
2951
|
+
const shouldStore = !disposed && isRetained(cacheKey) && shouldResolveCacheKey(cacheKey);
|
|
2952
|
+
if (shouldStore) {
|
|
2919
2953
|
iconUrlByCacheKey.set(cacheKey, null);
|
|
2920
2954
|
publish();
|
|
2921
2955
|
}
|
|
@@ -2927,6 +2961,9 @@ function createWorkspaceFileEntryIconUrlQueue(options) {
|
|
|
2927
2961
|
}
|
|
2928
2962
|
}
|
|
2929
2963
|
return {
|
|
2964
|
+
activate() {
|
|
2965
|
+
disposed = false;
|
|
2966
|
+
},
|
|
2930
2967
|
dispose() {
|
|
2931
2968
|
disposed = true;
|
|
2932
2969
|
queuedEntries.clear();
|
|
@@ -2934,13 +2971,14 @@ function createWorkspaceFileEntryIconUrlQueue(options) {
|
|
|
2934
2971
|
listeners.clear();
|
|
2935
2972
|
},
|
|
2936
2973
|
leaveViewport(entry) {
|
|
2937
|
-
if (disposed || !shouldResolveWorkspaceFileEntryIcon(entry)) {
|
|
2974
|
+
if (disposed || !shouldResolveWorkspaceFileEntryIcon(entry, policyOptions)) {
|
|
2938
2975
|
return;
|
|
2939
2976
|
}
|
|
2940
|
-
|
|
2977
|
+
const cacheKey = resolveWorkspaceFileEntryIconCacheKey(entry);
|
|
2978
|
+
releaseVisibleReference(cacheKey);
|
|
2941
2979
|
},
|
|
2942
2980
|
enterViewport(entry) {
|
|
2943
|
-
if (disposed || !options.resolveEntryIconUrl || !shouldResolveWorkspaceFileEntryIcon(entry)) {
|
|
2981
|
+
if (disposed || !options.resolveEntryIconUrl || !shouldResolveWorkspaceFileEntryIcon(entry, policyOptions)) {
|
|
2944
2982
|
return;
|
|
2945
2983
|
}
|
|
2946
2984
|
const cacheKey = resolveWorkspaceFileEntryIconCacheKey(entry);
|
|
@@ -2953,7 +2991,9 @@ function createWorkspaceFileEntryIconUrlQueue(options) {
|
|
|
2953
2991
|
},
|
|
2954
2992
|
retainEntries(entries) {
|
|
2955
2993
|
retainedCacheKeys = new Set(
|
|
2956
|
-
entries.filter(
|
|
2994
|
+
entries.filter(
|
|
2995
|
+
(entry) => shouldResolveWorkspaceFileEntryIcon(entry, policyOptions)
|
|
2996
|
+
).map((entry) => resolveWorkspaceFileEntryIconCacheKey(entry))
|
|
2957
2997
|
);
|
|
2958
2998
|
let changed = false;
|
|
2959
2999
|
for (const cacheKey of iconUrlByCacheKey.keys()) {
|
|
@@ -2998,22 +3038,29 @@ function createWorkspaceFileEntryIconUrlQueue(options) {
|
|
|
2998
3038
|
}
|
|
2999
3039
|
|
|
3000
3040
|
// src/ui/useWorkspaceFileEntryIconUrls.ts
|
|
3001
|
-
function buildIconTargetSignature(entries) {
|
|
3002
|
-
return entries.filter(shouldResolveWorkspaceFileEntryIcon).map((entry) => resolveWorkspaceFileEntryIconCacheKey(entry)).join("\0");
|
|
3041
|
+
function buildIconTargetSignature(entries, options) {
|
|
3042
|
+
return entries.filter((entry) => shouldResolveWorkspaceFileEntryIcon(entry, options)).map((entry) => resolveWorkspaceFileEntryIconCacheKey(entry)).join("\0");
|
|
3003
3043
|
}
|
|
3004
3044
|
function useWorkspaceFileEntryIconUrls(input) {
|
|
3005
|
-
const { entries, resolveEntryIconUrl } = input;
|
|
3045
|
+
const { entries, includeImageThumbnails, resolveEntryIconUrl } = input;
|
|
3006
3046
|
const queue = useMemo(
|
|
3007
3047
|
() => createWorkspaceFileEntryIconUrlQueue({
|
|
3048
|
+
includeImageThumbnails,
|
|
3008
3049
|
resolveEntryIconUrl
|
|
3009
3050
|
}),
|
|
3010
|
-
[resolveEntryIconUrl]
|
|
3051
|
+
[includeImageThumbnails, resolveEntryIconUrl]
|
|
3011
3052
|
);
|
|
3012
3053
|
const [iconUrlByCacheKey, setIconUrlByCacheKey] = useState6(() => queue.snapshot());
|
|
3013
3054
|
const iconTargetSignature = useMemo(
|
|
3014
|
-
() => buildIconTargetSignature(entries),
|
|
3015
|
-
[entries]
|
|
3055
|
+
() => buildIconTargetSignature(entries, { includeImageThumbnails }),
|
|
3056
|
+
[entries, includeImageThumbnails]
|
|
3016
3057
|
);
|
|
3058
|
+
useEffect4(() => {
|
|
3059
|
+
queue.activate();
|
|
3060
|
+
return () => {
|
|
3061
|
+
queue.dispose();
|
|
3062
|
+
};
|
|
3063
|
+
}, [queue]);
|
|
3017
3064
|
useEffect4(() => {
|
|
3018
3065
|
queue.retainEntries(entries);
|
|
3019
3066
|
}, [entries, iconTargetSignature, queue]);
|
|
@@ -3023,12 +3070,6 @@ function useWorkspaceFileEntryIconUrls(input) {
|
|
|
3023
3070
|
setIconUrlByCacheKey(queue.snapshot());
|
|
3024
3071
|
});
|
|
3025
3072
|
}, [queue]);
|
|
3026
|
-
useEffect4(
|
|
3027
|
-
() => () => {
|
|
3028
|
-
queue.dispose();
|
|
3029
|
-
},
|
|
3030
|
-
[queue]
|
|
3031
|
-
);
|
|
3032
3073
|
const reportEntryIconViewportEnter = useCallback5(
|
|
3033
3074
|
(entry) => {
|
|
3034
3075
|
queue.enterViewport(entry);
|
|
@@ -3515,6 +3556,7 @@ function WorkspaceFileManagerPanelsContainer({
|
|
|
3515
3556
|
reportEntryIconViewportLeave
|
|
3516
3557
|
} = useWorkspaceFileEntryIconUrls({
|
|
3517
3558
|
entries: arrangedEntries,
|
|
3559
|
+
includeImageThumbnails: true,
|
|
3518
3560
|
resolveEntryIconUrl
|
|
3519
3561
|
});
|
|
3520
3562
|
return /* @__PURE__ */ jsx6(
|