@tutti-os/workspace-file-manager 0.0.93 → 0.0.95
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/README.md +4 -0
- package/dist/{chunk-HIYT2WOT.js → chunk-KKKQGRC5.js} +5 -1
- package/dist/chunk-KKKQGRC5.js.map +1 -0
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/{index-D23bxzS8.d.ts → index-C3AgiOLN.d.ts} +2 -0
- package/dist/index.d.ts +6 -5
- package/dist/index.js +288 -34
- package/dist/index.js.map +1 -1
- package/dist/services/index.d.ts +3 -3
- package/dist/services/index.js +1 -1
- package/dist/{workspaceFileManagerLocations-D9EY8vxl.d.ts → workspaceFileManagerLocations-mW7kL37e.d.ts} +1 -1
- package/package.json +4 -4
- package/dist/chunk-HIYT2WOT.js.map +0 -1
package/README.md
CHANGED
|
@@ -24,6 +24,10 @@ needed to drive those flows so different hosts can integrate primarily by
|
|
|
24
24
|
implementing `WorkspaceFileManagerHost` instead of rebuilding workflow around
|
|
25
25
|
the shared UI.
|
|
26
26
|
|
|
27
|
+
The optional React surface persists the adjustable locations-sidebar and
|
|
28
|
+
details-panel widths on the current device. Restored widths are clamped to the
|
|
29
|
+
available surface so the central file list keeps its minimum usable width.
|
|
30
|
+
|
|
27
31
|
Hosts now provide one app-level i18n runtime and scope it into the file-manager
|
|
28
32
|
namespace, rather than hand-assembling package-local message objects.
|
|
29
33
|
|
|
@@ -80,6 +80,8 @@ var workspaceFileManagerEn = {
|
|
|
80
80
|
renameLabel: "Rename",
|
|
81
81
|
renamePlaceholder: "New name",
|
|
82
82
|
refreshLabel: "Refresh",
|
|
83
|
+
resizeLocationsSidebar: "Resize locations sidebar",
|
|
84
|
+
resizePreviewPanel: "Resize file details panel",
|
|
83
85
|
retryLabel: "Retry",
|
|
84
86
|
searchPlaceholder: "Search files",
|
|
85
87
|
searchResultsLabel: "Search results",
|
|
@@ -174,6 +176,8 @@ var workspaceFileManagerZhCN = {
|
|
|
174
176
|
renameLabel: "\u91CD\u547D\u540D",
|
|
175
177
|
renamePlaceholder: "\u65B0\u540D\u79F0",
|
|
176
178
|
refreshLabel: "\u5237\u65B0",
|
|
179
|
+
resizeLocationsSidebar: "\u8C03\u6574\u4F4D\u7F6E\u4FA7\u680F\u5BBD\u5EA6",
|
|
180
|
+
resizePreviewPanel: "\u8C03\u6574\u6587\u4EF6\u8BE6\u60C5\u9762\u677F\u5BBD\u5EA6",
|
|
177
181
|
retryLabel: "\u91CD\u8BD5",
|
|
178
182
|
searchPlaceholder: "\u641C\u7D22\u6587\u4EF6",
|
|
179
183
|
searchResultsLabel: "\u641C\u7D22\u7ED3\u679C",
|
|
@@ -235,4 +239,4 @@ export {
|
|
|
235
239
|
createWorkspaceFileManagerI18nRuntime,
|
|
236
240
|
resolveRevealInFolderLabel
|
|
237
241
|
};
|
|
238
|
-
//# sourceMappingURL=chunk-
|
|
242
|
+
//# sourceMappingURL=chunk-KKKQGRC5.js.map
|
|
@@ -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 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 clearSearchLabel: \"Clear search\",\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 collapseFolderLabel: \"Collapse folder\",\n expandFolderLabel: \"Expand 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 openInFileViewerLabel: \"File viewer\",\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 resizeLocationsSidebar: \"Resize locations sidebar\",\n resizePreviewPanel: \"Resize file details panel\",\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 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 clearSearchLabel: \"清空搜索\",\n deleteConfirmDescription: \"要从这个工作区删除 {{name}} 吗?\",\n deleteLabel: \"删除\",\n deletingLabel: \"删除中...\",\n downloadFailedTitle: \"下载失败\",\n downloadLabel: \"下载\",\n dropToImportLabel: \"将文件拖到这里以导入到当前文件夹\",\n emptyDirectory: \"这个文件夹里没有可见文件\",\n collapseFolderLabel: \"收起文件夹\",\n expandFolderLabel: \"展开文件夹\",\n forwardLabel: \"前进\",\n loading: \"加载中\",\n modifiedLabel: \"修改时间\",\n nameLabel: \"名称\",\n noSearchResults: \"没有匹配的文件\",\n openFailedTitle: \"打开失败\",\n openLabel: \"打开\",\n openInAppBrowserLabel: \"Tutti 内置的浏览器\",\n openInDefaultBrowserLabel: \"默认浏览器\",\n openInFileViewerLabel: \"文件查看器\",\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 resizeLocationsSidebar: \"调整位置侧栏宽度\",\n resizePreviewPanel: \"调整文件详情面板宽度\",\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(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B,+BAA+B;AAAA,EAC/B,8BAA8B;AAAA,EAC9B,oCAAoC;AAAA,EACpC,oCAAoC;AAAA,EACpC,2CAA2C;AAAA,EAC3C,+BAA+B;AAAA,EAC/B,qBAAqB;AAAA,EACrB,mBAAmB;AAAA,EACnB,aAAa;AAAA,EACb,+BACE;AAAA,EACF,yBAAyB;AAAA,EACzB,qBAAqB;AAAA,EACrB,4BAA4B;AAAA,EAC5B,qBAAqB;AAAA,EACrB,4BAA4B;AAC9B;AAOA,IAAM,+BAGF;AAAA,EACF,IAAI;AAAA,EACJ,SAAS;AACX;AAEO,IAAM,oCAGT;AAAA,EACF,IAAI;AAAA,IACF,CAAC,iCAAiC,GAAG,6BAA6B;AAAA,EACpE;AAAA,EACA,SAAS;AAAA,IACP,CAAC,iCAAiC,GAAG,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":[]}
|
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-C3AgiOLN.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-KKKQGRC5.js";
|
|
6
6
|
export {
|
|
7
7
|
createWorkspaceFileManagerI18nRuntime,
|
|
8
8
|
workspaceFileManagerI18nNamespace,
|
|
@@ -69,6 +69,8 @@ declare const workspaceFileManagerEn: {
|
|
|
69
69
|
readonly renameLabel: "Rename";
|
|
70
70
|
readonly renamePlaceholder: "New name";
|
|
71
71
|
readonly refreshLabel: "Refresh";
|
|
72
|
+
readonly resizeLocationsSidebar: "Resize locations sidebar";
|
|
73
|
+
readonly resizePreviewPanel: "Resize file details panel";
|
|
72
74
|
readonly retryLabel: "Retry";
|
|
73
75
|
readonly searchPlaceholder: "Search files";
|
|
74
76
|
readonly searchResultsLabel: "Search results";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { F as WorkspaceFileOpenWithApplication, c as WorkspaceFileEntry, j as WorkspaceFileLocation, D as WorkspaceFileManagerSession } from './workspaceFileManagerLocations-
|
|
2
|
-
export { C as CreateWorkspaceFileManagerSessionInput, W as WorkspaceFileActivationTarget, a as WorkspaceFileDirectoryListing, b as WorkspaceFileDirectoryLocation, d as WorkspaceFileEntryKind, e as WorkspaceFileExternalLocation, f as WorkspaceFileImportConflict, g as WorkspaceFileImportSummary, h as WorkspaceFileImportSummaryReason, i as WorkspaceFileImportSummaryReasonCount, k as WorkspaceFileLocationKind, l as WorkspaceFileLocationSection, m as WorkspaceFileManagerCapabilities, n as WorkspaceFileManagerFileActivationRequest, p as WorkspaceFileManagerHost, q as WorkspaceFileManagerHostActionMessage, r as WorkspaceFileManagerHostActionMessageStatus, s as WorkspaceFileManagerHostActionResult, t as WorkspaceFileManagerHostExportResult, u as WorkspaceFileManagerHostFallbackAction, v as WorkspaceFileManagerHostFallbackActionKind, w as WorkspaceFileManagerHostFileActivationResult, x as WorkspaceFileManagerHostImportConflict, y as WorkspaceFileManagerHostImportResult, z as WorkspaceFileManagerMutationErrorMessage, A as WorkspaceFileManagerPersistedState, B as WorkspaceFileManagerService, E as WorkspaceFileManagerState, G as WorkspaceFilePreviewKind, H as WorkspaceFilePreviewState, I as WorkspaceFileRecentLocation, J as WorkspaceFileSearchEntry, K as WorkspaceFileSearchResult, L as classifyWorkspaceFilePreviewKind, M as createWorkspaceFileManagerService, N as findWorkspaceFileLocationById, O as flattenWorkspaceFileLocations, P as isWorkspaceFileExternalLocation, Q as isWorkspaceFileRecentLocation, R as resolveWorkspaceFileActivationTarget, S as resolveWorkspaceFileLocationDefaultId } from './workspaceFileManagerLocations-
|
|
3
|
-
import { a as WorkspaceFileManagerI18nRuntime } from './index-
|
|
4
|
-
export { W as WorkspaceFileManagerI18nKey, c as createWorkspaceFileManagerI18nRuntime, r as resolveRevealInFolderLabel, w as workspaceFileManagerI18nNamespace, b as workspaceFileManagerI18nResources } from './index-
|
|
1
|
+
import { F as WorkspaceFileOpenWithApplication, c as WorkspaceFileEntry, j as WorkspaceFileLocation, D as WorkspaceFileManagerSession } from './workspaceFileManagerLocations-mW7kL37e.js';
|
|
2
|
+
export { C as CreateWorkspaceFileManagerSessionInput, W as WorkspaceFileActivationTarget, a as WorkspaceFileDirectoryListing, b as WorkspaceFileDirectoryLocation, d as WorkspaceFileEntryKind, e as WorkspaceFileExternalLocation, f as WorkspaceFileImportConflict, g as WorkspaceFileImportSummary, h as WorkspaceFileImportSummaryReason, i as WorkspaceFileImportSummaryReasonCount, k as WorkspaceFileLocationKind, l as WorkspaceFileLocationSection, m as WorkspaceFileManagerCapabilities, n as WorkspaceFileManagerFileActivationRequest, p as WorkspaceFileManagerHost, q as WorkspaceFileManagerHostActionMessage, r as WorkspaceFileManagerHostActionMessageStatus, s as WorkspaceFileManagerHostActionResult, t as WorkspaceFileManagerHostExportResult, u as WorkspaceFileManagerHostFallbackAction, v as WorkspaceFileManagerHostFallbackActionKind, w as WorkspaceFileManagerHostFileActivationResult, x as WorkspaceFileManagerHostImportConflict, y as WorkspaceFileManagerHostImportResult, z as WorkspaceFileManagerMutationErrorMessage, A as WorkspaceFileManagerPersistedState, B as WorkspaceFileManagerService, E as WorkspaceFileManagerState, G as WorkspaceFilePreviewKind, H as WorkspaceFilePreviewState, I as WorkspaceFileRecentLocation, J as WorkspaceFileSearchEntry, K as WorkspaceFileSearchResult, L as classifyWorkspaceFilePreviewKind, M as createWorkspaceFileManagerService, N as findWorkspaceFileLocationById, O as flattenWorkspaceFileLocations, P as isWorkspaceFileExternalLocation, Q as isWorkspaceFileRecentLocation, R as resolveWorkspaceFileActivationTarget, S as resolveWorkspaceFileLocationDefaultId } from './workspaceFileManagerLocations-mW7kL37e.js';
|
|
3
|
+
import { a as WorkspaceFileManagerI18nRuntime } from './index-C3AgiOLN.js';
|
|
4
|
+
export { W as WorkspaceFileManagerI18nKey, c as createWorkspaceFileManagerI18nRuntime, r as resolveRevealInFolderLabel, w as workspaceFileManagerI18nNamespace, b as workspaceFileManagerI18nResources } from './index-C3AgiOLN.js';
|
|
5
5
|
import { ReactElement, RefObject } from 'react';
|
|
6
6
|
import { TuttiDateLocale } from '@tutti-os/ui-system/date-format';
|
|
7
7
|
export { decodeWorkspaceTextFile, isWorkspaceTextFileTooLarge, looksLikeBinaryText, resolveWorkspaceFileExtension, resolveWorkspaceImageMimeType, resolveWorkspaceVideoMimeType, workspaceFilePreviewMaxBytes, workspaceFileTextMaxBytes } from '@tutti-os/workspace-file-preview';
|
|
@@ -26,9 +26,10 @@ interface WorkspaceFileManagerProps {
|
|
|
26
26
|
hostOs?: NodeJS.Platform;
|
|
27
27
|
i18n: WorkspaceFileManagerI18nRuntime;
|
|
28
28
|
session: WorkspaceFileManagerSession;
|
|
29
|
+
showPreviewPanel?: boolean;
|
|
29
30
|
surface?: "card" | "embedded";
|
|
30
31
|
}
|
|
31
|
-
declare function WorkspaceFileManager({ className, dateLocale, entryDragMode, i18n, onCopyEntry, onCopyPath, onDirectoryExpanded, onEntryDragStart, openInAppBrowserIcon, resolveOpenWithApplicationIcon, resolveEntryIconUrl, renderExternalLocationContent, hostOs, session, surface }: WorkspaceFileManagerProps): ReactElement;
|
|
32
|
+
declare function WorkspaceFileManager({ className, dateLocale, entryDragMode, i18n, onCopyEntry, onCopyPath, onDirectoryExpanded, onEntryDragStart, openInAppBrowserIcon, resolveOpenWithApplicationIcon, resolveEntryIconUrl, renderExternalLocationContent, hostOs, session, showPreviewPanel, surface }: WorkspaceFileManagerProps): ReactElement;
|
|
32
33
|
|
|
33
34
|
interface WorkspaceFileManagerContextMenuProps {
|
|
34
35
|
busy: boolean;
|
package/dist/index.js
CHANGED
|
@@ -39,10 +39,17 @@ import {
|
|
|
39
39
|
resolveRevealInFolderLabel,
|
|
40
40
|
workspaceFileManagerI18nNamespace,
|
|
41
41
|
workspaceFileManagerI18nResources
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-KKKQGRC5.js";
|
|
43
43
|
|
|
44
44
|
// src/ui/WorkspaceFileManager.tsx
|
|
45
|
-
import {
|
|
45
|
+
import {
|
|
46
|
+
useCallback as useCallback6,
|
|
47
|
+
useEffect as useEffect7,
|
|
48
|
+
useLayoutEffect as useLayoutEffect4,
|
|
49
|
+
useMemo as useMemo3,
|
|
50
|
+
useRef as useRef7,
|
|
51
|
+
useState as useState8
|
|
52
|
+
} from "react";
|
|
46
53
|
import { cn as cn7 } from "@tutti-os/ui-system";
|
|
47
54
|
|
|
48
55
|
// src/ui/WorkspaceFileManagerContextMenuContainer.tsx
|
|
@@ -1982,6 +1989,72 @@ function IconTileRenameInput({
|
|
|
1982
1989
|
] });
|
|
1983
1990
|
}
|
|
1984
1991
|
|
|
1992
|
+
// src/ui/workspaceFileManagerPaneSizing.ts
|
|
1993
|
+
var workspaceFileManagerSidebarDefaultWidth = 460;
|
|
1994
|
+
var workspaceFileManagerSidebarMinWidth = 180;
|
|
1995
|
+
var workspaceFileManagerContentMinWidth = 580;
|
|
1996
|
+
var workspaceFileManagerPaneResizeStep = 24;
|
|
1997
|
+
var workspaceFileManagerPreviewDefaultWidth = 348;
|
|
1998
|
+
var workspaceFileManagerSidebarWidthStorageKey = "tutti.workspace-file-manager.sidebar-width";
|
|
1999
|
+
var workspaceFileManagerPreviewWidthStorageKey = "tutti.workspace-file-manager.preview-width";
|
|
2000
|
+
function readWorkspaceFileManagerSidebarWidth() {
|
|
2001
|
+
return readWorkspaceFileManagerPaneWidth(
|
|
2002
|
+
workspaceFileManagerSidebarWidthStorageKey,
|
|
2003
|
+
workspaceFileManagerSidebarDefaultWidth
|
|
2004
|
+
);
|
|
2005
|
+
}
|
|
2006
|
+
function writeWorkspaceFileManagerSidebarWidth(width) {
|
|
2007
|
+
writeWorkspaceFileManagerPaneWidth(
|
|
2008
|
+
workspaceFileManagerSidebarWidthStorageKey,
|
|
2009
|
+
width
|
|
2010
|
+
);
|
|
2011
|
+
}
|
|
2012
|
+
function readWorkspaceFileManagerPreviewWidth() {
|
|
2013
|
+
return readWorkspaceFileManagerPaneWidth(
|
|
2014
|
+
workspaceFileManagerPreviewWidthStorageKey,
|
|
2015
|
+
workspaceFileManagerPreviewDefaultWidth
|
|
2016
|
+
);
|
|
2017
|
+
}
|
|
2018
|
+
function writeWorkspaceFileManagerPreviewWidth(width) {
|
|
2019
|
+
writeWorkspaceFileManagerPaneWidth(
|
|
2020
|
+
workspaceFileManagerPreviewWidthStorageKey,
|
|
2021
|
+
width
|
|
2022
|
+
);
|
|
2023
|
+
}
|
|
2024
|
+
function clampWorkspaceFileManagerSidebarWidth(input) {
|
|
2025
|
+
const containerWidth = Number.isFinite(input.containerWidth) ? input.containerWidth : workspaceFileManagerSidebarMinWidth + workspaceFileManagerContentMinWidth;
|
|
2026
|
+
const maxWidth = Math.max(
|
|
2027
|
+
workspaceFileManagerSidebarMinWidth,
|
|
2028
|
+
containerWidth - workspaceFileManagerContentMinWidth
|
|
2029
|
+
);
|
|
2030
|
+
const width = Number.isFinite(input.width) ? input.width : workspaceFileManagerSidebarDefaultWidth;
|
|
2031
|
+
return Math.round(
|
|
2032
|
+
Math.min(maxWidth, Math.max(workspaceFileManagerSidebarMinWidth, width))
|
|
2033
|
+
);
|
|
2034
|
+
}
|
|
2035
|
+
function resolveWorkspaceFileManagerSidebarMaxWidth(containerWidth) {
|
|
2036
|
+
const resolvedContainerWidth = Number.isFinite(containerWidth) ? containerWidth : workspaceFileManagerSidebarMinWidth + workspaceFileManagerContentMinWidth;
|
|
2037
|
+
return Math.round(
|
|
2038
|
+
Math.max(
|
|
2039
|
+
workspaceFileManagerSidebarMinWidth,
|
|
2040
|
+
resolvedContainerWidth - workspaceFileManagerContentMinWidth
|
|
2041
|
+
)
|
|
2042
|
+
);
|
|
2043
|
+
}
|
|
2044
|
+
function readWorkspaceFileManagerPaneWidth(storageKey, defaultWidth) {
|
|
2045
|
+
if (typeof window === "undefined") {
|
|
2046
|
+
return defaultWidth;
|
|
2047
|
+
}
|
|
2048
|
+
const storedWidth = Number(window.localStorage.getItem(storageKey));
|
|
2049
|
+
return Number.isFinite(storedWidth) && storedWidth > 0 ? storedWidth : defaultWidth;
|
|
2050
|
+
}
|
|
2051
|
+
function writeWorkspaceFileManagerPaneWidth(storageKey, width) {
|
|
2052
|
+
if (typeof window === "undefined" || !Number.isFinite(width) || width <= 0) {
|
|
2053
|
+
return;
|
|
2054
|
+
}
|
|
2055
|
+
window.localStorage.setItem(storageKey, String(width));
|
|
2056
|
+
}
|
|
2057
|
+
|
|
1985
2058
|
// src/ui/WorkspaceFileManagerPanels.tsx
|
|
1986
2059
|
import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1987
2060
|
var workspaceFileManagerTableGridClassName = "grid-cols-[minmax(0,_1fr)_148px_96px]";
|
|
@@ -1996,7 +2069,6 @@ var workspaceFileManagerPreviewDetailGridStyle = {
|
|
|
1996
2069
|
gridTemplateColumns: "minmax(82px, 0.8fr) minmax(0, 1.2fr)"
|
|
1997
2070
|
};
|
|
1998
2071
|
var workspaceFileManagerStackedBreakpoint = 600;
|
|
1999
|
-
var workspaceFileManagerPreviewDefaultWidth = 280;
|
|
2000
2072
|
var workspaceFileManagerPreviewMinWidth = 220;
|
|
2001
2073
|
var workspaceFileManagerTableMinWidth = 360;
|
|
2002
2074
|
var workspaceFileManagerMoveDragThreshold = 4;
|
|
@@ -2024,6 +2096,7 @@ function WorkspaceFileManagerPanels({
|
|
|
2024
2096
|
onEntryIconViewportEnter,
|
|
2025
2097
|
selectedEntry,
|
|
2026
2098
|
selectedPath,
|
|
2099
|
+
showPreviewPanel: showPreviewPanelEnabled = true,
|
|
2027
2100
|
state,
|
|
2028
2101
|
showDropOverlay,
|
|
2029
2102
|
treeRows,
|
|
@@ -2043,6 +2116,9 @@ function WorkspaceFileManagerPanels({
|
|
|
2043
2116
|
);
|
|
2044
2117
|
const previewResizeRef = useRef5(null);
|
|
2045
2118
|
const [previewPaneWidth, setPreviewPaneWidth] = useState3(
|
|
2119
|
+
readWorkspaceFileManagerPreviewWidth
|
|
2120
|
+
);
|
|
2121
|
+
const [previewPaneMaxWidth, setPreviewPaneMaxWidth] = useState3(
|
|
2046
2122
|
workspaceFileManagerPreviewDefaultWidth
|
|
2047
2123
|
);
|
|
2048
2124
|
const [moveDragPreview, setMoveDragPreview] = useState3(null);
|
|
@@ -2250,7 +2326,7 @@ function WorkspaceFileManagerPanels({
|
|
|
2250
2326
|
stopMoveDragAutoScroll,
|
|
2251
2327
|
updateMoveDragAutoScroll
|
|
2252
2328
|
]);
|
|
2253
|
-
const showPreviewPanel = layoutMode === "list";
|
|
2329
|
+
const showPreviewPanel = showPreviewPanelEnabled && layoutMode === "list";
|
|
2254
2330
|
const useStackedPreview = false;
|
|
2255
2331
|
const previewPaneClassName = useStackedPreview ? "min-w-0 border-t border-[var(--border-1)]" : "min-w-[220px] border-l border-[var(--border-1)]";
|
|
2256
2332
|
const tableGridClassName = useStackedPreview ? workspaceFileManagerCompactTableGridClassName : workspaceFileManagerTableGridClassName;
|
|
@@ -2266,17 +2342,21 @@ function WorkspaceFileManagerPanels({
|
|
|
2266
2342
|
},
|
|
2267
2343
|
[]
|
|
2268
2344
|
);
|
|
2345
|
+
const resolvePreviewPaneMaxWidth = useCallback2(() => {
|
|
2346
|
+
const containerWidth = rootRef.current?.getBoundingClientRect().width ?? workspaceFileManagerTableMinWidth + workspaceFileManagerPreviewMinWidth;
|
|
2347
|
+
return Math.max(
|
|
2348
|
+
workspaceFileManagerPreviewMinWidth,
|
|
2349
|
+
containerWidth - workspaceFileManagerTableMinWidth
|
|
2350
|
+
);
|
|
2351
|
+
}, [rootRef]);
|
|
2269
2352
|
useLayoutEffect3(() => {
|
|
2270
2353
|
const element = rootRef.current;
|
|
2271
2354
|
if (!element || useStackedPreview || !showPreviewPanel) {
|
|
2272
2355
|
return;
|
|
2273
2356
|
}
|
|
2274
2357
|
const publishLayout = () => {
|
|
2275
|
-
const
|
|
2276
|
-
|
|
2277
|
-
workspaceFileManagerPreviewMinWidth,
|
|
2278
|
-
containerWidth - workspaceFileManagerTableMinWidth
|
|
2279
|
-
);
|
|
2358
|
+
const maxWidth = resolvePreviewPaneMaxWidth();
|
|
2359
|
+
setPreviewPaneMaxWidth(maxWidth);
|
|
2280
2360
|
setPreviewPaneWidth(
|
|
2281
2361
|
(currentWidth) => clampPreviewPaneWidth(currentWidth, maxWidth)
|
|
2282
2362
|
);
|
|
@@ -2293,28 +2373,31 @@ function WorkspaceFileManagerPanels({
|
|
|
2293
2373
|
return () => {
|
|
2294
2374
|
observer.disconnect();
|
|
2295
2375
|
};
|
|
2296
|
-
}, [
|
|
2376
|
+
}, [
|
|
2377
|
+
clampPreviewPaneWidth,
|
|
2378
|
+
resolvePreviewPaneMaxWidth,
|
|
2379
|
+
rootRef,
|
|
2380
|
+
showPreviewPanel,
|
|
2381
|
+
useStackedPreview
|
|
2382
|
+
]);
|
|
2297
2383
|
const handlePreviewResizePointerDown = useCallback2(
|
|
2298
2384
|
(event) => {
|
|
2299
2385
|
if (event.button !== 0) {
|
|
2300
2386
|
return;
|
|
2301
2387
|
}
|
|
2302
|
-
const
|
|
2303
|
-
const maxWidth = Math.max(
|
|
2304
|
-
workspaceFileManagerPreviewMinWidth,
|
|
2305
|
-
containerWidth - workspaceFileManagerTableMinWidth
|
|
2306
|
-
);
|
|
2388
|
+
const maxWidth = resolvePreviewPaneMaxWidth();
|
|
2307
2389
|
event.preventDefault();
|
|
2308
2390
|
event.stopPropagation();
|
|
2309
2391
|
event.currentTarget.setPointerCapture(event.pointerId);
|
|
2310
2392
|
previewResizeRef.current = {
|
|
2393
|
+
currentWidth: previewPaneWidth,
|
|
2311
2394
|
pointerId: event.pointerId,
|
|
2312
2395
|
startX: event.clientX,
|
|
2313
2396
|
startWidth: previewPaneWidth,
|
|
2314
2397
|
maxWidth
|
|
2315
2398
|
};
|
|
2316
2399
|
},
|
|
2317
|
-
[previewPaneWidth,
|
|
2400
|
+
[previewPaneWidth, resolvePreviewPaneMaxWidth]
|
|
2318
2401
|
);
|
|
2319
2402
|
const handlePreviewResizePointerMove = useCallback2(
|
|
2320
2403
|
(event) => {
|
|
@@ -2323,9 +2406,11 @@ function WorkspaceFileManagerPanels({
|
|
|
2323
2406
|
return;
|
|
2324
2407
|
}
|
|
2325
2408
|
const deltaX = event.clientX - resize.startX;
|
|
2326
|
-
|
|
2327
|
-
|
|
2409
|
+
resize.currentWidth = clampPreviewPaneWidth(
|
|
2410
|
+
resize.startWidth - deltaX,
|
|
2411
|
+
resize.maxWidth
|
|
2328
2412
|
);
|
|
2413
|
+
setPreviewPaneWidth(resize.currentWidth);
|
|
2329
2414
|
},
|
|
2330
2415
|
[clampPreviewPaneWidth]
|
|
2331
2416
|
);
|
|
@@ -2336,10 +2421,34 @@ function WorkspaceFileManagerPanels({
|
|
|
2336
2421
|
return;
|
|
2337
2422
|
}
|
|
2338
2423
|
previewResizeRef.current = null;
|
|
2424
|
+
writeWorkspaceFileManagerPreviewWidth(resize.currentWidth);
|
|
2339
2425
|
event.currentTarget.releasePointerCapture(event.pointerId);
|
|
2340
2426
|
},
|
|
2341
2427
|
[]
|
|
2342
2428
|
);
|
|
2429
|
+
const handlePreviewResizeKeyDown = useCallback2(
|
|
2430
|
+
(event) => {
|
|
2431
|
+
let nextWidth = null;
|
|
2432
|
+
if (event.key === "Home") {
|
|
2433
|
+
event.preventDefault();
|
|
2434
|
+
nextWidth = workspaceFileManagerPreviewMinWidth;
|
|
2435
|
+
} else if (event.key === "End") {
|
|
2436
|
+
event.preventDefault();
|
|
2437
|
+
nextWidth = previewPaneMaxWidth;
|
|
2438
|
+
} else if (event.key === "ArrowLeft" || event.key === "ArrowRight") {
|
|
2439
|
+
event.preventDefault();
|
|
2440
|
+
nextWidth = clampPreviewPaneWidth(
|
|
2441
|
+
previewPaneWidth + (event.key === "ArrowLeft" ? workspaceFileManagerPaneResizeStep : -workspaceFileManagerPaneResizeStep),
|
|
2442
|
+
previewPaneMaxWidth
|
|
2443
|
+
);
|
|
2444
|
+
}
|
|
2445
|
+
if (nextWidth !== null) {
|
|
2446
|
+
setPreviewPaneWidth(nextWidth);
|
|
2447
|
+
writeWorkspaceFileManagerPreviewWidth(nextWidth);
|
|
2448
|
+
}
|
|
2449
|
+
},
|
|
2450
|
+
[clampPreviewPaneWidth, previewPaneMaxWidth, previewPaneWidth]
|
|
2451
|
+
);
|
|
2343
2452
|
const tablePanel = /* @__PURE__ */ jsx6(
|
|
2344
2453
|
"div",
|
|
2345
2454
|
{
|
|
@@ -2504,16 +2613,22 @@ function WorkspaceFileManagerPanels({
|
|
|
2504
2613
|
showPreviewPanel && !useStackedPreview ? /* @__PURE__ */ jsx6(
|
|
2505
2614
|
"div",
|
|
2506
2615
|
{
|
|
2616
|
+
"aria-label": copy.t("resizePreviewPanel"),
|
|
2507
2617
|
"aria-orientation": "vertical",
|
|
2618
|
+
"aria-valuemax": previewPaneMaxWidth,
|
|
2619
|
+
"aria-valuemin": workspaceFileManagerPreviewMinWidth,
|
|
2620
|
+
"aria-valuenow": previewPaneWidth,
|
|
2508
2621
|
className: "nodrag absolute top-0 bottom-0 z-[1] w-2 cursor-col-resize touch-none",
|
|
2509
2622
|
role: "separator",
|
|
2623
|
+
tabIndex: 0,
|
|
2510
2624
|
style: {
|
|
2511
2625
|
right: previewPaneWidth - 4
|
|
2512
2626
|
},
|
|
2513
2627
|
onPointerCancel: handlePreviewResizePointerEnd,
|
|
2514
2628
|
onPointerDown: handlePreviewResizePointerDown,
|
|
2515
2629
|
onPointerMove: handlePreviewResizePointerMove,
|
|
2516
|
-
onPointerUp: handlePreviewResizePointerEnd
|
|
2630
|
+
onPointerUp: handlePreviewResizePointerEnd,
|
|
2631
|
+
onKeyDown: handlePreviewResizeKeyDown
|
|
2517
2632
|
}
|
|
2518
2633
|
) : null,
|
|
2519
2634
|
previewPanel
|
|
@@ -3634,6 +3749,7 @@ function WorkspaceFileManagerSidebar({
|
|
|
3634
3749
|
disabled,
|
|
3635
3750
|
locationSections,
|
|
3636
3751
|
selectedLocationId,
|
|
3752
|
+
width,
|
|
3637
3753
|
onSelectLocation
|
|
3638
3754
|
}) {
|
|
3639
3755
|
const visibleSections = locationSections.filter(
|
|
@@ -3642,19 +3758,26 @@ function WorkspaceFileManagerSidebar({
|
|
|
3642
3758
|
if (visibleSections.length === 0) {
|
|
3643
3759
|
return null;
|
|
3644
3760
|
}
|
|
3645
|
-
return /* @__PURE__ */ jsx8(
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
{
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
location
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3761
|
+
return /* @__PURE__ */ jsx8(
|
|
3762
|
+
"aside",
|
|
3763
|
+
{
|
|
3764
|
+
className: "@max-[600px]/workspace-file-manager:hidden flex shrink-0 flex-col border-r border-[var(--border-1)] bg-[var(--background-panel)]",
|
|
3765
|
+
style: { minWidth: width, width },
|
|
3766
|
+
children: /* @__PURE__ */ jsx8(ScrollArea2, { className: "min-h-0 flex-1", children: /* @__PURE__ */ jsx8(TooltipProvider2, { delayDuration: 350, children: /* @__PURE__ */ jsx8("div", { className: "flex flex-col gap-3 px-2 py-3", children: visibleSections.map((section) => /* @__PURE__ */ jsxs7("section", { className: "min-w-0", children: [
|
|
3767
|
+
/* @__PURE__ */ jsx8("h2", { className: "mb-1 px-2 text-[11px] font-medium uppercase tracking-normal text-[var(--text-tertiary)]", children: section.label }),
|
|
3768
|
+
/* @__PURE__ */ jsx8("div", { className: "flex flex-col gap-0.5", children: section.locations.map((location) => /* @__PURE__ */ jsx8(
|
|
3769
|
+
WorkspaceFileManagerSidebarLocation,
|
|
3770
|
+
{
|
|
3771
|
+
active: location.id === selectedLocationId,
|
|
3772
|
+
disabled,
|
|
3773
|
+
location,
|
|
3774
|
+
onSelectLocation
|
|
3775
|
+
},
|
|
3776
|
+
location.id
|
|
3777
|
+
)) })
|
|
3778
|
+
] }, section.id)) }) }) })
|
|
3779
|
+
}
|
|
3780
|
+
);
|
|
3658
3781
|
}
|
|
3659
3782
|
function WorkspaceFileManagerSidebarLocation({
|
|
3660
3783
|
active,
|
|
@@ -4083,9 +4206,15 @@ function WorkspaceFileManager({
|
|
|
4083
4206
|
renderExternalLocationContent,
|
|
4084
4207
|
hostOs = "linux",
|
|
4085
4208
|
session,
|
|
4209
|
+
showPreviewPanel = true,
|
|
4086
4210
|
surface = "card"
|
|
4087
4211
|
}) {
|
|
4088
4212
|
const rootRef = useRef7(null);
|
|
4213
|
+
const sidebarResizeRef = useRef7(null);
|
|
4214
|
+
const [sidebarWidth, setSidebarWidth] = useState8(
|
|
4215
|
+
readWorkspaceFileManagerSidebarWidth
|
|
4216
|
+
);
|
|
4217
|
+
const [containerWidth, setContainerWidth] = useState8(0);
|
|
4089
4218
|
const { arrangeMode, setArrangeMode } = useWorkspaceFileManagerArrangeMode();
|
|
4090
4219
|
const { layoutMode, setLayoutMode } = useWorkspaceFileManagerLayoutMode();
|
|
4091
4220
|
const rootView = useWorkspaceFileManagerRootView(session);
|
|
@@ -4097,6 +4226,109 @@ function WorkspaceFileManager({
|
|
|
4097
4226
|
);
|
|
4098
4227
|
return location?.kind === "external" ? location : null;
|
|
4099
4228
|
}, [rootView.locationSections, rootView.selectedLocationId]);
|
|
4229
|
+
const hasLocationSidebar = rootView.locationSections.some(
|
|
4230
|
+
(section) => section.locations.length > 0
|
|
4231
|
+
);
|
|
4232
|
+
const sidebarMaxWidth = containerWidth > 0 ? resolveWorkspaceFileManagerSidebarMaxWidth(containerWidth) : workspaceFileManagerSidebarDefaultWidth;
|
|
4233
|
+
const updateSidebarWidth = useCallback6((width) => {
|
|
4234
|
+
const nextWidth = clampWorkspaceFileManagerSidebarWidth({
|
|
4235
|
+
containerWidth: rootRef.current?.getBoundingClientRect().width ?? 0,
|
|
4236
|
+
width
|
|
4237
|
+
});
|
|
4238
|
+
setSidebarWidth(nextWidth);
|
|
4239
|
+
return nextWidth;
|
|
4240
|
+
}, []);
|
|
4241
|
+
useLayoutEffect4(() => {
|
|
4242
|
+
const element = rootRef.current;
|
|
4243
|
+
if (!element || !hasLocationSidebar) {
|
|
4244
|
+
return;
|
|
4245
|
+
}
|
|
4246
|
+
const publishLayout = () => {
|
|
4247
|
+
const nextContainerWidth = Math.round(
|
|
4248
|
+
element.getBoundingClientRect().width
|
|
4249
|
+
);
|
|
4250
|
+
setContainerWidth(nextContainerWidth);
|
|
4251
|
+
setSidebarWidth(
|
|
4252
|
+
(currentWidth) => clampWorkspaceFileManagerSidebarWidth({
|
|
4253
|
+
containerWidth: nextContainerWidth,
|
|
4254
|
+
width: currentWidth
|
|
4255
|
+
})
|
|
4256
|
+
);
|
|
4257
|
+
};
|
|
4258
|
+
publishLayout();
|
|
4259
|
+
if (typeof ResizeObserver === "undefined") {
|
|
4260
|
+
window.addEventListener("resize", publishLayout);
|
|
4261
|
+
return () => {
|
|
4262
|
+
window.removeEventListener("resize", publishLayout);
|
|
4263
|
+
};
|
|
4264
|
+
}
|
|
4265
|
+
const observer = new ResizeObserver(publishLayout);
|
|
4266
|
+
observer.observe(element);
|
|
4267
|
+
return () => {
|
|
4268
|
+
observer.disconnect();
|
|
4269
|
+
};
|
|
4270
|
+
}, [hasLocationSidebar]);
|
|
4271
|
+
const handleSidebarResizePointerDown = useCallback6(
|
|
4272
|
+
(event) => {
|
|
4273
|
+
if (event.button !== 0) {
|
|
4274
|
+
return;
|
|
4275
|
+
}
|
|
4276
|
+
event.preventDefault();
|
|
4277
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
4278
|
+
sidebarResizeRef.current = {
|
|
4279
|
+
currentWidth: sidebarWidth,
|
|
4280
|
+
pointerId: event.pointerId,
|
|
4281
|
+
startWidth: sidebarWidth,
|
|
4282
|
+
startX: event.clientX
|
|
4283
|
+
};
|
|
4284
|
+
},
|
|
4285
|
+
[sidebarWidth]
|
|
4286
|
+
);
|
|
4287
|
+
const handleSidebarResizePointerMove = useCallback6(
|
|
4288
|
+
(event) => {
|
|
4289
|
+
const resize = sidebarResizeRef.current;
|
|
4290
|
+
if (!resize || resize.pointerId !== event.pointerId) {
|
|
4291
|
+
return;
|
|
4292
|
+
}
|
|
4293
|
+
resize.currentWidth = updateSidebarWidth(
|
|
4294
|
+
resize.startWidth + event.clientX - resize.startX
|
|
4295
|
+
);
|
|
4296
|
+
},
|
|
4297
|
+
[updateSidebarWidth]
|
|
4298
|
+
);
|
|
4299
|
+
const handleSidebarResizePointerEnd = useCallback6(
|
|
4300
|
+
(event) => {
|
|
4301
|
+
const resize = sidebarResizeRef.current;
|
|
4302
|
+
if (!resize || resize.pointerId !== event.pointerId) {
|
|
4303
|
+
return;
|
|
4304
|
+
}
|
|
4305
|
+
sidebarResizeRef.current = null;
|
|
4306
|
+
writeWorkspaceFileManagerSidebarWidth(resize.currentWidth);
|
|
4307
|
+
event.currentTarget.releasePointerCapture(event.pointerId);
|
|
4308
|
+
},
|
|
4309
|
+
[]
|
|
4310
|
+
);
|
|
4311
|
+
const handleSidebarResizeKeyDown = useCallback6(
|
|
4312
|
+
(event) => {
|
|
4313
|
+
let nextWidth = null;
|
|
4314
|
+
if (event.key === "Home") {
|
|
4315
|
+
event.preventDefault();
|
|
4316
|
+
nextWidth = updateSidebarWidth(workspaceFileManagerSidebarMinWidth);
|
|
4317
|
+
} else if (event.key === "End") {
|
|
4318
|
+
event.preventDefault();
|
|
4319
|
+
nextWidth = updateSidebarWidth(sidebarMaxWidth);
|
|
4320
|
+
} else if (event.key === "ArrowLeft" || event.key === "ArrowRight") {
|
|
4321
|
+
event.preventDefault();
|
|
4322
|
+
nextWidth = updateSidebarWidth(
|
|
4323
|
+
sidebarWidth + (event.key === "ArrowLeft" ? -workspaceFileManagerPaneResizeStep : workspaceFileManagerPaneResizeStep)
|
|
4324
|
+
);
|
|
4325
|
+
}
|
|
4326
|
+
if (nextWidth !== null) {
|
|
4327
|
+
writeWorkspaceFileManagerSidebarWidth(nextWidth);
|
|
4328
|
+
}
|
|
4329
|
+
},
|
|
4330
|
+
[sidebarMaxWidth, sidebarWidth, updateSidebarWidth]
|
|
4331
|
+
);
|
|
4100
4332
|
useEffect7(() => {
|
|
4101
4333
|
function handleCopyShortcut(event) {
|
|
4102
4334
|
if (!(event.metaKey || event.ctrlKey) || event.key !== "c" || event.shiftKey) {
|
|
@@ -4274,6 +4506,7 @@ function WorkspaceFileManager({
|
|
|
4274
4506
|
disabled: rootView.isBusy || panelsState.isLoading,
|
|
4275
4507
|
locationSections: rootView.locationSections,
|
|
4276
4508
|
selectedLocationId: rootView.selectedLocationId,
|
|
4509
|
+
width: sidebarWidth,
|
|
4277
4510
|
onSelectLocation: (location) => {
|
|
4278
4511
|
if (location.kind === "directory") {
|
|
4279
4512
|
onDirectoryExpanded?.(location.path);
|
|
@@ -4282,6 +4515,24 @@ function WorkspaceFileManager({
|
|
|
4282
4515
|
}
|
|
4283
4516
|
}
|
|
4284
4517
|
),
|
|
4518
|
+
hasLocationSidebar ? /* @__PURE__ */ jsx9(
|
|
4519
|
+
"div",
|
|
4520
|
+
{
|
|
4521
|
+
"aria-label": i18n.t("resizeLocationsSidebar"),
|
|
4522
|
+
"aria-orientation": "vertical",
|
|
4523
|
+
"aria-valuemax": sidebarMaxWidth,
|
|
4524
|
+
"aria-valuemin": workspaceFileManagerSidebarMinWidth,
|
|
4525
|
+
"aria-valuenow": sidebarWidth,
|
|
4526
|
+
className: "nodrag @max-[600px]/workspace-file-manager:hidden relative z-[1] -ml-1 -mr-1 h-full w-2 shrink-0 cursor-col-resize touch-none outline-none before:absolute before:left-1/2 before:h-full before:w-px before:-translate-x-1/2 before:bg-transparent hover:before:bg-[var(--border-focus)] focus-visible:before:bg-[var(--border-focus)]",
|
|
4527
|
+
role: "separator",
|
|
4528
|
+
tabIndex: 0,
|
|
4529
|
+
onKeyDown: handleSidebarResizeKeyDown,
|
|
4530
|
+
onPointerCancel: handleSidebarResizePointerEnd,
|
|
4531
|
+
onPointerDown: handleSidebarResizePointerDown,
|
|
4532
|
+
onPointerMove: handleSidebarResizePointerMove,
|
|
4533
|
+
onPointerUp: handleSidebarResizePointerEnd
|
|
4534
|
+
}
|
|
4535
|
+
) : null,
|
|
4285
4536
|
/* @__PURE__ */ jsx9("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden", children: selectedExternalLocation ? renderExternalLocationContent?.(selectedExternalLocation) ?? null : /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
4286
4537
|
/* @__PURE__ */ jsx9(
|
|
4287
4538
|
WorkspaceFileManagerToolbarContainer,
|
|
@@ -4314,7 +4565,8 @@ function WorkspaceFileManager({
|
|
|
4314
4565
|
onEntryDragStart,
|
|
4315
4566
|
onOpenContextMenu: openContextMenu,
|
|
4316
4567
|
resolveEntryIconUrl,
|
|
4317
|
-
session
|
|
4568
|
+
session,
|
|
4569
|
+
showPreviewPanel
|
|
4318
4570
|
}
|
|
4319
4571
|
)
|
|
4320
4572
|
}
|
|
@@ -4431,7 +4683,8 @@ function WorkspaceFileManagerPanelsContainer({
|
|
|
4431
4683
|
onEntryDragStart,
|
|
4432
4684
|
onOpenContextMenu,
|
|
4433
4685
|
resolveEntryIconUrl,
|
|
4434
|
-
session
|
|
4686
|
+
session,
|
|
4687
|
+
showPreviewPanel
|
|
4435
4688
|
}) {
|
|
4436
4689
|
const { state, view } = useWorkspaceFileManagerPanelsView(session);
|
|
4437
4690
|
const arrangedEntries = useMemo3(
|
|
@@ -4511,6 +4764,7 @@ function WorkspaceFileManagerPanelsContainer({
|
|
|
4511
4764
|
onEntryIconViewportLeave: reportEntryIconViewportLeave,
|
|
4512
4765
|
selectedEntry: view.selectedEntry,
|
|
4513
4766
|
selectedPath: view.selectedPath,
|
|
4767
|
+
showPreviewPanel,
|
|
4514
4768
|
showDropOverlay: view.showDropOverlay,
|
|
4515
4769
|
state: {
|
|
4516
4770
|
entries: displayedEntries,
|