@burdenoff/microfe-files 2026.525.2 → 2026.527.1
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/files/components/ActionMenu.js +3 -1
- package/dist/files/components/ActionMenu.js.map +1 -1
- package/dist/files/components/ContextMenu.js +16 -112
- package/dist/files/components/ContextMenu.js.map +1 -1
- package/dist/files/components/CopyDialog.js +8 -0
- package/dist/files/components/CopyDialog.js.map +1 -1
- package/dist/files/components/EmptyState.js +2 -0
- package/dist/files/components/EmptyState.js.map +1 -1
- package/dist/files/components/FileBrowser.js +6 -1
- package/dist/files/components/FileBrowser.js.map +1 -1
- package/dist/files/components/FileCard.js +4 -0
- package/dist/files/components/FileCard.js.map +1 -1
- package/dist/files/components/FileInfoPanel.js +2 -0
- package/dist/files/components/FileInfoPanel.js.map +1 -1
- package/dist/files/components/FileListItem.js +6 -0
- package/dist/files/components/FileListItem.js.map +1 -1
- package/dist/files/components/FilePreviewModal.js +9 -3
- package/dist/files/components/FilePreviewModal.js.map +1 -1
- package/dist/files/components/FileVersionPanel.js +5 -0
- package/dist/files/components/FileVersionPanel.js.map +1 -1
- package/dist/files/components/FolderCard.js +3 -0
- package/dist/files/components/FolderCard.js.map +1 -1
- package/dist/files/components/MoveDialog.js +8 -0
- package/dist/files/components/MoveDialog.js.map +1 -1
- package/dist/files/components/SearchBar.js +4 -0
- package/dist/files/components/SearchBar.js.map +1 -1
- package/dist/files/components/ShareDialog.js +109 -104
- package/dist/files/components/ShareDialog.js.map +1 -1
- package/dist/files/components/TabBar.js +1 -0
- package/dist/files/components/TabBar.js.map +1 -1
- package/dist/files/components/Toast.js +1 -0
- package/dist/files/components/Toast.js.map +1 -1
- package/dist/files/components/UploadQueue.js +5 -0
- package/dist/files/components/UploadQueue.js.map +1 -1
- package/dist/files/components/contextMenuItems.js +103 -0
- package/dist/files/components/contextMenuItems.js.map +1 -0
- package/dist/files/components/viewers/AudioPlayer.js +4 -1
- package/dist/files/components/viewers/AudioPlayer.js.map +1 -1
- package/dist/files/components/viewers/CodeViewer.js +2 -0
- package/dist/files/components/viewers/CodeViewer.js.map +1 -1
- package/dist/files/components/viewers/ImageViewer.js +4 -0
- package/dist/files/components/viewers/ImageViewer.js.map +1 -1
- package/dist/files/components/viewers/PDFViewer.js +2 -0
- package/dist/files/components/viewers/PDFViewer.js.map +1 -1
- package/dist/files/components/viewers/TextViewer.js +4 -2
- package/dist/files/components/viewers/TextViewer.js.map +1 -1
- package/dist/files/components/viewers/VideoPlayer.js +5 -1
- package/dist/files/components/viewers/VideoPlayer.js.map +1 -1
- package/dist/files/hooks/useBatchOperations.js.map +1 -1
- package/dist/files/hooks/useFileVersions.js.map +1 -1
- package/dist/files/pages/BrowserPage.js +18 -2
- package/dist/files/pages/BrowserPage.js.map +1 -1
- package/dist/files/pages/ShareAccessPage.js +6 -5
- package/dist/files/pages/ShareAccessPage.js.map +1 -1
- package/dist/files/utils/index.js +1 -1
- package/dist/files/utils/index.js.map +1 -1
- package/dist/files/utils/thumbnail.js.map +1 -1
- package/dist/files.js +2 -1
- package/dist/translations/en.js +259 -0
- package/dist/translations/en.js.map +1 -0
- package/package.json +1 -4
- package/dist/config/index.d.ts +0 -33
- package/dist/config/index.d.ts.map +0 -1
- package/dist/dev/main.d.ts +0 -1
- package/dist/dev/main.d.ts.map +0 -1
- package/dist/files/FilesRoot.d.ts +0 -31
- package/dist/files/FilesRoot.d.ts.map +0 -1
- package/dist/files/FilesRoutes.d.ts +0 -12
- package/dist/files/FilesRoutes.d.ts.map +0 -1
- package/dist/files/components/ActionMenu.d.ts +0 -19
- package/dist/files/components/ActionMenu.d.ts.map +0 -1
- package/dist/files/components/ConfirmDialog.d.ts +0 -14
- package/dist/files/components/ConfirmDialog.d.ts.map +0 -1
- package/dist/files/components/ContextMenu.d.ts +0 -59
- package/dist/files/components/ContextMenu.d.ts.map +0 -1
- package/dist/files/components/CopyDialog.d.ts +0 -12
- package/dist/files/components/CopyDialog.d.ts.map +0 -1
- package/dist/files/components/EmptyState.d.ts +0 -8
- package/dist/files/components/EmptyState.d.ts.map +0 -1
- package/dist/files/components/FileBrowser.d.ts +0 -37
- package/dist/files/components/FileBrowser.d.ts.map +0 -1
- package/dist/files/components/FileCard.d.ts +0 -30
- package/dist/files/components/FileCard.d.ts.map +0 -1
- package/dist/files/components/FileInfoPanel.d.ts +0 -9
- package/dist/files/components/FileInfoPanel.d.ts.map +0 -1
- package/dist/files/components/FileListItem.d.ts +0 -29
- package/dist/files/components/FileListItem.d.ts.map +0 -1
- package/dist/files/components/FilePreviewModal.d.ts +0 -17
- package/dist/files/components/FilePreviewModal.d.ts.map +0 -1
- package/dist/files/components/FileVersionPanel.d.ts +0 -9
- package/dist/files/components/FileVersionPanel.d.ts.map +0 -1
- package/dist/files/components/FolderCard.d.ts +0 -34
- package/dist/files/components/FolderCard.d.ts.map +0 -1
- package/dist/files/components/MoveDialog.d.ts +0 -12
- package/dist/files/components/MoveDialog.d.ts.map +0 -1
- package/dist/files/components/SearchBar.d.ts +0 -13
- package/dist/files/components/SearchBar.d.ts.map +0 -1
- package/dist/files/components/ShareDialog.d.ts +0 -24
- package/dist/files/components/ShareDialog.d.ts.map +0 -1
- package/dist/files/components/TabBar.d.ts +0 -14
- package/dist/files/components/TabBar.d.ts.map +0 -1
- package/dist/files/components/Toast.d.ts +0 -14
- package/dist/files/components/Toast.d.ts.map +0 -1
- package/dist/files/components/UploadQueue.d.ts +0 -21
- package/dist/files/components/UploadQueue.d.ts.map +0 -1
- package/dist/files/components/index.d.ts +0 -43
- package/dist/files/components/index.d.ts.map +0 -1
- package/dist/files/components/viewers/AudioPlayer.d.ts +0 -8
- package/dist/files/components/viewers/AudioPlayer.d.ts.map +0 -1
- package/dist/files/components/viewers/CodeViewer.d.ts +0 -16
- package/dist/files/components/viewers/CodeViewer.d.ts.map +0 -1
- package/dist/files/components/viewers/ImageViewer.d.ts +0 -8
- package/dist/files/components/viewers/ImageViewer.d.ts.map +0 -1
- package/dist/files/components/viewers/PDFViewer.d.ts +0 -15
- package/dist/files/components/viewers/PDFViewer.d.ts.map +0 -1
- package/dist/files/components/viewers/TextViewer.d.ts +0 -8
- package/dist/files/components/viewers/TextViewer.d.ts.map +0 -1
- package/dist/files/components/viewers/VideoPlayer.d.ts +0 -8
- package/dist/files/components/viewers/VideoPlayer.d.ts.map +0 -1
- package/dist/files/components/viewers/index.d.ts +0 -7
- package/dist/files/components/viewers/index.d.ts.map +0 -1
- package/dist/files/components/viewers/index.js +0 -6
- package/dist/files/graphql-types.d.ts +0 -317
- package/dist/files/graphql-types.d.ts.map +0 -1
- package/dist/files/hooks/useBatchOperations.d.ts +0 -32
- package/dist/files/hooks/useBatchOperations.d.ts.map +0 -1
- package/dist/files/hooks/useBinItems.d.ts +0 -11
- package/dist/files/hooks/useBinItems.d.ts.map +0 -1
- package/dist/files/hooks/useBrowsePage.d.ts +0 -18
- package/dist/files/hooks/useBrowsePage.d.ts.map +0 -1
- package/dist/files/hooks/useCopyFile.d.ts +0 -14
- package/dist/files/hooks/useCopyFile.d.ts.map +0 -1
- package/dist/files/hooks/useCreateFolder.d.ts +0 -14
- package/dist/files/hooks/useCreateFolder.d.ts.map +0 -1
- package/dist/files/hooks/useCreateFolderShare.d.ts +0 -16
- package/dist/files/hooks/useCreateFolderShare.d.ts.map +0 -1
- package/dist/files/hooks/useCreateShare.d.ts +0 -16
- package/dist/files/hooks/useCreateShare.d.ts.map +0 -1
- package/dist/files/hooks/useDeleteFile.d.ts +0 -9
- package/dist/files/hooks/useDeleteFile.d.ts.map +0 -1
- package/dist/files/hooks/useDeleteFolder.d.ts +0 -10
- package/dist/files/hooks/useDeleteFolder.d.ts.map +0 -1
- package/dist/files/hooks/useDragDrop.d.ts +0 -31
- package/dist/files/hooks/useDragDrop.d.ts.map +0 -1
- package/dist/files/hooks/useFileVersions.d.ts +0 -52
- package/dist/files/hooks/useFileVersions.d.ts.map +0 -1
- package/dist/files/hooks/useFiles.d.ts +0 -18
- package/dist/files/hooks/useFiles.d.ts.map +0 -1
- package/dist/files/hooks/useFolder.d.ts +0 -7
- package/dist/files/hooks/useFolder.d.ts.map +0 -1
- package/dist/files/hooks/useFolderPath.d.ts +0 -2
- package/dist/files/hooks/useFolderPath.d.ts.map +0 -1
- package/dist/files/hooks/useFoldersQuery.d.ts +0 -7
- package/dist/files/hooks/useFoldersQuery.d.ts.map +0 -1
- package/dist/files/hooks/useKeyboardNavigation.d.ts +0 -17
- package/dist/files/hooks/useKeyboardNavigation.d.ts.map +0 -1
- package/dist/files/hooks/useMoveFile.d.ts +0 -10
- package/dist/files/hooks/useMoveFile.d.ts.map +0 -1
- package/dist/files/hooks/useMoveFolder.d.ts +0 -10
- package/dist/files/hooks/useMoveFolder.d.ts.map +0 -1
- package/dist/files/hooks/usePermanentlyDeleteFile.d.ts +0 -9
- package/dist/files/hooks/usePermanentlyDeleteFile.d.ts.map +0 -1
- package/dist/files/hooks/usePermanentlyDeleteFolder.d.ts +0 -9
- package/dist/files/hooks/usePermanentlyDeleteFolder.d.ts.map +0 -1
- package/dist/files/hooks/useRecentFiles.d.ts +0 -10
- package/dist/files/hooks/useRecentFiles.d.ts.map +0 -1
- package/dist/files/hooks/useRenameFile.d.ts +0 -10
- package/dist/files/hooks/useRenameFile.d.ts.map +0 -1
- package/dist/files/hooks/useRenameFolder.d.ts +0 -10
- package/dist/files/hooks/useRenameFolder.d.ts.map +0 -1
- package/dist/files/hooks/useRestoreFile.d.ts +0 -9
- package/dist/files/hooks/useRestoreFile.d.ts.map +0 -1
- package/dist/files/hooks/useRestoreFolder.d.ts +0 -9
- package/dist/files/hooks/useRestoreFolder.d.ts.map +0 -1
- package/dist/files/hooks/useSearch.d.ts +0 -15
- package/dist/files/hooks/useSearch.d.ts.map +0 -1
- package/dist/files/hooks/useStarredItems.d.ts +0 -10
- package/dist/files/hooks/useStarredItems.d.ts.map +0 -1
- package/dist/files/hooks/useToast.d.ts +0 -11
- package/dist/files/hooks/useToast.d.ts.map +0 -1
- package/dist/files/hooks/useToggleStar.d.ts +0 -10
- package/dist/files/hooks/useToggleStar.d.ts.map +0 -1
- package/dist/files/hooks/useUploadFile.d.ts +0 -25
- package/dist/files/hooks/useUploadFile.d.ts.map +0 -1
- package/dist/files/index.d.ts +0 -29
- package/dist/files/index.d.ts.map +0 -1
- package/dist/files/pages/BrowserPage.d.ts +0 -5
- package/dist/files/pages/BrowserPage.d.ts.map +0 -1
- package/dist/files/pages/ShareAccessPage.d.ts +0 -2
- package/dist/files/pages/ShareAccessPage.d.ts.map +0 -1
- package/dist/files/providers/FilesProvider.d.ts +0 -25
- package/dist/files/providers/FilesProvider.d.ts.map +0 -1
- package/dist/files/store/filesStore.d.ts +0 -99
- package/dist/files/store/filesStore.d.ts.map +0 -1
- package/dist/files/types.d.ts +0 -266
- package/dist/files/types.d.ts.map +0 -1
- package/dist/files/utils/events.d.ts +0 -6
- package/dist/files/utils/events.d.ts.map +0 -1
- package/dist/files/utils/i18n.d.ts +0 -5
- package/dist/files/utils/i18n.d.ts.map +0 -1
- package/dist/files/utils/index.d.ts +0 -74
- package/dist/files/utils/index.d.ts.map +0 -1
- package/dist/files/utils/thumbnail.d.ts +0 -5
- package/dist/files/utils/thumbnail.d.ts.map +0 -1
- package/dist/files.d.ts +0 -2
- package/dist/generated/global-operations.d.ts +0 -2
- package/dist/generated/global-operations.d.ts.map +0 -1
- package/dist/generated/global-types.d.ts +0 -23527
- package/dist/generated/global-types.d.ts.map +0 -1
- package/dist/generated/wspace-operations.d.ts +0 -2706
- package/dist/generated/wspace-operations.d.ts.map +0 -1
- package/dist/generated/wspace-types.d.ts +0 -57851
- package/dist/generated/wspace-types.d.ts.map +0 -1
- package/dist/index.d.ts +0 -30
- package/dist/index.d.ts.map +0 -1
- package/dist/shared/types/index.d.ts +0 -101
- package/dist/shared/types/index.d.ts.map +0 -1
- package/dist/translations/en.d.ts +0 -315
- package/dist/translations/en.d.ts.map +0 -1
- package/dist/utils/nativeBridge.d.ts +0 -3
- package/dist/utils/nativeBridge.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShareAccessPage.js","names":[],"sources":["../../../src/files/pages/ShareAccessPage.tsx"],"sourcesContent":["import {\n type FormEvent,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\nimport { useLocation, useNavigate, useParams } from \"react-router-dom\";\nimport { ArrowLeft, Loader2, Lock } from \"lucide-react\";\nimport { print } from \"graphql\";\nimport { AccessShareDocument } from \"../../generated/wspace-operations\";\nimport type {\n AccessShareMutation,\n AccessShareMutationVariables,\n} from \"../../generated/wspace-operations\";\nimport { buildGraphQLEndpoint, config } from \"../../config\";\nimport { FilePreviewModal } from \"../components/FilePreviewModal\";\nimport type { FileItem } from \"../types\";\nimport { useFilesContext } from \"../providers/FilesProvider\";\nimport { emitFilesEvent } from \"../utils/events\";\nimport { nativeImpact, nativeOpenUrl } from \"../../utils/nativeBridge\";\nimport { useI18n } from \"@burdenoff/fe-libs/shared/providers/shell/I18nProvider\";\nimport { tWithFallback } from \"../utils/i18n\";\n\ntype GraphQLResponse<TData> = {\n data?: TData;\n errors?: Array<{ message?: string }>;\n};\n\nfunction resolveWorkspaceGraphQLEndpoint(apiGatewayUrl?: string): string {\n const configuredUrl = apiGatewayUrl || config.apiGatewayUrl;\n\n if (!configuredUrl) {\n throw new Error(\"Files API gateway URL is not configured\");\n }\n\n return configuredUrl.includes(\"/graphql\")\n ? configuredUrl\n : buildGraphQLEndpoint(configuredUrl, \"workspaces\");\n}\n\nasync function requestPublicGraphQL<TData, TVariables>(\n endpoint: string,\n query: string,\n variables: TVariables,\n): Promise<TData> {\n const response = await fetch(endpoint, {\n method: \"POST\",\n credentials: \"omit\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ query, variables }),\n });\n\n const payload = (await response.json()) as GraphQLResponse<TData>;\n const errorMessage = payload.errors?.[0]?.message;\n\n if (!response.ok || errorMessage || !payload.data) {\n throw new Error(errorMessage || \"Unable to access shared file\");\n }\n\n return payload.data;\n}\n\nfunction buildSharedFile(payload: {\n id: string;\n name: string;\n workspaceId: string;\n mimeType: string;\n size: string;\n s3Key: string;\n downloadUrl?: string | null;\n}): FileItem {\n const extension = payload.name.includes(\".\")\n ? payload.name.split(\".\").pop() || \"\"\n : \"\";\n\n return {\n id: payload.id,\n name: payload.name,\n workspaceId: payload.workspaceId,\n mimeType: payload.mimeType,\n extension,\n size: Number(payload.size),\n s3Key: payload.s3Key,\n url: payload.downloadUrl ?? \"\",\n downloadUrl: payload.downloadUrl ?? undefined,\n starred: false,\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n };\n}\n\nexport function ShareAccessPage() {\n const { t } = useI18n();\n const navigate = useNavigate();\n const location = useLocation();\n const { token: routeToken } = useParams<{ token: string }>();\n const token = useMemo(() => {\n if (routeToken) {\n return routeToken;\n }\n\n const match = location.pathname.match(/\\/share\\/([^/]+)/);\n return match?.[1] ? decodeURIComponent(match[1]) : \"\";\n }, [location.pathname, routeToken]);\n const filesContext = useFilesContext();\n const { apiGatewayUrl } = filesContext;\n const endpoint = useMemo(\n () => resolveWorkspaceGraphQLEndpoint(apiGatewayUrl),\n [apiGatewayUrl],\n );\n const [loading, setLoading] = useState(false);\n const [password, setPassword] = useState(\"\");\n const [requiresPassword, setRequiresPassword] = useState(false);\n const [errorMessage, setErrorMessage] = useState<string | null>(null);\n const [sharedFile, setSharedFile] = useState<FileItem | null>(null);\n\n const loadShare = useCallback(\n async (sharePassword?: string) => {\n if (!token) {\n throw new Error(\"Share token is missing\");\n }\n\n setLoading(true);\n\n try {\n const data = await requestPublicGraphQL<\n AccessShareMutation,\n AccessShareMutationVariables\n >(endpoint, print(AccessShareDocument), {\n input: {\n token,\n password: sharePassword || undefined,\n },\n });\n\n const payload = data.accessShare;\n if (!payload?.file || !payload.share) {\n throw new Error(payload?.message || \"Shared file is unavailable\");\n }\n\n setRequiresPassword(Boolean(payload.share.requiresPassword));\n setSharedFile(buildSharedFile(payload.file));\n setErrorMessage(null);\n } finally {\n setLoading(false);\n }\n },\n [endpoint, token],\n );\n\n useEffect(() => {\n loadShare().catch((error) => {\n const message =\n error instanceof Error ? error.message : \"Unable to access shared file\";\n setErrorMessage(message);\n setRequiresPassword(message.toLowerCase().includes(\"password\"));\n });\n }, [loadShare]);\n\n const handleDownload = async () => {\n if (!sharedFile) {\n return;\n }\n\n const downloadUrl = sharedFile.downloadUrl || sharedFile.url;\n if (downloadUrl) {\n nativeImpact(\"light\");\n await nativeOpenUrl(downloadUrl);\n emitFilesEvent(filesContext, \"files.share.downloaded\", {\n fileId: sharedFile.id,\n fileName: sharedFile.name,\n });\n }\n };\n\n const handlePasswordSubmit = async (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n\n try {\n await loadShare(password);\n } catch (error) {\n setErrorMessage(\n error instanceof Error ? error.message : \"Unable to unlock shared file\",\n );\n }\n };\n\n if (sharedFile) {\n return (\n <FilePreviewModal\n file={sharedFile}\n onClose={() => navigate(\"/files/browse\")}\n onDownload={handleDownload}\n />\n );\n }\n\n return (\n <div className=\"flex min-h-[70vh] items-center justify-center px-4 py-10\">\n <div className=\"w-full max-w-md rounded-2xl border border-border-default bg-bg-surface p-6 shadow-elevation-2\">\n <button\n onClick={() => navigate(\"/files/browse\")}\n className=\"mb-6 inline-flex items-center gap-2 text-sm font-medium text-text-secondary transition-colors hover:text-text-primary\"\n >\n <ArrowLeft className=\"size-4\" />\n {tWithFallback(t, \"files.share.back\", \"Back to files\")}\n </button>\n\n <div className=\"mb-6\">\n <h1 className=\"text-xl font-semibold text-text-primary\">\n {tWithFallback(t, \"files.share.title\", \"Shared file access\")}\n </h1>\n <p className=\"mt-2 text-sm text-text-secondary\">\n {tWithFallback(\n t,\n \"files.share.subtitle\",\n \"Open a shared file preview using the access token from the share link.\",\n )}\n </p>\n </div>\n\n {loading ? (\n <div className=\"flex items-center gap-3 rounded-lg border border-border-default bg-bg-muted px-4 py-3 text-sm text-text-secondary\">\n <Loader2 className=\"size-4 animate-spin text-action-primary-bg\" />\n {tWithFallback(\n t,\n \"files.share.verifying\",\n \"Verifying share access…\",\n )}\n </div>\n ) : requiresPassword ? (\n <form className=\"space-y-4\" onSubmit={handlePasswordSubmit}>\n <label className=\"block text-sm font-medium text-text-primary\">\n {tWithFallback(t, \"files.share.password.label\", \"Share password\")}\n <div className=\"mt-2 flex items-center gap-2 rounded-lg border border-border-default px-3 py-2\">\n <Lock className=\"size-4 text-text-tertiary\" />\n <input\n type=\"password\"\n value={password}\n onChange={(event) => setPassword(event.target.value)}\n className=\"w-full bg-transparent text-sm text-text-primary outline-none\"\n placeholder={tWithFallback(\n t,\n \"files.share.password.placeholder\",\n \"Enter the share password\",\n )}\n autoFocus\n />\n </div>\n </label>\n\n {errorMessage && (\n <div className=\"rounded-lg border border-status-error-border bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text\">\n {errorMessage}\n </div>\n )}\n\n <button\n type=\"submit\"\n disabled={!password.trim()}\n className=\"inline-flex w-full items-center justify-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2.5 text-sm font-medium text-text-inverse transition-colors hover:bg-action-primary-bg-hover disabled:cursor-not-allowed disabled:bg-bg-muted disabled:text-text-tertiary\"\n >\n {tWithFallback(t, \"files.share.unlock\", \"Unlock shared file\")}\n </button>\n </form>\n ) : (\n <div className=\"space-y-4\">\n {errorMessage && (\n <div className=\"rounded-lg border border-status-error-border bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text\">\n {errorMessage}\n </div>\n )}\n <button\n onClick={() => loadShare()}\n className=\"inline-flex w-full items-center justify-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2.5 text-sm font-medium text-text-inverse transition-colors hover:bg-action-primary-bg-hover\"\n >\n {tWithFallback(\n t,\n \"files.share.retry\",\n \"Retry shared file access\",\n )}\n </button>\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AA6BA,SAAS,EAAgC,GAAgC;CAC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ACG,KACC,kBAAC,OAAD;MAAK,WAAU;gBACZ;MACG,CAAA,EAER,kBAAC,UAAD;MACE,eAAe,GAAW;MAC1B,WAAU;gBAET,EACC,GACA,qBACA,2BACD;MACM,CAAA,CACL;;IAEJ;;EACF,CAAA"}
|
|
1
|
+
{"version":3,"file":"ShareAccessPage.js","names":[],"sources":["../../../src/files/pages/ShareAccessPage.tsx"],"sourcesContent":["import {\n type FormEvent,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\nimport { useLocation, useNavigate, useParams } from \"react-router-dom\";\nimport { ArrowLeft, Loader2, Lock } from \"lucide-react\";\nimport { print } from \"graphql\";\nimport { AccessShareDocument } from \"../../generated/wspace-operations\";\nimport type {\n AccessShareMutation,\n AccessShareMutationVariables,\n} from \"../../generated/wspace-operations\";\nimport { buildGraphQLEndpoint, config } from \"../../config\";\nimport { FilePreviewModal } from \"../components/FilePreviewModal\";\nimport type { FileItem } from \"../types\";\nimport { useFilesContext } from \"../providers/FilesProvider\";\nimport { emitFilesEvent } from \"../utils/events\";\nimport { nativeImpact, nativeOpenUrl } from \"../../utils/nativeBridge\";\nimport { useI18n } from \"@burdenoff/fe-libs/shared/providers/shell/I18nProvider\";\nimport { tWithFallback } from \"../utils/i18n\";\n\ntype GraphQLResponse<TData> = {\n data?: TData;\n errors?: Array<{ message?: string }>;\n};\n\nfunction resolveWorkspaceGraphQLEndpoint(apiGatewayUrl?: string): string {\n const configuredUrl = apiGatewayUrl || config.apiGatewayUrl;\n\n if (!configuredUrl) {\n throw new Error(\"Files API gateway URL is not configured\");\n }\n\n return configuredUrl.includes(\"/graphql\")\n ? configuredUrl\n : buildGraphQLEndpoint(configuredUrl, \"workspaces\");\n}\n\nasync function requestPublicGraphQL<TData, TVariables>(\n endpoint: string,\n query: string,\n variables: TVariables,\n): Promise<TData> {\n const response = await fetch(endpoint, {\n method: \"POST\",\n credentials: \"omit\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ query, variables }),\n });\n\n const payload = (await response.json()) as GraphQLResponse<TData>;\n const errorMessage = payload.errors?.[0]?.message;\n\n if (!response.ok || errorMessage || !payload.data) {\n throw new Error(errorMessage || \"Unable to access shared file\");\n }\n\n return payload.data;\n}\n\nfunction buildSharedFile(payload: {\n id: string;\n name: string;\n workspaceId: string;\n mimeType: string;\n size: string;\n s3Key: string;\n downloadUrl?: string | null;\n}): FileItem {\n const extension = payload.name.includes(\".\")\n ? payload.name.split(\".\").pop() || \"\"\n : \"\";\n\n return {\n id: payload.id,\n name: payload.name,\n workspaceId: payload.workspaceId,\n mimeType: payload.mimeType,\n extension,\n size: Number(payload.size),\n s3Key: payload.s3Key,\n url: payload.downloadUrl ?? \"\",\n downloadUrl: payload.downloadUrl ?? undefined,\n starred: false,\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n };\n}\n\nexport function ShareAccessPage() {\n const { t } = useI18n();\n const navigate = useNavigate();\n const { pathname } = useLocation();\n const { token: routeToken } = useParams<{ token: string }>();\n const token = useMemo(() => {\n if (routeToken) {\n return routeToken;\n }\n\n const match = pathname.match(/\\/share\\/([^/]+)/);\n return match?.[1] ? decodeURIComponent(match[1]) : \"\";\n }, [pathname, routeToken]);\n const filesContext = useFilesContext();\n const { apiGatewayUrl } = filesContext;\n const endpoint = useMemo(\n () => resolveWorkspaceGraphQLEndpoint(apiGatewayUrl),\n [apiGatewayUrl],\n );\n const [loading, setLoading] = useState(false);\n const [password, setPassword] = useState(\"\");\n const [requiresPassword, setRequiresPassword] = useState(false);\n const [errorMessage, setErrorMessage] = useState<string | null>(null);\n const [sharedFile, setSharedFile] = useState<FileItem | null>(null);\n\n const loadShare = useCallback(\n async (sharePassword?: string) => {\n if (!token) {\n throw new Error(\"Share token is missing\");\n }\n\n setLoading(true);\n\n try {\n const data = await requestPublicGraphQL<\n AccessShareMutation,\n AccessShareMutationVariables\n >(endpoint, print(AccessShareDocument), {\n input: {\n token,\n password: sharePassword || undefined,\n },\n });\n\n const payload = data.accessShare;\n if (!payload?.file || !payload.share) {\n throw new Error(payload?.message || \"Shared file is unavailable\");\n }\n\n setRequiresPassword(Boolean(payload.share.requiresPassword));\n setSharedFile(buildSharedFile(payload.file));\n setErrorMessage(null);\n } finally {\n setLoading(false);\n }\n },\n [endpoint, token],\n );\n\n useEffect(() => {\n loadShare().catch((error) => {\n const message =\n error instanceof Error ? error.message : \"Unable to access shared file\";\n setErrorMessage(message);\n setRequiresPassword(message.toLowerCase().includes(\"password\"));\n });\n }, [loadShare]);\n\n const handleDownload = async () => {\n if (!sharedFile) {\n return;\n }\n\n const downloadUrl = sharedFile.downloadUrl || sharedFile.url;\n if (downloadUrl) {\n nativeImpact(\"light\");\n await nativeOpenUrl(downloadUrl);\n emitFilesEvent(filesContext, \"files.share.downloaded\", {\n fileId: sharedFile.id,\n fileName: sharedFile.name,\n });\n }\n };\n\n const handlePasswordSubmit = async (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n\n try {\n await loadShare(password);\n } catch (error) {\n setErrorMessage(\n error instanceof Error ? error.message : \"Unable to unlock shared file\",\n );\n }\n };\n\n if (sharedFile) {\n return (\n <FilePreviewModal\n file={sharedFile}\n onClose={() => navigate(\"/files/browse\")}\n onDownload={handleDownload}\n />\n );\n }\n\n return (\n <div className=\"flex min-h-[70vh] items-center justify-center px-4 py-10\">\n <div className=\"w-full max-w-md rounded-2xl border border-border-default bg-bg-surface p-6 shadow-elevation-2\">\n <button\n type=\"button\"\n onClick={() => navigate(\"/files/browse\")}\n className=\"mb-6 inline-flex items-center gap-2 text-sm font-medium text-text-secondary transition-colors hover:text-text-primary\"\n >\n <ArrowLeft className=\"size-4\" />\n {tWithFallback(t, \"files.share.back\", \"Back to files\")}\n </button>\n\n <div className=\"mb-6\">\n <h1 className=\"text-xl font-semibold text-text-primary\">\n {tWithFallback(t, \"files.share.title\", \"Shared file access\")}\n </h1>\n <p className=\"mt-2 text-sm text-text-secondary\">\n {tWithFallback(\n t,\n \"files.share.subtitle\",\n \"Open a shared file preview using the access token from the share link.\",\n )}\n </p>\n </div>\n\n {loading ? (\n <div className=\"flex items-center gap-3 rounded-lg border border-border-default bg-bg-muted px-4 py-3 text-sm text-text-secondary\">\n <Loader2 className=\"size-4 animate-spin text-action-primary-bg\" />\n {tWithFallback(\n t,\n \"files.share.verifying\",\n \"Verifying share access…\",\n )}\n </div>\n ) : requiresPassword ? (\n <form className=\"space-y-4\" onSubmit={handlePasswordSubmit}>\n <label className=\"block text-sm font-medium text-text-primary\">\n {tWithFallback(t, \"files.share.password.label\", \"Share password\")}\n <div className=\"mt-2 flex items-center gap-2 rounded-lg border border-border-default px-3 py-2\">\n <Lock className=\"size-4 text-text-tertiary\" />\n <input\n type=\"password\"\n value={password}\n onChange={(event) => setPassword(event.target.value)}\n className=\"w-full bg-transparent text-sm text-text-primary outline-none\"\n placeholder={tWithFallback(\n t,\n \"files.share.password.placeholder\",\n \"Enter the share password\",\n )}\n />\n </div>\n </label>\n\n {errorMessage && (\n <div className=\"rounded-lg border border-status-error-border bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text\">\n {errorMessage}\n </div>\n )}\n\n <button\n type=\"submit\"\n disabled={!password.trim()}\n className=\"inline-flex w-full items-center justify-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2.5 text-sm font-medium text-text-inverse transition-colors hover:bg-action-primary-bg-hover disabled:cursor-not-allowed disabled:bg-bg-muted disabled:text-text-tertiary\"\n >\n {tWithFallback(t, \"files.share.unlock\", \"Unlock shared file\")}\n </button>\n </form>\n ) : (\n <div className=\"space-y-4\">\n {errorMessage && (\n <div className=\"rounded-lg border border-status-error-border bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text\">\n {errorMessage}\n </div>\n )}\n <button\n type=\"button\"\n onClick={() => loadShare()}\n className=\"inline-flex w-full items-center justify-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2.5 text-sm font-medium text-text-inverse transition-colors hover:bg-action-primary-bg-hover\"\n >\n {tWithFallback(\n t,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,CAAC,EAAS,MAAM;OAC1B,WAAU;iBAET,EAAc,GAAG,sBAAsB,qBAAqB;OACtD,CAAA;MACJ;SAEP,kBAAC,OAAD;KAAK,WAAU;eAAf,CACG,KACC,kBAAC,OAAD;MAAK,WAAU;gBACZ;MACG,CAAA,EAER,kBAAC,UAAD;MACE,MAAK;MACL,eAAe,GAAW;MAC1B,WAAU;gBAET,EACC,GACA,qBACA,2BACD;MACM,CAAA,CACL;;IAEJ;;EACF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/files/utils/index.ts"],"sourcesContent":["import type { LucideIcon } from \"lucide-react\";\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/files/utils/index.ts"],"sourcesContent":["import type { LucideIcon } from \"lucide-react\";\nimport { File, Image, FileText, Film, Music, Code } from \"lucide-react\";\nimport {\n formatBytes,\n formatRelativeTime,\n} from \"@burdenoff/fe-libs/shared/utils\";\nimport type { FilePreviewType } from \"../types\";\nexport { isImageType, generateThumbnail } from \"./thumbnail\";\n\nexport const formatFileSize = formatBytes;\n\nfunction getFileExtension(filename: string): string {\n const parts = filename.split(\".\");\n return parts.length > 1 ? parts[parts.length - 1].toLowerCase() : \"\";\n}\n\nfunction getFilePreviewType(mimeType: string): FilePreviewType {\n if (mimeType.startsWith(\"image/\")) {\n return \"image\";\n }\n if (mimeType === \"application/pdf\") {\n return \"pdf\";\n }\n if (mimeType.startsWith(\"video/\")) {\n return \"video\";\n }\n if (mimeType.startsWith(\"audio/\")) {\n return \"audio\";\n }\n if (\n mimeType.startsWith(\"text/\") ||\n mimeType === \"application/json\" ||\n mimeType === \"application/xml\"\n ) {\n return \"text\";\n }\n if (\n mimeType.includes(\"javascript\") ||\n mimeType.includes(\"typescript\") ||\n mimeType.includes(\"python\") ||\n mimeType.includes(\"java\")\n ) {\n return \"code\";\n }\n return \"unsupported\";\n}\n\nexport function getFileIcon(mimeType: string): LucideIcon {\n const previewType = getFilePreviewType(mimeType);\n\n switch (previewType) {\n case \"image\":\n return Image;\n case \"pdf\":\n return FileText;\n case \"video\":\n return Film;\n case \"audio\":\n return Music;\n case \"code\":\n return Code;\n case \"text\":\n return FileText;\n default:\n return File;\n }\n}\n\nexport function sortFiles<\n T extends { name: string; createdAt: string; size?: number },\n>(\n files: T[],\n sortBy: \"name\" | \"date\" | \"size\" | \"type\",\n direction: \"asc\" | \"desc\" = \"asc\",\n): T[] {\n const sorted = files.toSorted((a, b) => {\n let comparison = 0;\n\n switch (sortBy) {\n case \"name\":\n comparison = a.name.localeCompare(b.name);\n break;\n case \"date\":\n comparison =\n new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime();\n break;\n case \"size\":\n comparison = (a.size || 0) - (b.size || 0);\n break;\n case \"type\": {\n const extA = getFileExtension(a.name);\n const extB = getFileExtension(b.name);\n comparison = extA.localeCompare(extB);\n break;\n }\n }\n\n return direction === \"asc\" ? comparison : -comparison;\n });\n\n return sorted;\n}\n\nexport const formatFileDate = formatRelativeTime;\n"],"mappings":";;;;AASA,IAAa,IAAiB;AAE9B,SAAS,EAAiB,GAA0B;CAClD,IAAM,IAAQ,EAAS,MAAM,IAAI;AACjC,QAAO,EAAM,SAAS,IAAI,EAAM,EAAM,SAAS,GAAG,aAAa,GAAG;;AAGpE,SAAS,EAAmB,GAAmC;AA4B7D,QA3BI,EAAS,WAAW,SAAS,GACxB,UAEL,MAAa,oBACR,QAEL,EAAS,WAAW,SAAS,GACxB,UAEL,EAAS,WAAW,SAAS,GACxB,UAGP,EAAS,WAAW,QAAQ,IAC5B,MAAa,sBACb,MAAa,oBAEN,SAGP,EAAS,SAAS,aAAa,IAC/B,EAAS,SAAS,aAAa,IAC/B,EAAS,SAAS,SAAS,IAC3B,EAAS,SAAS,OAAO,GAElB,SAEF;;AAGT,SAAgB,EAAY,GAA8B;AAGxD,SAFoB,EAAmB,EAAS,EAEhD;EACE,KAAK,QACH,QAAO;EACT,KAAK,MACH,QAAO;EACT,KAAK,QACH,QAAO;EACT,KAAK,QACH,QAAO;EACT,KAAK,OACH,QAAO;EACT,KAAK,OACH,QAAO;EACT,QACE,QAAO;;;AAIb,SAAgB,EAGd,GACA,GACA,IAA4B,OACvB;AA0BL,QAzBe,EAAM,UAAU,GAAG,MAAM;EACtC,IAAI,IAAa;AAEjB,UAAQ,GAAR;GACE,KAAK;AACH,QAAa,EAAE,KAAK,cAAc,EAAE,KAAK;AACzC;GACF,KAAK;AACH,QACE,IAAI,KAAK,EAAE,UAAU,CAAC,SAAS,GAAG,IAAI,KAAK,EAAE,UAAU,CAAC,SAAS;AACnE;GACF,KAAK;AACH,SAAc,EAAE,QAAQ,MAAM,EAAE,QAAQ;AACxC;GACF,KAAK,QAAQ;IACX,IAAM,IAAO,EAAiB,EAAE,KAAK,EAC/B,IAAO,EAAiB,EAAE,KAAK;AACrC,QAAa,EAAK,cAAc,EAAK;AACrC;;;AAIJ,SAAO,MAAc,QAAQ,IAAa,CAAC;GAC3C;;AAKJ,IAAa,IAAiB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thumbnail.js","names":[],"sources":["../../../src/files/utils/thumbnail.ts"],"sourcesContent":["const MAX_THUMBNAIL_SIZE = 200;\nconst THUMBNAIL_QUALITY = 0.8;\nconst MIME_TYPE = \"image/jpeg\";\n\nconst imageTypes = new Set([\n \"image/jpeg\",\n \"image/png\",\n \"image/gif\",\n \"image/webp\",\n \"image/bmp\",\n \"image/tiff\",\n]);\n\nexport function isImageType(mimeType: string): boolean {\n return imageTypes.has(mimeType.toLowerCase());\n}\n\nexport async function generateThumbnail(\n file: File,\n maxSize: number = MAX_THUMBNAIL_SIZE,\n): Promise<string | null> {\n if (!isImageType(file.type)) {\n return null;\n }\n\n return new Promise((resolve) => {\n const img = new Image();\n const url = URL.createObjectURL(file);\n\n img.onload = () => {\n URL.revokeObjectURL(url);\n\n const canvas = document.createElement(\"canvas\");\n const ctx = canvas.getContext(\"2d\");\n if (!ctx) {\n resolve(null);\n return;\n }\n\n let { width, height } = img;\n\n if (width > height) {\n if (width > maxSize) {\n height = Math.round((height * maxSize) / width);\n width = maxSize;\n }\n } else {\n if (height > maxSize) {\n width = Math.round((width * maxSize) / height);\n height = maxSize;\n }\n }\n\n canvas.width = width;\n canvas.height = height;\n\n ctx.drawImage(img, 0, 0, width, height);\n\n canvas.toBlob(\n (blob) => {\n if (!blob) {\n resolve(null);\n return;\n }\n resolve(URL.createObjectURL(blob));\n },\n MIME_TYPE,\n THUMBNAIL_QUALITY,\n );\n };\n\n img.onerror = () => {\n URL.revokeObjectURL(url);\n resolve(null);\n };\n\n img.src = url;\n });\n}\n
|
|
1
|
+
{"version":3,"file":"thumbnail.js","names":[],"sources":["../../../src/files/utils/thumbnail.ts"],"sourcesContent":["const MAX_THUMBNAIL_SIZE = 200;\nconst THUMBNAIL_QUALITY = 0.8;\nconst MIME_TYPE = \"image/jpeg\";\n\nconst imageTypes = new Set([\n \"image/jpeg\",\n \"image/png\",\n \"image/gif\",\n \"image/webp\",\n \"image/bmp\",\n \"image/tiff\",\n]);\n\nexport function isImageType(mimeType: string): boolean {\n return imageTypes.has(mimeType.toLowerCase());\n}\n\nexport async function generateThumbnail(\n file: File,\n maxSize: number = MAX_THUMBNAIL_SIZE,\n): Promise<string | null> {\n if (!isImageType(file.type)) {\n return null;\n }\n\n return new Promise((resolve) => {\n const img = new Image();\n const url = URL.createObjectURL(file);\n\n img.onload = () => {\n URL.revokeObjectURL(url);\n\n const canvas = document.createElement(\"canvas\");\n const ctx = canvas.getContext(\"2d\");\n if (!ctx) {\n resolve(null);\n return;\n }\n\n let { width, height } = img;\n\n if (width > height) {\n if (width > maxSize) {\n height = Math.round((height * maxSize) / width);\n width = maxSize;\n }\n } else {\n if (height > maxSize) {\n width = Math.round((width * maxSize) / height);\n height = maxSize;\n }\n }\n\n canvas.width = width;\n canvas.height = height;\n\n ctx.drawImage(img, 0, 0, width, height);\n\n canvas.toBlob(\n (blob) => {\n if (!blob) {\n resolve(null);\n return;\n }\n resolve(URL.createObjectURL(blob));\n },\n MIME_TYPE,\n THUMBNAIL_QUALITY,\n );\n };\n\n img.onerror = () => {\n URL.revokeObjectURL(url);\n resolve(null);\n };\n\n img.src = url;\n });\n}\n"],"mappings":";AAAA,IAAM,IAAqB,KACrB,IAAoB,IACpB,IAAY,cAEZ,IAAa,IAAI,IAAI;CACzB;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,SAAgB,EAAY,GAA2B;AACrD,QAAO,EAAW,IAAI,EAAS,aAAa,CAAC;;AAG/C,eAAsB,EACpB,GACA,IAAkB,GACM;AAKxB,QAJK,EAAY,EAAK,KAAK,GAIpB,IAAI,SAAS,MAAY;EAC9B,IAAM,IAAM,IAAI,OAAO,EACjB,IAAM,IAAI,gBAAgB,EAAK;AAiDrC,EA/CA,EAAI,eAAe;AACjB,OAAI,gBAAgB,EAAI;GAExB,IAAM,IAAS,SAAS,cAAc,SAAS,EACzC,IAAM,EAAO,WAAW,KAAK;AACnC,OAAI,CAAC,GAAK;AACR,MAAQ,KAAK;AACb;;GAGF,IAAI,EAAE,UAAO,cAAW;AAmBxB,GAjBI,IAAQ,IACN,IAAQ,MACV,IAAS,KAAK,MAAO,IAAS,IAAW,EAAM,EAC/C,IAAQ,KAGN,IAAS,MACX,IAAQ,KAAK,MAAO,IAAQ,IAAW,EAAO,EAC9C,IAAS,IAIb,EAAO,QAAQ,GACf,EAAO,SAAS,GAEhB,EAAI,UAAU,GAAK,GAAG,GAAG,GAAO,EAAO,EAEvC,EAAO,QACJ,MAAS;AACR,QAAI,CAAC,GAAM;AACT,OAAQ,KAAK;AACb;;AAEF,MAAQ,IAAI,gBAAgB,EAAK,CAAC;MAEpC,GACA,EACD;KAGH,EAAI,gBAAgB;AAElB,GADA,IAAI,gBAAgB,EAAI,EACxB,EAAQ,KAAK;KAGf,EAAI,MAAM;GACV,GAvDO"}
|
package/dist/files.js
CHANGED
|
@@ -3,4 +3,5 @@ import { useFilesStore as t } from "./files/store/filesStore.js";
|
|
|
3
3
|
import { buildGraphQLEndpoint as n, config as r, resetFilesConfig as i, setFilesConfig as a } from "./config/index.js";
|
|
4
4
|
import { FilesRoot as o } from "./files/FilesRoot.js";
|
|
5
5
|
import "./files/index.js";
|
|
6
|
-
|
|
6
|
+
import { enTranslations as s } from "./translations/en.js";
|
|
7
|
+
export { o as FilesRoot, n as buildGraphQLEndpoint, r as config, s as enTranslations, i as resetFilesConfig, a as setFilesConfig, e as useFilesContext, t as useFilesStore };
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
//#region src/translations/en.ts
|
|
2
|
+
var e = { files: {
|
|
3
|
+
actionMenu: { moreActions: "More actions" },
|
|
4
|
+
browser: {
|
|
5
|
+
actions: {
|
|
6
|
+
export: "Export",
|
|
7
|
+
exportTitle: "Export selected items",
|
|
8
|
+
goToRoot: "Go to root folder",
|
|
9
|
+
newFolder: "New Folder",
|
|
10
|
+
selectAll: "Select all",
|
|
11
|
+
uploadFiles: "Upload files",
|
|
12
|
+
uploadFolder: "Upload folder",
|
|
13
|
+
uploadFolderTitle: "Upload folder"
|
|
14
|
+
},
|
|
15
|
+
delete: "Delete",
|
|
16
|
+
items: "items",
|
|
17
|
+
loading: "Loading files…",
|
|
18
|
+
modified: "Modified",
|
|
19
|
+
name: "Name",
|
|
20
|
+
openFolder: "Open folder",
|
|
21
|
+
owner: "Owner",
|
|
22
|
+
rename: "Rename",
|
|
23
|
+
retry: "Retry",
|
|
24
|
+
rootLabel: "My Drive",
|
|
25
|
+
search: {
|
|
26
|
+
clear: "Clear search",
|
|
27
|
+
showingResults: "Showing {{count}} results for \"{{query}}\""
|
|
28
|
+
},
|
|
29
|
+
selection: {
|
|
30
|
+
selectedCount: "{{count}} selected",
|
|
31
|
+
actions: { restore: "Restore" }
|
|
32
|
+
},
|
|
33
|
+
size: "Size",
|
|
34
|
+
tabs: {
|
|
35
|
+
all: "All Files",
|
|
36
|
+
bin: "Bin",
|
|
37
|
+
recent: "Recent",
|
|
38
|
+
starred: "Starred"
|
|
39
|
+
},
|
|
40
|
+
view: {
|
|
41
|
+
grid: "Grid view",
|
|
42
|
+
list: "List view"
|
|
43
|
+
},
|
|
44
|
+
workspace: {
|
|
45
|
+
notSelected: "No workspace selected",
|
|
46
|
+
waiting: "Waiting for workspace..."
|
|
47
|
+
},
|
|
48
|
+
loadError: "Failed to load files",
|
|
49
|
+
unexpectedError: "An unexpected error occurred"
|
|
50
|
+
},
|
|
51
|
+
card: {
|
|
52
|
+
activity: "Activity",
|
|
53
|
+
addToStarred: "Add to starred",
|
|
54
|
+
delete: "Delete",
|
|
55
|
+
details: "Details",
|
|
56
|
+
download: "Download",
|
|
57
|
+
favorite: "Favorite",
|
|
58
|
+
makeCopy: "Make a copy",
|
|
59
|
+
moveTo: "Move to",
|
|
60
|
+
rename: "Rename",
|
|
61
|
+
restore: "Restore",
|
|
62
|
+
share: "Share",
|
|
63
|
+
shared: "Shared",
|
|
64
|
+
unfavorite: "Remove from starred"
|
|
65
|
+
},
|
|
66
|
+
common: { actions: {
|
|
67
|
+
cancel: "Cancel",
|
|
68
|
+
clear: "Clear",
|
|
69
|
+
close: "Close",
|
|
70
|
+
create: "Create",
|
|
71
|
+
delete: "Delete",
|
|
72
|
+
deletePermanently: "Delete permanently",
|
|
73
|
+
done: "Done",
|
|
74
|
+
move: "Move",
|
|
75
|
+
rename: "Rename",
|
|
76
|
+
share: "Share"
|
|
77
|
+
} },
|
|
78
|
+
confirm: {
|
|
79
|
+
bulkPermanentDelete: {
|
|
80
|
+
description: "This action cannot be undone. All selected items will be permanently deleted.",
|
|
81
|
+
title: "Permanently delete {{count}} items"
|
|
82
|
+
},
|
|
83
|
+
deleteFile: {
|
|
84
|
+
description: "Are you sure you want to delete this file? It will be moved to the bin.",
|
|
85
|
+
title: "Delete file"
|
|
86
|
+
},
|
|
87
|
+
deleteFolder: {
|
|
88
|
+
description: "Are you sure you want to delete this folder? It will be moved to the bin.",
|
|
89
|
+
title: "Delete folder"
|
|
90
|
+
},
|
|
91
|
+
permanentDeleteFile: {
|
|
92
|
+
description: "This file will be permanently deleted. This action cannot be undone.",
|
|
93
|
+
title: "Permanently delete file"
|
|
94
|
+
},
|
|
95
|
+
permanentDeleteFolder: {
|
|
96
|
+
description: "This folder and all its contents will be permanently deleted. This action cannot be undone.",
|
|
97
|
+
title: "Permanently delete folder"
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
contextMenu: {
|
|
101
|
+
activity: "Activity",
|
|
102
|
+
addToStarred: "Add to starred",
|
|
103
|
+
delete: "Delete",
|
|
104
|
+
download: "Download",
|
|
105
|
+
fileInfo: "File information",
|
|
106
|
+
folderInfo: "Folder information",
|
|
107
|
+
moveTo: "Move to",
|
|
108
|
+
removeStar: "Remove star",
|
|
109
|
+
rename: "Rename",
|
|
110
|
+
restore: "Restore",
|
|
111
|
+
share: "Share"
|
|
112
|
+
},
|
|
113
|
+
copyDialog: {
|
|
114
|
+
copy: "Copy",
|
|
115
|
+
copyHere: "Copy here",
|
|
116
|
+
copyOf: "Copy of",
|
|
117
|
+
copying: "Copying...",
|
|
118
|
+
makeCopyOf: "Make a copy of \"{{name}}\"",
|
|
119
|
+
myDrive: "My Drive",
|
|
120
|
+
name: "Name",
|
|
121
|
+
title: "Copy item"
|
|
122
|
+
},
|
|
123
|
+
empty: {
|
|
124
|
+
all: {
|
|
125
|
+
description: "Upload files or create folders to get started",
|
|
126
|
+
title: "No files or folders yet"
|
|
127
|
+
},
|
|
128
|
+
bin: {
|
|
129
|
+
description: "Deleted files and folders will appear here",
|
|
130
|
+
title: "Bin is empty"
|
|
131
|
+
},
|
|
132
|
+
newFolder: "New Folder",
|
|
133
|
+
recent: {
|
|
134
|
+
description: "Files you recently opened will appear here",
|
|
135
|
+
title: "No recent files"
|
|
136
|
+
},
|
|
137
|
+
starred: {
|
|
138
|
+
description: "Star files and folders to find them easily",
|
|
139
|
+
title: "No starred items"
|
|
140
|
+
},
|
|
141
|
+
uploadFiles: "Upload Files"
|
|
142
|
+
},
|
|
143
|
+
file: {
|
|
144
|
+
copy: { success: "\"{{name}}\" copied" },
|
|
145
|
+
delete: { success: "\"{{name}}\" deleted" },
|
|
146
|
+
download: { success: "Downloaded {{name}}" },
|
|
147
|
+
errors: {
|
|
148
|
+
copyFailed: "Failed to copy file",
|
|
149
|
+
deleteFailed: "Failed to delete file",
|
|
150
|
+
downloadFailed: "Failed to download file",
|
|
151
|
+
downloadUrlUnavailable: "Download URL is not available",
|
|
152
|
+
moveFailed: "Failed to move file",
|
|
153
|
+
permanentDeleteFailed: "Failed to permanently delete file",
|
|
154
|
+
renameFailed: "Failed to rename file",
|
|
155
|
+
restoreFailed: "Failed to restore file",
|
|
156
|
+
starFailed: "Failed to update star status"
|
|
157
|
+
},
|
|
158
|
+
move: { success: "\"{{name}}\" moved" },
|
|
159
|
+
permanentDelete: { success: "\"{{name}}\" permanently deleted" },
|
|
160
|
+
rename: { success: "Renamed \"{{name}}\"" },
|
|
161
|
+
restore: { success: "\"{{name}}\" restored" }
|
|
162
|
+
},
|
|
163
|
+
folder: {
|
|
164
|
+
errors: {
|
|
165
|
+
copyUnsupported: "Copying folders is not supported",
|
|
166
|
+
createFailed: "Failed to create folder",
|
|
167
|
+
deleteFailed: "Failed to delete folder",
|
|
168
|
+
moveFailed: "Failed to move folder",
|
|
169
|
+
permanentDeleteFailed: "Failed to permanently delete folder",
|
|
170
|
+
renameFailed: "Failed to rename folder",
|
|
171
|
+
restoreFailed: "Failed to restore folder",
|
|
172
|
+
starFailed: "Failed to update star status"
|
|
173
|
+
},
|
|
174
|
+
item: "item",
|
|
175
|
+
move: { success: "\"{{name}}\" moved" },
|
|
176
|
+
delete: { success: "\"{{name}}\" deleted" },
|
|
177
|
+
permanentDelete: { success: "\"{{name}}\" permanently deleted" },
|
|
178
|
+
restore: { success: "\"{{name}}\" restored" },
|
|
179
|
+
rename: { success: "Renamed \"{{name}}\"" }
|
|
180
|
+
},
|
|
181
|
+
info: {
|
|
182
|
+
contents: "Contents",
|
|
183
|
+
created: "Created",
|
|
184
|
+
fileInfo: "File information",
|
|
185
|
+
files: "Files",
|
|
186
|
+
folder: "Folder",
|
|
187
|
+
folderInfo: "Folder information",
|
|
188
|
+
folders: "Folders",
|
|
189
|
+
modified: "Modified",
|
|
190
|
+
no: "No",
|
|
191
|
+
owner: "Owner",
|
|
192
|
+
path: "Path",
|
|
193
|
+
properties: "Properties",
|
|
194
|
+
size: "Size",
|
|
195
|
+
starred: "Starred",
|
|
196
|
+
status: "Status",
|
|
197
|
+
type: "Type",
|
|
198
|
+
unknown: "Unknown",
|
|
199
|
+
visibility: "Visibility",
|
|
200
|
+
yes: "Yes"
|
|
201
|
+
},
|
|
202
|
+
item: { errors: {
|
|
203
|
+
moveFailed: "Failed to move item",
|
|
204
|
+
renameFailed: "Failed to rename item"
|
|
205
|
+
} },
|
|
206
|
+
moveDialog: {
|
|
207
|
+
actions: { moving: "Moving..." },
|
|
208
|
+
title: "Move item"
|
|
209
|
+
},
|
|
210
|
+
preview: {
|
|
211
|
+
addStar: "Add to starred",
|
|
212
|
+
removeStar: "Remove from starred"
|
|
213
|
+
},
|
|
214
|
+
search: {
|
|
215
|
+
filters: { title: "Search filters" },
|
|
216
|
+
input: { placeholder: "Search files..." }
|
|
217
|
+
},
|
|
218
|
+
share: {
|
|
219
|
+
back: "Back to files",
|
|
220
|
+
password: { label: "Password" },
|
|
221
|
+
title: "Share",
|
|
222
|
+
unlock: "Enter password to access"
|
|
223
|
+
},
|
|
224
|
+
upload: {
|
|
225
|
+
active: "{{count}} uploading",
|
|
226
|
+
cancel: "Cancel",
|
|
227
|
+
completed: "{{count}} completed",
|
|
228
|
+
errors: {
|
|
229
|
+
failed: "Upload failed",
|
|
230
|
+
quotaExceeded: "Storage quota exceeded. Please upgrade your plan or delete files."
|
|
231
|
+
},
|
|
232
|
+
failed: "Upload failed",
|
|
233
|
+
noUploads: "No uploads in progress",
|
|
234
|
+
pause: "Pause",
|
|
235
|
+
paused: "Paused",
|
|
236
|
+
pending: "{{count}} pending",
|
|
237
|
+
resume: "Resume",
|
|
238
|
+
retry: "Retry",
|
|
239
|
+
uploads: "Uploads"
|
|
240
|
+
},
|
|
241
|
+
version: {
|
|
242
|
+
deleteVersion: "Delete version",
|
|
243
|
+
major: "Major version",
|
|
244
|
+
restore: "Restore",
|
|
245
|
+
restoreVersion: "Restore this version",
|
|
246
|
+
restoredFrom: "Restored from version {{version}}",
|
|
247
|
+
total: "{{count}} versions",
|
|
248
|
+
version: "Version",
|
|
249
|
+
versionDeleted: "Version deleted",
|
|
250
|
+
versionRestored: "Version restored",
|
|
251
|
+
versions: "Versions"
|
|
252
|
+
},
|
|
253
|
+
workspace: { errors: { notSelected: "No workspace selected" } },
|
|
254
|
+
bulk: { permanentDelete: { success: "Permanently deleted {{count}} items" } }
|
|
255
|
+
} };
|
|
256
|
+
//#endregion
|
|
257
|
+
export { e as enTranslations };
|
|
258
|
+
|
|
259
|
+
//# sourceMappingURL=en.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en.js","names":[],"sources":["../../src/translations/en.ts"],"sourcesContent":["/**\n * English fallback translations for microfe-files.\n *\n * Keys use dot-notation (e.g., 'files.browser.loading') which the\n * I18nProvider resolves against this nested object structure.\n *\n * This file is the source of truth for all translation keys used in this MFE.\n * Register it with the host shell's AppShellProvider.fallbackTranslations\n * to enable offline/fallback support.\n */\nexport const enTranslations = {\n files: {\n actionMenu: {\n moreActions: \"More actions\",\n },\n browser: {\n actions: {\n export: \"Export\",\n exportTitle: \"Export selected items\",\n goToRoot: \"Go to root folder\",\n newFolder: \"New Folder\",\n selectAll: \"Select all\",\n uploadFiles: \"Upload files\",\n uploadFolder: \"Upload folder\",\n uploadFolderTitle: \"Upload folder\",\n },\n delete: \"Delete\",\n items: \"items\",\n loading: \"Loading files…\",\n modified: \"Modified\",\n name: \"Name\",\n openFolder: \"Open folder\",\n owner: \"Owner\",\n rename: \"Rename\",\n retry: \"Retry\",\n rootLabel: \"My Drive\",\n search: {\n clear: \"Clear search\",\n showingResults: 'Showing {{count}} results for \"{{query}}\"',\n },\n selection: {\n selectedCount: \"{{count}} selected\",\n actions: {\n restore: \"Restore\",\n },\n },\n size: \"Size\",\n tabs: {\n all: \"All Files\",\n bin: \"Bin\",\n recent: \"Recent\",\n starred: \"Starred\",\n },\n view: {\n grid: \"Grid view\",\n list: \"List view\",\n },\n workspace: {\n notSelected: \"No workspace selected\",\n waiting: \"Waiting for workspace...\",\n },\n loadError: \"Failed to load files\",\n unexpectedError: \"An unexpected error occurred\",\n },\n card: {\n activity: \"Activity\",\n addToStarred: \"Add to starred\",\n delete: \"Delete\",\n details: \"Details\",\n download: \"Download\",\n favorite: \"Favorite\",\n makeCopy: \"Make a copy\",\n moveTo: \"Move to\",\n rename: \"Rename\",\n restore: \"Restore\",\n share: \"Share\",\n shared: \"Shared\",\n unfavorite: \"Remove from starred\",\n },\n common: {\n actions: {\n cancel: \"Cancel\",\n clear: \"Clear\",\n close: \"Close\",\n create: \"Create\",\n delete: \"Delete\",\n deletePermanently: \"Delete permanently\",\n done: \"Done\",\n move: \"Move\",\n rename: \"Rename\",\n share: \"Share\",\n },\n },\n confirm: {\n bulkPermanentDelete: {\n description:\n \"This action cannot be undone. All selected items will be permanently deleted.\",\n title: \"Permanently delete {{count}} items\",\n },\n deleteFile: {\n description:\n \"Are you sure you want to delete this file? It will be moved to the bin.\",\n title: \"Delete file\",\n },\n deleteFolder: {\n description:\n \"Are you sure you want to delete this folder? It will be moved to the bin.\",\n title: \"Delete folder\",\n },\n permanentDeleteFile: {\n description:\n \"This file will be permanently deleted. This action cannot be undone.\",\n title: \"Permanently delete file\",\n },\n permanentDeleteFolder: {\n description:\n \"This folder and all its contents will be permanently deleted. This action cannot be undone.\",\n title: \"Permanently delete folder\",\n },\n },\n contextMenu: {\n activity: \"Activity\",\n addToStarred: \"Add to starred\",\n delete: \"Delete\",\n download: \"Download\",\n fileInfo: \"File information\",\n folderInfo: \"Folder information\",\n moveTo: \"Move to\",\n removeStar: \"Remove star\",\n rename: \"Rename\",\n restore: \"Restore\",\n share: \"Share\",\n },\n copyDialog: {\n copy: \"Copy\",\n copyHere: \"Copy here\",\n copyOf: \"Copy of\",\n copying: \"Copying...\",\n makeCopyOf: 'Make a copy of \"{{name}}\"',\n myDrive: \"My Drive\",\n name: \"Name\",\n title: \"Copy item\",\n },\n empty: {\n all: {\n description: \"Upload files or create folders to get started\",\n title: \"No files or folders yet\",\n },\n bin: {\n description: \"Deleted files and folders will appear here\",\n title: \"Bin is empty\",\n },\n newFolder: \"New Folder\",\n recent: {\n description: \"Files you recently opened will appear here\",\n title: \"No recent files\",\n },\n starred: {\n description: \"Star files and folders to find them easily\",\n title: \"No starred items\",\n },\n uploadFiles: \"Upload Files\",\n },\n file: {\n copy: {\n success: '\"{{name}}\" copied',\n },\n delete: {\n success: '\"{{name}}\" deleted',\n },\n download: {\n success: \"Downloaded {{name}}\",\n },\n errors: {\n copyFailed: \"Failed to copy file\",\n deleteFailed: \"Failed to delete file\",\n downloadFailed: \"Failed to download file\",\n downloadUrlUnavailable: \"Download URL is not available\",\n moveFailed: \"Failed to move file\",\n permanentDeleteFailed: \"Failed to permanently delete file\",\n renameFailed: \"Failed to rename file\",\n restoreFailed: \"Failed to restore file\",\n starFailed: \"Failed to update star status\",\n },\n move: {\n success: '\"{{name}}\" moved',\n },\n permanentDelete: {\n success: '\"{{name}}\" permanently deleted',\n },\n rename: {\n success: 'Renamed \"{{name}}\"',\n },\n restore: {\n success: '\"{{name}}\" restored',\n },\n },\n folder: {\n errors: {\n copyUnsupported: \"Copying folders is not supported\",\n createFailed: \"Failed to create folder\",\n deleteFailed: \"Failed to delete folder\",\n moveFailed: \"Failed to move folder\",\n permanentDeleteFailed: \"Failed to permanently delete folder\",\n renameFailed: \"Failed to rename folder\",\n restoreFailed: \"Failed to restore folder\",\n starFailed: \"Failed to update star status\",\n },\n item: \"item\",\n move: {\n success: '\"{{name}}\" moved',\n },\n delete: {\n success: '\"{{name}}\" deleted',\n },\n permanentDelete: {\n success: '\"{{name}}\" permanently deleted',\n },\n restore: {\n success: '\"{{name}}\" restored',\n },\n rename: {\n success: 'Renamed \"{{name}}\"',\n },\n },\n info: {\n contents: \"Contents\",\n created: \"Created\",\n fileInfo: \"File information\",\n files: \"Files\",\n folder: \"Folder\",\n folderInfo: \"Folder information\",\n folders: \"Folders\",\n modified: \"Modified\",\n no: \"No\",\n owner: \"Owner\",\n path: \"Path\",\n properties: \"Properties\",\n size: \"Size\",\n starred: \"Starred\",\n status: \"Status\",\n type: \"Type\",\n unknown: \"Unknown\",\n visibility: \"Visibility\",\n yes: \"Yes\",\n },\n item: {\n errors: {\n moveFailed: \"Failed to move item\",\n renameFailed: \"Failed to rename item\",\n },\n },\n moveDialog: {\n actions: {\n moving: \"Moving...\",\n },\n title: \"Move item\",\n },\n preview: {\n addStar: \"Add to starred\",\n removeStar: \"Remove from starred\",\n },\n search: {\n filters: {\n title: \"Search filters\",\n },\n input: {\n placeholder: \"Search files...\",\n },\n },\n share: {\n back: \"Back to files\",\n password: {\n label: \"Password\",\n },\n title: \"Share\",\n unlock: \"Enter password to access\",\n },\n upload: {\n active: \"{{count}} uploading\",\n cancel: \"Cancel\",\n completed: \"{{count}} completed\",\n errors: {\n failed: \"Upload failed\",\n quotaExceeded:\n \"Storage quota exceeded. Please upgrade your plan or delete files.\",\n },\n failed: \"Upload failed\",\n noUploads: \"No uploads in progress\",\n pause: \"Pause\",\n paused: \"Paused\",\n pending: \"{{count}} pending\",\n resume: \"Resume\",\n retry: \"Retry\",\n uploads: \"Uploads\",\n },\n version: {\n deleteVersion: \"Delete version\",\n major: \"Major version\",\n restore: \"Restore\",\n restoreVersion: \"Restore this version\",\n restoredFrom: \"Restored from version {{version}}\",\n total: \"{{count}} versions\",\n version: \"Version\",\n versionDeleted: \"Version deleted\",\n versionRestored: \"Version restored\",\n versions: \"Versions\",\n },\n workspace: {\n errors: {\n notSelected: \"No workspace selected\",\n },\n },\n bulk: {\n permanentDelete: {\n success: \"Permanently deleted {{count}} items\",\n },\n },\n },\n};\n"],"mappings":";AAUA,IAAa,IAAiB,EAC5B,OAAO;CACL,YAAY,EACV,aAAa,gBACd;CACD,SAAS;EACP,SAAS;GACP,QAAQ;GACR,aAAa;GACb,UAAU;GACV,WAAW;GACX,WAAW;GACX,aAAa;GACb,cAAc;GACd,mBAAmB;GACpB;EACD,QAAQ;EACR,OAAO;EACP,SAAS;EACT,UAAU;EACV,MAAM;EACN,YAAY;EACZ,OAAO;EACP,QAAQ;EACR,OAAO;EACP,WAAW;EACX,QAAQ;GACN,OAAO;GACP,gBAAgB;GACjB;EACD,WAAW;GACT,eAAe;GACf,SAAS,EACP,SAAS,WACV;GACF;EACD,MAAM;EACN,MAAM;GACJ,KAAK;GACL,KAAK;GACL,QAAQ;GACR,SAAS;GACV;EACD,MAAM;GACJ,MAAM;GACN,MAAM;GACP;EACD,WAAW;GACT,aAAa;GACb,SAAS;GACV;EACD,WAAW;EACX,iBAAiB;EAClB;CACD,MAAM;EACJ,UAAU;EACV,cAAc;EACd,QAAQ;EACR,SAAS;EACT,UAAU;EACV,UAAU;EACV,UAAU;EACV,QAAQ;EACR,QAAQ;EACR,SAAS;EACT,OAAO;EACP,QAAQ;EACR,YAAY;EACb;CACD,QAAQ,EACN,SAAS;EACP,QAAQ;EACR,OAAO;EACP,OAAO;EACP,QAAQ;EACR,QAAQ;EACR,mBAAmB;EACnB,MAAM;EACN,MAAM;EACN,QAAQ;EACR,OAAO;EACR,EACF;CACD,SAAS;EACP,qBAAqB;GACnB,aACE;GACF,OAAO;GACR;EACD,YAAY;GACV,aACE;GACF,OAAO;GACR;EACD,cAAc;GACZ,aACE;GACF,OAAO;GACR;EACD,qBAAqB;GACnB,aACE;GACF,OAAO;GACR;EACD,uBAAuB;GACrB,aACE;GACF,OAAO;GACR;EACF;CACD,aAAa;EACX,UAAU;EACV,cAAc;EACd,QAAQ;EACR,UAAU;EACV,U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ACD,MAAM,EACJ,QAAQ;EACN,YAAY;EACZ,cAAc;EACf,EACF;CACD,YAAY;EACV,SAAS,EACP,QAAQ,aACT;EACD,OAAO;EACR;CACD,SAAS;EACP,SAAS;EACT,YAAY;EACb;CACD,QAAQ;EACN,SAAS,EACP,OAAO,kBACR;EACD,OAAO,EACL,aAAa,mBACd;EACF;CACD,OAAO;EACL,MAAM;EACN,UAAU,EACR,OAAO,YACR;EACD,OAAO;EACP,QAAQ;EACT;CACD,QAAQ;EACN,QAAQ;EACR,QAAQ;EACR,WAAW;EACX,QAAQ;GACN,QAAQ;GACR,eACE;GACH;EACD,QAAQ;EACR,WAAW;EACX,OAAO;EACP,QAAQ;EACR,SAAS;EACT,QAAQ;EACR,OAAO;EACP,SAAS;EACV;CACD,SAAS;EACP,eAAe;EACf,OAAO;EACP,SAAS;EACT,gBAAgB;EAChB,cAAc;EACd,OAAO;EACP,SAAS;EACT,gBAAgB;EAChB,iBAAiB;EACjB,UAAU;EACX;CACD,WAAW,EACT,QAAQ,EACN,aAAa,yBACd,EACF;CACD,MAAM,EACJ,iBAAiB,EACf,SAAS,uCACV,EACF;CACF,EACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/microfe-files",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.527.1",
|
|
4
4
|
"description": "Burdenoff Files Microfrontend - Standalone file management module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"imports": {
|
|
@@ -49,11 +49,8 @@
|
|
|
49
49
|
"@tanstack/react-query": "^5.90.17",
|
|
50
50
|
"graphql": "^16.12.0",
|
|
51
51
|
"lucide-react": "^0.468.0",
|
|
52
|
-
"pdfjs-dist": "^5.4.530",
|
|
53
|
-
"prism-react-renderer": "^2.4.1",
|
|
54
52
|
"react": "^19.0.0",
|
|
55
53
|
"react-dom": "^19.0.0",
|
|
56
|
-
"react-pdf": "^10.3.0",
|
|
57
54
|
"react-router-dom": "^7.1.3",
|
|
58
55
|
"zustand": "^5.0.3"
|
|
59
56
|
},
|
package/dist/config/index.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configuration module for files microfrontend
|
|
3
|
-
* This config is typically injected by the shell application at runtime
|
|
4
|
-
*/
|
|
5
|
-
export interface FilesConfig {
|
|
6
|
-
/** Full GraphQL endpoint URL (e.g., http://localhost:4003/workspaces/graphql) */
|
|
7
|
-
apiGatewayUrl: string;
|
|
8
|
-
/** Base URL for gateway (optional, used to construct full endpoint) */
|
|
9
|
-
apiGatewayBaseUrl?: string;
|
|
10
|
-
/** Auth token for API requests */
|
|
11
|
-
authToken?: string;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Get current configuration
|
|
15
|
-
*/
|
|
16
|
-
export declare const config: FilesConfig;
|
|
17
|
-
/**
|
|
18
|
-
* Set runtime configuration (called by shell app)
|
|
19
|
-
* @param newConfig - Configuration object
|
|
20
|
-
*/
|
|
21
|
-
export declare function setFilesConfig(newConfig: Partial<FilesConfig>): void;
|
|
22
|
-
/**
|
|
23
|
-
* Build full GraphQL endpoint URL from base URL
|
|
24
|
-
* @param baseUrl - Base gateway URL (e.g., http://localhost:4003)
|
|
25
|
-
* @param supergraph - Supergraph name (workspaces or global)
|
|
26
|
-
* @returns Full GraphQL endpoint URL
|
|
27
|
-
*/
|
|
28
|
-
export declare function buildGraphQLEndpoint(baseUrl: string, supergraph?: "workspaces" | "global"): string;
|
|
29
|
-
/**
|
|
30
|
-
* Reset configuration to defaults
|
|
31
|
-
*/
|
|
32
|
-
export declare function resetFilesConfig(): void;
|
|
33
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,WAAW;IAC1B,iFAAiF;IACjF,aAAa,EAAE,MAAM,CAAC;IACtB,uEAAuE;IACvE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kCAAkC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAYD;;GAEG;AACH,eAAO,MAAM,MAAM,aAIjB,CAAC;AAEH;;;GAGG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI,CAEpE;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,UAAU,GAAE,YAAY,GAAG,QAAuB,GACjD,MAAM,CAKR;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAMvC"}
|
package/dist/dev/main.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=main.d.ts.map
|
package/dist/dev/main.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/dev/main.tsx"],"names":[],"mappings":"AAQA,OAAO,uBAAuB,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { FilesRootProps } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Root component for the Files microfrontend.
|
|
5
|
-
*
|
|
6
|
-
* This is the main entry point that host applications import and render.
|
|
7
|
-
* It sets up the necessary providers and renders the internal routing.
|
|
8
|
-
* Automatically registers navigation items with the shell if registration functions are provided.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```tsx
|
|
12
|
-
* import { FilesRoot } from '@burdenoff/micro-fe/files';
|
|
13
|
-
*
|
|
14
|
-
* function App() {
|
|
15
|
-
* return (
|
|
16
|
-
* <Route path="/files/*" element={
|
|
17
|
-
* <FilesRoot
|
|
18
|
-
* basePath="/files"
|
|
19
|
-
* navigate={navigate}
|
|
20
|
-
* currentUser={user}
|
|
21
|
-
* workspaceId="ws-123"
|
|
22
|
-
* apiGatewayUrl="https://api.example.com"
|
|
23
|
-
* authToken="token"
|
|
24
|
-
* />
|
|
25
|
-
* } />
|
|
26
|
-
* );
|
|
27
|
-
* }
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
export declare const FilesRoot: FC<FilesRootProps>;
|
|
31
|
-
//# sourceMappingURL=FilesRoot.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FilesRoot.d.ts","sourceRoot":"","sources":["../../src/files/FilesRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAOhC,OAAO,KAAK,EAAW,cAAc,EAAE,MAAM,SAAS,CAAC;AAcvD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA6FxC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Internal router for the Files microfrontend.
|
|
3
|
-
* This component handles routing within the microfrontend using React Router v7.
|
|
4
|
-
*
|
|
5
|
-
* Routes:
|
|
6
|
-
* - / → Redirect to browse
|
|
7
|
-
* - /browse → File browser page (root folder) - eager loaded
|
|
8
|
-
* - /browse/:folderId → File browser page (specific folder) - eager loaded
|
|
9
|
-
* - /* → Catch-all redirects to browse
|
|
10
|
-
*/
|
|
11
|
-
export declare function FilesRoutes(): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
//# sourceMappingURL=FilesRoutes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FilesRoutes.d.ts","sourceRoot":"","sources":["../../src/files/FilesRoutes.tsx"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AACH,wBAAgB,WAAW,4CAgC1B"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
export interface ActionMenuItem {
|
|
3
|
-
label: string;
|
|
4
|
-
icon?: React.ReactNode;
|
|
5
|
-
onClick: () => void;
|
|
6
|
-
variant?: "default" | "danger";
|
|
7
|
-
divider?: boolean;
|
|
8
|
-
}
|
|
9
|
-
interface ActionMenuProps {
|
|
10
|
-
items: ActionMenuItem[];
|
|
11
|
-
triggerClassName?: string;
|
|
12
|
-
menuClassName?: string;
|
|
13
|
-
align?: "left" | "right";
|
|
14
|
-
isOpen?: boolean;
|
|
15
|
-
onToggle?: (open: boolean) => void;
|
|
16
|
-
}
|
|
17
|
-
export declare const ActionMenu: FC<ActionMenuProps>;
|
|
18
|
-
export {};
|
|
19
|
-
//# sourceMappingURL=ActionMenu.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ActionMenu.d.ts","sourceRoot":"","sources":["../../../src/files/components/ActionMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAA+B,MAAM,OAAO,CAAC;AAM7D,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,UAAU,eAAe;IACvB,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACpC;AAED,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAsJ1C,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
interface ConfirmDialogProps {
|
|
3
|
-
title: string;
|
|
4
|
-
description: ReactNode;
|
|
5
|
-
confirmLabel: string;
|
|
6
|
-
cancelLabel: string;
|
|
7
|
-
variant?: "danger" | "default";
|
|
8
|
-
loading?: boolean;
|
|
9
|
-
onConfirm: () => void;
|
|
10
|
-
onCancel: () => void;
|
|
11
|
-
}
|
|
12
|
-
export declare function ConfirmDialog({ title, description, confirmLabel, cancelLabel, variant, loading, onConfirm, onCancel, }: ConfirmDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=ConfirmDialog.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmDialog.d.ts","sourceRoot":"","sources":["../../../src/files/components/ConfirmDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAA4B,MAAM,OAAO,CAAC;AAGjE,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,SAAS,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,WAAW,EACX,YAAY,EACZ,WAAW,EACX,OAAmB,EACnB,OAAe,EACf,SAAS,EACT,QAAQ,GACT,EAAE,kBAAkB,2CA8FpB"}
|